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

Disable range option? #130

Closed
tfwright opened this issue Sep 10, 2014 · 2 comments
Closed

Disable range option? #130

tfwright opened this issue Sep 10, 2014 · 2 comments

Comments

@tfwright
Copy link

Thanks for this useful tool.

I want to allow searching a specific category foo with a query like bar-baz, but picky is currently trying to convert it into a range (which is crazy). Is there a way to specify that this category should not allow user options?

@floere
Copy link
Owner

floere commented Sep 10, 2014

Hi @tfwright, thanks.
And yeah, currently in Picky - is by default a range character, and both ends are then used to do a range query.
This can be mitigated by telling Picky to use a different range character like so:

Picky::Query::Token.range_character = "…"
Picky::Search.new(some_index).search("year:2000…2008") # Will find results in a range.

Here's the spec for it: https://github.com/floere/picky/blob/master/server/spec/functional/custom_delimiters_spec.rb#L91-L110

So, no, you can't yet tell Picky not to allow user options, you can only set the range character to something unusual. However, I am thinking about making it settable to nil (#131).

Cheers

@tfwright
Copy link
Author

@floere that solved my problem--thanks.

@floere floere closed this as completed Nov 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants