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

Customize COMPLEX_QUERY_OPERATORS_PATTERN in query config #18

Closed
YegorKozlov opened this issue Apr 21, 2013 · 2 comments
Closed

Customize COMPLEX_QUERY_OPERATORS_PATTERN in query config #18

YegorKozlov opened this issue Apr 21, 2013 · 2 comments

Comments

@YegorKozlov
Copy link

It would be nice to let users ability to override COMPLEX_QUERY_OPERATORS_PATTERN from query configuration.

In my case I had to spend quite a bit of time understanding why queries containing a dash are not expanded, e.g. vendor-managed is not expanded because the dash character is in COMPLEX_QUERY_OPERATORS_PATTERN .

I would like to be able to customize it from configuration instead of changing the source code.

Regards,
Yegor

@nolanlawson
Copy link
Member

Hm, that's actually a really interesting problem. I disagree with the proposed solution, though; I think the COMPLEX_QUERY_OPERATORS_PATTERN should just be smarter about ignoring hyphens. In fact, the hyphen is considered a complex operator in cases like this:

super -duper
super - duper

but not this:

super-duper

So unfortunately I would need to better understand when the hyphen is part of a single token and when it's surrounded by token-breaking whitespace (or other token-breaking characters).

Just giving you the option to specify this pattern is actually not going to fix anything, because if you remove the hyphen from the regex, then we won't properly be able to detect cases where there truly are complex operators.

Need some time to think about this bug...

@nolanlawson
Copy link
Member

Looks like I fixed this in a duplicate issue: #32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants