I am having some trouble with EPiServer search. If I search for multiple words, e.g. "foo bar", I will get the result presented like this:
foo somethingfoo barfoo thing
I tried to order by score, but then I saw the score is 0.0 on every hit. I found this blog post: https://world.episerver.com/blogs/Anders-Hattestad/Dates/2016/2/when-episerver.searchs-score-is-zero/, and this resolved the problem, though it's not a good solution.
Then, the scores were like this:
foo something (2.3)foo bar (0.43)foo thing (0.40)
Why is "foo something" getting a higher score than "foo bar", which is the exact search term?? And is there any better solution for getting the score, than changing the culture?
https://world.episerver.com/FAQ/Items/Search-algorithm-in-Episerver/ Explains how the algorithm works for Episerver Search.
If I remember correctly, rather than how close words are located it will mainly rank them on amount of uses of a word on the page in relation to every page. "The total number of occurrences of each word in a page is matched in a search with the total number of times the word is occurring on every page." I don't remember that language issue, but I think even if the score value doesn't work it will always return the results sorted on rank. One idea could be to do double searches, one with "foo bar" and one as separate words, not the most beautiful solution.
Can you wrap your search text in double quotes to see if it changes anything?
Aniket: Yes, if I do - the only hit I get, is the one that contains the whole search text. But it doesn't really solve the problem.