Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass suggest: true to the search method for suggestions #1181

Closed
liang3404814 opened this issue Aug 1, 2018 · 4 comments
Closed

Pass suggest: true to the search method for suggestions #1181

liang3404814 opened this issue Aug 1, 2018 · 4 comments

Comments

@liang3404814
Copy link

Hi, I'm having the issue with suggestions raising Pass suggest: true to the search method for suggestions when there is no data to be indexed, however index has been built.

Products.count => 0
Products.reindex
result = Product.search('some words', suggest: true)
result.suggestions => Pass suggest: true to the search method for suggestions

This reads similar to #1042 but I'm on 3.1.0 already.

(it looks like https://github.com/ankane/searchkick/blob/master/lib/searchkick/results.rb#L86 tries to handle the situation for when term is "*", but not for other cases)

@ankane
Copy link
Owner

ankane commented Aug 1, 2018

Hey @liang3404814, be sure to follow all the instructions in the Suggestions section of the readme. If that doesn't work, please use the gist in the Contributing Guide to reproduce.

@liang3404814
Copy link
Author

Hi @ankane ,

Thanks for the response. I think I have followed the suggestions section. Here is the gist:
https://gist.github.com/liang3404814/348003675c9a9e88d2e1bde5e42d05c5

@ankane
Copy link
Owner

ankane commented Aug 2, 2018

Hey @liang3404814, unfortunately, that gist is not runnable. Please follow the format of the gist in the Contributing Guide. Also, there's no such thing as match: :suggest, so that could be the problem.

@liang3404814
Copy link
Author

@ankane Looks like match: :suggest is causing it. Was looking at source code (searchkick_suggest_index) when I wrote it. Thanks.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants