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

Selective expand_keywords (exact form, not infix/prefix expansion) #48

Closed
barryhunter opened this issue Jan 9, 2018 · 4 comments
Closed

Comments

@barryhunter
Copy link
Contributor

The new morphology_skip_fields works great. But to avoid having to modify queries manually, its useful to use expand_keywords to automatically add the exact form operator (=word).

... have just run into a problem on one my production indexes, also have min_prefix_len enabled to (with effective enable_star=1), so can do prefix matches if want, however turning on expand_keywords is transparently enabling part word matches, because word expands to (word | word* | =word)

So this is a request to be able to use enable_keywords, but ONLY get exact form expansion, not wildcard expansion.

ie so word just expands to (word | =word) - even tho min_infix_len/min_prefix_len is used

Not sure on syntax, but expand_keywords = 2 would be the easy way. But expand_keywords = exact would be more semantic. Then could also do expand_keywords = star or even star,exact.
With 1 remaining as an alias for star,exact

@tomatolog
Copy link
Contributor

expand_keywords with enumeration star,exact seems good.
Do you need that option for either index config and SphinxQL option?

@barryhunter
Copy link
Contributor Author

barryhunter commented Jan 9, 2018

Well personally I only would use in it in index (ie the index has morphology_skip_fields so would add expand_keywords=exact in config)

... if want to 'disable' expand_keywords for a particular query, would then juse use ... OPTION expand_keywords=0.

Dont think would need ... OPTION expand_keywords='star,exact' - if want wildcard matches would be manually adding * in the query, rather than using expand_keywords. But ... OPTION expand_keywords=1 would work to enable for both anyway?

Also dont think need case where expand_keywords=1/0 in config and would want OPTION expand_keywords='exact' (or even just star)

@airolg
Copy link
Contributor

airolg commented Jan 11, 2018

Added to backlog, thank you

@tomatolog
Copy link
Contributor

I've just pushed this feature to master branch at 9f16759

Added enumerations star,exact to expand_keywords index option along with 0\1 disable\enable
SphinxQL query option expand_keywords still enables or disables all expansions.

Documentation is on the way

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

3 participants