You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've enabled synonym support in my elasticsearch, which means, for example, end users might search for "trousers" and get back results that do not contain "trousers" but do contain "pants". I think that getSuggestions is hiding these results. Have you put any thought into this scenario? I think I understand what the filtering here is trying to do, which is handle when the user has changed their search term by the time results come back ( right? ), but in my case it's hiding results I'd still like to see.
@focusaurus This is a good point. The filtering is there to get distinct suggestions, however the way it currently is being set, it would not show synonyms. I don't have an answer atm on what would be the best way to handle this, open to suggestions.
@siddharthlatest I have implemented your suggestion, and the synonyms still get filtered out. And that is because, getSuggestions will have already been called by the time custom suggestions rendering executes. This line is redundant, https://github.com/appbaseio/reactivecore/blob/master/src/utils/suggestions.js#L30, Elasticsearch will have already search for a match, and it's not taking into consideration synonyms, which Elasticsearch does.
@willopez Is the above comment still relevant? With v3.0, we pass rawData which would contains the unparsed suggestions. I saw the related PR here, but the currentValue based match is an important filter to remove duplicates (when your data may not contain distinct values) and in most scenarios is a good default. Removing that isn't a good idea.
Activity
siddharthlatest commentedon Jan 23, 2019
@focusaurus This is a good point. The filtering is there to get distinct suggestions, however the way it currently is being set, it would not show synonyms. I don't have an answer atm on what would be the best way to handle this, open to suggestions.
siddharthlatest commentedon Jan 24, 2019
@focusaurus This should actually be possible, can you try using https://opensource.appbase.io/reactive-manual/advanced/customsuggestions.html?
willopez commentedon Apr 25, 2019
@siddharthlatest I have implemented your suggestion, and the synonyms still get filtered out. And that is because,
getSuggestionswill have already been called by the time custom suggestions rendering executes. This line is redundant, https://github.com/appbaseio/reactivecore/blob/master/src/utils/suggestions.js#L30, Elasticsearch will have already search for a match, and it's not taking into consideration synonyms, which Elasticsearch does.siddharthlatest commentedon Jul 31, 2019
@willopez Is the above comment still relevant? With v3.0, we pass
rawDatawhich would contains the unparsed suggestions. I saw the related PR here, but thecurrentValuebased match is an important filter to remove duplicates (when your data may not contain distinct values) and in most scenarios is a good default. Removing that isn't a good idea.