typesense-swift
typesense-swift copied to clipboard
Add `inFix`, `maxExtraPrefix` and `maxExtraSuffix` search parameters
Infix searching now works with the typesense-swift. Here's how to implement the same:
- Mark a field as
infix: true
in field defintion while creating the collection schema. - Create search parameters with infix value to be either off, always or fallback. Use comma separated values to assign infix property to each of the query_by fields.
Eg:
SearchParameters(q: "abc", queryBy: "name,city,address", inFix: "off,always,off", maxExtraPrefix: 3)
in this example, the infix assigned to each of the fields are -> name: off, city: always, address: off. - Use
maxExtraPrefix
andmaxExtraSuffix
to fine tune the infix searching. If you want the query "DEF" to bring back the result "ABCDEF" thenmaxExtraPrefix
should at least be 3. Suffix works similarly, but is used for characters after the query.
Hi. So infix search is not available yet for swift?
Added in https://github.com/typesense/typesense-swift/pull/30