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

Add support and upgrade to lucille 0.0.3 #256

Merged
merged 2 commits into from
Nov 29, 2024
Merged

Add support and upgrade to lucille 0.0.3 #256

merged 2 commits into from
Nov 29, 2024

Conversation

valencik
Copy link
Contributor

@valencik valencik commented Nov 29, 2024

Of note, this PR introduces a regression.
We no longer use per-field analyzers in QueryAnalyzer.
I've created a followup issue for fixing this: #257

@valencik valencik requested a review from samspills November 29, 2024 18:23
@valencik
Copy link
Contributor Author

Sam and I talked a bit about this per-field analyzer regression business.

In short, it's not possible with the current/new traverseQ function.
Because you can't actually do anything with a Field query in the traverseQ function, you can only touch the TermQuery "leaf" nodes. And what you actually need to do is use the Field query's field name to find the right analyzer, and then start using that analyzer.

If we want to do something "per-field" then i guess we need a more powerful function than traverseQ

it's kind of a can of worms.
If you give me a Query => Query function to apply to some Query
What do I do when I hit a Query.And? do I apply it to the subqueries, or do I apply it to the Query.And itself? or like, both maybe?

I think maybe we need something like:

query.traverseByField {
  case "author" => lowercase
  case "body" => lowercaseAndSplitWhitespace
}

And of course a mapByField would be nice too.

Oh well, more fun for the future.

@valencik valencik merged commit 5decc68 into main Nov 29, 2024
21 checks passed
@valencik valencik deleted the lucille-0.0.3 branch November 29, 2024 19:46
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.

2 participants