buda-base / autocomplete-prototype

prototype for an autocomplete service for BDRC
MIT License
2 stars 0 forks source link

strange cut string in the autocomplete leading to no results #10

Closed eroux closed 3 months ago

eroux commented 3 months ago

see

https://github.com/user-attachments/assets/57d4f440-9158-4bc3-8e5b-47f48974610b

eroux commented 3 months ago

this is an interesting issue, I can't find the corresponding documentation but it seems the results given by autocomplete are truncated to 50 characters... still investigating but one way to just work around that would be: if the string is 50 characters, cut before the last space

eroux commented 3 months ago

I think I see what's going on, this is because the undocumented parameter max_input_length is 50 by default, so all results will be cut at 50 characters: https://github.com/opensearch-project/documentation-website/issues/7877

eroux commented 3 months ago

looks fixed

roopeux commented 3 months ago

I overwrote your fix because the root problem could be fixed in a simple way. I increased max_input_length to 100 so that automatic truncation will never happen, and limited tokens per autosuggest from 15 to 12 to avoid too long suggestions. These settings will work for Wylie and any language where words are less than 8 chars in average.

bdrc_autosuggest has been reindexed with the version that is now in the repo. bdrc_search.py can be deployed, although it will probably not make difference.

eroux commented 3 months ago

I can't see any reason to overwrite my fix, it's not hurting and it will fix the few edge cases that will be above 100 chars, putting it back. Generally speaking please don't overwrite people's code on git without prior discussion, it's rude