-
Notifications
You must be signed in to change notification settings - Fork 76
support function scoring #233
Comments
(I was talking with Rob about this earlier.) Another idea was to create a FSQ class that took these arguments and would get passed into
Part of me thinks it's nice to have all queries go in |
There are two requirements here:
The first one is important right now. The second one I vote we push off to a new version of ElasticUtils after we've ditched support for Elasticsearch 0.90 and prior. Given that, I'm re-focusing this bug to just cover the first item. |
I screwed up and misread things. The existing Given that, I'm re-scoping this to "support function_score for Elasticsearch 1.0+" and pushing it out of the 0.10 milestone because we don't need it for bridging people from Elasticsearch 0.90 to 1.0. |
+1 Is there a way to do function_score using some kind of e.g. is it possible to construct query in elasticutils, and modify it and pass to pyelasticsearch ? |
That's doable. I did something like this a couple of weeks ago, you can use the
|
Two things:
|
patrick91 That's good news! Can you give me a little more direction? Did you subclass S class to override build_search (to support function scoring) ? |
@pcompassion no, I did something like this:
|
@patrick91: thanks for the prompt response! |
Boosting via the special
_boost
field has been removed in >= 1.0 and the suggested alternative is to use function scoring.http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/_deprecations.html
I propose we support a function scoring in the following way. Feedback welcome.
Add a method to the
S
calledfunction_score
. This method will take a query in the form of aQ
-type object, along with other arguments to define the function scoring, such asboost
,score_mode
,boost_mode
and function(s).For example:
Any calls to
.query(...)
on this would set the query outside of the function score. Thefunction
arg could also take a list for the case of passing a list of functions.Feel free to bikeshed on the naming of these. I can work on the implementation and adjust naming after the fact to make a nicer API. There's so many variables to function scoring it seems hard to nail down a nice API.
The text was updated successfully, but these errors were encountered: