18F / jekyll_pages_api_search

DEPRECATED - Jekyll search plugin based on lunr.js and jekyll_pages_api
https://rubygems.org/gems/jekyll_pages_api_search
Other
39 stars 8 forks source link

Ability to return front matter in results #31

Open humancompanion opened 8 years ago

humancompanion commented 8 years ago

USAJOBS is using jekyll-lunr-js-search for our new Help Center search: https://www.usajobs.gov/Help/

I found theirs before finding yours. I switched over to jekyll_pages_api_search on a branch in hopes of customizing the search results and improving upon what we currently return. Specifically, I'd like to return more of the front-matter from each article. For example: tags, a short description, perhaps even a blurb from the page (though I'd imagine that would bloat the search-index.json file).

I noticed tags were defined in the index_fields in _config.yml and got my hopes up that I could access them. Is there a way to do so that I'm not aware of? If so, can you point me in the right direction? If not, any chance of directing me to where I insert such a thing? I browsed at the Ruby library but, I'm not familiar with the Jekyll API and where to make the modification didn't jump out at me. Thanks for your help.

maya commented 8 years ago

@humancompanion hey just saw this... this plugin uses jekyll_pages_api gem so looks like it would need to be solved there so that this plugin can accept those new terms. Also, looks like there's already an issue for just that: https://github.com/18F/jekyll_pages_api/issues/11

cc: @jbarnicle @afeld

humancompanion commented 8 years ago

Thanks @maya!

jayvdb commented 6 years ago

Note that https://github.com/18F/jekyll_pages_api/issues/11 was closed as fixed. I am not seeing the frontmatter in the JSON, hence I raised a new issue https://github.com/18F/jekyll_pages_api/issues/43 .

Also its tests are failing https://github.com/18F/jekyll_pages_api/issues/42 , so that may also explain the problem.