Improve ordering search results with several words by relevancy

Feature name

  • Improve sort by relevancy of search results with several words

Feature function

  • At now search results have strange order, when we type several words. For example, I type brick-prod root and see results in this order:
  1. Брик: площадка prod - staging.brick
  2. Брик: сервер brick-prod: mysql user - brick
  3. Брик: brick-osm2 - root
  4. Брик: сервер brick-prod: linux user - brick
  5. [email protected]
  6. Брик: сервер brick-prod: linux user - root
  7. Брик: сервер brick-prod: mysql user - root
  8. Брик: сервер brick-prod: solr user - brick
  9. Брик: сервер brick-dev - root
  10. Брик: сервер brick-osm - root
  11. Брик: сервер brick-osm - brick
  12. Брик: сервер brick-dev mysql - root

The searched item is bold.

The questions:

  • Why needed item have only 6’th place, instead of first, if it have best relevancy to typed search string?
  • And why on 3 place there is item, that even don’t have “prod” or “brick-prod” word, not in name or in any other field, and not have any substring match?
  • Does the search algorithm add some boost to name field, comparing to other fields?

Can anybody please describe, why current ordering of search results so terrible?

The solution:
Solution for this problem can be improving search ordering algorithm, that will order results by those rules:

  1. Boost full word matches first, than part-word.
  2. Boost matches in “Name” field, comparing to other field.
  3. If typed word have hypens (brick-prod in my example) - boost the exact match.
  4. Boost full substring match. And, maybe, also allow to type exact phrase (in quotes) to make full subsrtring search, instead of fulltext search.

What do you think about proposed idea?

More examples:
Search phrase: brick-prod linux user root - results:

  1. Брик: сервер brick-prod: linux user - brick
  2. Брик: сервер brick-prod: linux user - root

Search phrase: brick-prod linux root - results:

  1. Брик: площадка prod - staging.brick.ru
  2. Брик: сервер brick-prod: linux user - brick
  3. Брик: сервер brick-prod: linux user - root

Search phrase: brick-prod: linux user - root - results:

  1. Брик: сервер brick-prod: linux user - brick
  2. Брик: сервер brick-prod: linux user - root
1 Like

Thanks @Murz!

Great feedback. In the meantime, we use a library called Lunr to power search.

There are lots of ways to parse data with it, and should be able to achieve the results you’re looking for using some additional parameters. More on advanced search can be found here.

2 Likes

Thanks for the tip, I wasn’t know that this search supports improved operators, great!

But even so - the default search results looks strange (especially my last example when at first place there are item, that even not have “root” word in any field!), maybe they can be tuned-up too for better sorting of results by relevancy? At least, to move results with full match (all of the words) to top?

Maybe some additional system data are also added to Lunr index (maybe some path exactly with “root” word), that give me such wrong results?

I believe the reason for your example result set is because ‘brick’ - one of your first search terms, appears two times in the first object, ranking it higher, but I do understand your point and we have this request captured as search is only going to get more and more important :slight_smile:

1 Like

I’m out of votes, but I would like to +1 the idea of improving the order of search results.

See this U-2-U thread for more details: In what order are cards supposed to be listed in search results?