Question

I have a Capture model which uses searchkick:

class Capture < ActiveRecord::Base

  searchkick  autocomplete: ['name'],
              synonyms: [["scallion", "green onion"], ["qtip", "cotton swab"]]


end

I'd like to do a search by name (autocomplete) in the Capture model so I tried this in console:

Capture.search("scallio", autocomplete: true, limit: 10)

In my DB I have one Capture with the name "scallion" and one other with "green onion".

I would have expected that the above search return 2 elements thanks to the synonyms option but it returns only one item.

Maybe I misunderstood the synonyms option, or did I miss something else?

Was it helpful?

Solution

Autocomplete does not take synonyms into account at the moment. I'll add a note to the readme.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top