typesense-instantsearch-adapter icon indicating copy to clipboard operation
typesense-instantsearch-adapter copied to clipboard

Allow change query in runtime

Open AlexGear opened this issue 11 months ago • 4 comments

Hey guys, I know that there is an opportunity to use client to make custom requests but maybe you will consider giving a way to change query_by parameter in runtime? Can be useful in plenty of situations.

AlexGear avatar Apr 29 '25 19:04 AlexGear

You can use the updateConfiguration method to change any of the parameters you use to instantiate the adapter: https://github.com/typesense/typesense-instantsearch-adapter/blob/603d597fbd4d8b6e338e34aa07dafe8442f1b468/src/TypesenseInstantsearchAdapter.js#L81

jasonbosco avatar Apr 29 '25 19:04 jasonbosco

Thank you sir, that's the way to completely change it but what if I want to make one of the searches inside of one multi_search query to query_by something else? And I don't want to create any another entity, just to change that string parameter inside?

AlexGear avatar Apr 29 '25 20:04 AlexGear

For example, I have an entity, that have next fields: { "Parameter1":"anything", "NestedField":{ "Variant1": "first", "Variant2": "second" } }

And I want to perform a search on "Parameter1" with one query and limitations (for example number of typos and so on) and on NestedField.Variant1 with another options. There should be the way to do it in one request rather than using internal client or creating another instance, especially when Typesense itself supports it

AlexGear avatar Apr 29 '25 20:04 AlexGear

👍

EXELANCE-LLC avatar May 18 '25 11:05 EXELANCE-LLC