Closed Guillaume-Developer closed 9 months ago
Hi Guillaume,
Not sure why the second approach doesn't work, but for the first approach, you can replace tap()
with a map()
(and the forEach()
also needs to be replaced):
return this.suggestQueryWebService.get(sugQuery, text.substring(i), ccquery).pipe(
map(suggests => suggests?.filter(suggest => suggest.category.toLowerCase() !== "title").map(s => ({...s, display: prefix + s.display})))
);
Hi Eric,
map()
instead of tap()
did the trick. Thank you.
Not sure why the second approach doesn't work either though.
I did set the kinds in my Suggestion Lexicon and I do see the kinds
parameter being sent correctly as a parameter in the network tab.
I am currently implementing the newest version of the SBA for a customer, and I am having troubles with the new strategy for the autocomplete.
When using the autocomplete, if no suggestions are returned, a new suggestion query is sent using only the last word. This works fine, but it then returns suggestions for the last word in all fields of my suggestions service, including the Title field. The Title field is not really a good fit for this kind of autocompletion, and I would like to remove it from my suggestion results, but I couldn't find a way to do that.
I have tried the following changes in the
get(suggestQuery: string | undefined, text: string, fields?: string | string[], query?: Query, maxCount = 10)
of thesuggestions.service.ts
but none of them worked.Add a
filter()
on the suggests resultsAdd the kinds parameter when fetching the suggestions