gitbook-plugin-search-plus
gitbook-plugin-search-plus copied to clipboard
Question: does it search metadata?
Hi,
Does the plugin takes metadata into account? I would like to add some relevance to the chapters via YAML frontmatter (that will go to the metadata), but I'm not sure if it will affect the search ranking. Could you please confirm?
Thanks, Imre
search plugin only search the text write in md files. All the data can be searched was indexed in search_plus_index.json .
Thank you for the answer!
Is it possible to add this functionality? It would be great if could make pages rank higher in the search results by adding metadata.
Thanks!
This is interesting to me as well, if this plugin somehow inspired by original lunr, then it would be nice to adopt search keywords in front-matter section, like this:
Adding keywords to a page You can specify explicit keywords for any page.
--- search: keywords: ['keyword1', 'keyword2', 'etc.'] ---My Page
This page will rank better if we search for 'keyword1'.
@hellt The purpose of this plugin is to search the contents of the page, and metadata will not be presented in the page, which may make users feel troubled. If you really need, I will try to add this feature.
It would be really useful, if you can add it, that would be awesome! Thanks a lot!
@nagim @hellt , here is test link: https://lwdgit.github.io/gitbook-plugin-search-plus/book/?q=keyword1 , If there are other problems, please give me feedback😄!
That is close!
What I would like to see is the following:
Suppose I have a big book where some pages are about Star Wars and other are about Star Treck
Pages type also differs, I can have Bio and Article pages.
So I will add keywords like these:
search:
keywords: ['Star Trek', 'Bio']
for one page and
search:
keywords: ['Star Wars', 'Bio']
for another.
Now in the search field if I add keywords:Star Wars I expect to see all the pages that were tagged with Star Wars
If I add keywords:Star Wars, Bio I should filter only pages tagged with both keywords Star Wars and Bio
And in the most advanced case if I add Darth Vader keywords:Star Wars, Bio I shoud receive only pages tagged with Star Wars and Bio and having Darth Vader string somewhere inside
@hellt Is this ok? https://lwdgit.github.io/gitbook-plugin-search-plus/book/?q=react%3Ameta , Or try it by yourself :
npm install [email protected]
@lwdgit when you do react:meta you are displaying the pages, that have react placed in keywords?
If yes, then I do not see why you need to highlight this word in the search results.
What I see is missing is that if you want to search for pages, that have react in keywords and a particular text
For example Native react:meta search input should filter/highlight which react-tagged pages have Native word in its body.
@lwdgit Thanks a lot, I will also test it soon!
How to change the search result prompt to Chinese prompt?
How to change the search result prompt to Chinese prompt?