Searchkick: Fuzzy Searching with searchkick

Created on 18 Apr 2018  路  4Comments  路  Source: ankane/searchkick

Hey there!

I'm having a hard time finding out how I'm able to create fuzzysearch with searchkick and could use some advice.

1) I have a Client model on which I'll perform a search on.
2) I receive a query param from an API which I use in Client.search query, fields: [:name]

Everything works fine if I feed it enough characters but what I want to do is the following.

# Clients
Testingbot
Thoughtbot
Botfly

Client.search "est" -> should return Testingbot
Client.search "bot" -> should return all clients with bot in its name

The search either works with following matches:

:word # default
:word_start
:word_middle
:word_end
:text_start
:text_middle
:text_end

I'm unable to provide multiple options to fuzzy search the names of clients.
Any advice on how to tackle this problem with searchkick if possible?

Any advice

Kind regards

All 4 comments

Hey @JensDebergh, please use Stack Overflow for questions, as mentioned in the Contributing Guide.

@ankane Surely it would be more beneficial if the Searchkick documentation defined whether or not it can perform fuzzy queries, and if so, how?

@Jellyfishboy I've tried several configuration options with searchkick. Fuzzy search can be achieved by using:

  searchkick word_middle: [:property_to_fuzzy_search]

The documentation lacks explanation but it works.

Hope this helps

Thanks for the tip @JensDebergh 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomajask picture tomajask  路  4Comments

ankane picture ankane  路  5Comments

carolliu picture carolliu  路  3Comments

namila picture namila  路  4Comments

rajatgarg79 picture rajatgarg79  路  4Comments