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

use correct tokenizer when building termsetquery #4983

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

trinity-1686a
Copy link
Contributor

Description

fix #4945

How was this PR tested?

added integration test (also fix an integration test not cleaning up behind)

&self,
schema: &TantivySchema,
tokenizer_manager: &TokenizerManager,
tokenizer: Option<String>,
) -> Result<TantivyQueryAst, InvalidQuery> {
let full_text_params = FullTextParams {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this works.

What happens if your tokenizer generates two tokens?
You will end up making it into a disjunction.

so roller-coaster will match roller-blade... I'm not sure what the right spec is but this one is too naive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could use get_normalizer() instead, which would just lowercase (if required), and never split tokens. That would make roller-coaster match nothing instead of things it shouldn't. Properly matching would require not creating a TermSetQuery, but a bool query of what works in a termset on one side, and what doesn't on the other, and i'm not sure that's worth the extra trouble

@fulmicoton
Copy link
Contributor

I think we want this to behave such as:

field IN [xxxx yyyy]

should behave exactly like

field:xxxx OR field:yyyy

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

Successfully merging this pull request may close these issues.

Dynamic fields term set query not working
2 participants