문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top