typesense / typesense-js

JavaScript / TypeScript client for Typesense
https://typesense.org/docs/api
Apache License 2.0
414 stars 75 forks source link

Prefix has no effect on the results #134

Open tzervou opened 2 years ago

tzervou commented 2 years ago

I'm looking for a way to configure my queries in order to show results that are a phrase prefix match or otherwise startswith. I tried setting the prefix parameter to true, but the quality of the results remains the same. The version I'm using: "typesense": "^1.4.0". Is there another way to configure the query to get such results? let searchParameters = { q: input, query_by: 'name', per_page: 5, highlight_fields: false, prefix: true, };

jasonbosco commented 2 years ago

Prefix search is set to true by default, so you don't have to explicitly enable it.

Could you share an example of a search query and a document you expect that to return from your dataset?