Suggested keyword or alternative search results...
We've trying to show suggested searches and initially hoped that the new lexicon and suggestions-tag would help but they do not.
Couple of examples:
Added sennheiser as a lexicon, search for sennheizer, sennhiser. it returns the suggestions as we would expect.
So far, so good :)
Searching for senhizer returns no results and no suggestions?
We also have company names we want to add such as i-Movix. When we try adding them as a lexicon it says 'i-Movix' is not a valid word.
Is there a way to improve this?
Current results tag:
{exp:low_search:results
query="{segment_2}"
{if get:collection}channel="{get:collection}"{/if}
require_query="yes"
limit="10"
paginate="bottom"
status="not closed"
disable="member_data|category_fields"
orderby="date"
keywords:loose="both"
}
Replies
Low 10 Aug 2015 16:19
The keyword suggestions, by default, uses a Levenshtein algorithm to determine the distance between two words, and limits suggestions by it. Most likely, searching for "senhizer" the distance is simple too far, and therefore the term "sennheiser" is not included. You can try tweaking the parameters: set the distance to 3, or try using Soundex instead.
As for words with hyphens -- they are currently considered two words. Treating hyphenated words as single words is not supported at the moment.
Paul Cripps 10 Aug 2015 21:07
o.k. that makes sense, thank you Low.
I was just thinking about this... if there are specific spelling corrections such as 'senhizer' then the simplest fix would be an additional field for the given channel, say 'search_keywords'.
This could then be populated with these alternative keywords, added to the collection and given a weight.
Then searches would result the correct result. :)
Low 11 Aug 2015 08:03
Yep, that would always work.