-
Notifications
You must be signed in to change notification settings - Fork 63
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
Adding float64 support, document level boosting, and facet collector #52
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm excited for f64 support to get in. I'm not a maintainer of tantivy-py, but I left several comments hoping that it helps to move forward on the PR.
Perhaps f64 support would get merged faster if you made a separate PR for just the f64 support?
@@ -48,7 +48,7 @@ impl Facet { | |||
#[classmethod] | |||
fn from_string(_cls: &PyType, facet_string: &str) -> Facet { | |||
Facet { | |||
inner: schema::Facet::from(facet_string), | |||
inner: schema::Facet::from_text(facet_string).unwrap(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to comment about the unwrap
but I see that the LHS schema::Facet::from
is just implemented using from_text
with an unwrap anyway: https://docs.rs/tantivy/0.18.0/src/tantivy/schema/facet.rs.html#181-183
I'm curious what was the reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't exactly remember this change. Maybe I couldn't get facets to work without it
@poljar let me know if there's anything I can do to expedite the merge |
@@ -0,0 +1,26 @@ | |||
Collecting pytest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file seems like it was added in error...?
This PR adds a couple of new features that are present in Tantivy core repo, but not exposed in tantivy-py:
Conjunction by default parameter
By default, tantivy parses queries using OR operator, instead of AND operator. If we want to modify this behavior, we can now set this value when parsing query:
Floating point support
A new
add_float_field
function is available so that we can add f64 fields.Document level boosting #51
We can now give priority to certain documents using the new
weight_by_field
parameter:TopDocs
tweak_score
is used, and the callback is abstracted away from python code for performance reasons.Facet collector
We can now get counts of facets available by specifying the
count_facets_by_field
parameter: