algolia / docsearch

:blue_book: The easiest way to add search to your documentation.
https://docsearch.algolia.com
MIT License
4k stars 389 forks source link

Irrelevant result when there's a space in the search term #2221

Closed user202729 closed 3 months ago

user202729 commented 7 months ago

Description

The search result appears to be irrelevant when there's a space in the search term.

Steps to reproduce

  1. Go to https://tikz.dev/
  2. Press ctrl+K, type "every path" in.
  3. The first result is "every pic" instead.
  4. The desired result should be https://tikz.dev/tikz-paths#pgf./tikz/every:path .
randombeeper commented 3 months ago

Hello @user202729, due to Algolia ranking, the two words separately rank other pages higher, likely due to the frequency of those words on those pages. You can search for "every path" which does put your desired page at the top. You can influence ranking in a number of ways https://www.algolia.com/doc/guides/managing-results/must-do/custom-ranking/#algolias-ranking-strategy. One to note might also be that if there are certain areas of your site which you want to appear higher in your results, you can leverage pageRank in your crawler config: https://docsearch.algolia.com/docs/record-extractor/#boost-search-results-with-pagerank.