Closed prenx4x closed 1 year ago
Hi @prenx4x ,
The standard use case for autoSuggest
is to auto complete a partial query string from the user input. Therefore, suggestion results are strings representing completed queries, and do not contain any document information like ID or stored fields. A suggestion can then be used as the query string passed to search
to retrieve matching documents.
If you want document IDs and fields that match a partial search, you should use the search
method with the prefix
option, like miniSearch.search(text, { prefix: true })
.
I hope this helps
Thanks for responding @lucaong Let me try search with prefix instead and see the results.
@prenx4x I will close the issue, as I think the question was answered, but feel free to comment further if more information is needed.
Hello, I am using minisearch for autocompletion. I add documents with this code -
My document looks like array of:
And then get suggetions using -
The output is -
As you can see I don't see description here, which I added as a storeFields. Also I don't see the id as well. If I got ID, then I could fetch other info from my original document array as well.
Am I missing something ot is this not supported in autosuggest?