Enabling Infix Search for Docsearch on Typesense

TLDR Vladimir wanted to enable infix search in typesense docsearch. Jason suggested adding infix as a parameter and enabling it in the collection schema by forking the typesense-docsearch scraper.

Powered by Struct AI
Jul 01, 2022 (18 months ago)
Photo of md5-7b8208683ba0167bf37013cf16be4f89
12:50 PM
I found that it is possible to add parameters to docsearch. To do that, you need to put the search tag before the closing body. Then, inside of it, it is possible to specify typesenseSearchParams. However, infix search parameter use doesn't look to be applicable in this case. Is there a way to enable infix search for docs sites?
Photo of md5-8813087cccc512313602b6d9f9ece19f
03:03 PM
Vladimir In addition to adding infix as a parameter to typesenseSearchParams, it also needs to be enabled in the collection schema when the scraper creates the collection.

To do this, you'd have to fork the typesense-docsearch scraper and add infix: true to the fields you need here: https://github.com/typesense/typesense-docsearch-scraper/blob/a005d7a8bbd45bd71fd3895024f05663e9f797c6/scraper/src/typesense_helper.py#L36-L51

And then run that version of the scraper on your docs site