Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Add possibility to create custom action processors or add custom elements to root query #216

Open
quhar opened this issue Mar 5, 2014 · 6 comments

Comments

@quhar
Copy link

quhar commented Mar 5, 2014

Hi,

Is it possible to add custom action processors (for example for script fields)? ES is evolving quickly so this feature will allow use them.
As a first step it would be good to be able to add custom items at a root level of ES query dict. This would allow to use options like fields, track_score etc.

@willkg willkg added this to the 0.9 milestone Mar 11, 2014
@willkg
Copy link
Member

willkg commented Mar 11, 2014

I'll take a look at this and see if it's doable for 0.9 without a lot of effort.

@willkg
Copy link
Member

willkg commented Mar 25, 2014

Here's a use case for this:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-script-fields.html

That's the only thing I could find while skimming the Elasticsearch guide.

@quhar What's "track_score"? Do you have a url handy for that?

@willkg
Copy link
Member

willkg commented Mar 25, 2014

I think the thing to do here is rework .build_search() (that's the new name) so that it allows for custom actions and that probably requires redoing how the filter and query section are built. That's pretty extensive and requires some thought.

That's more than I can do for 0.9, though, so I'm pushing this off to 0.10.

@willkg willkg modified the milestones: 0.10, 0.9 Mar 25, 2014
@quhar
Copy link
Author

quhar commented Mar 25, 2014

track_score can be used when you sort results based on some value, but you still want to use scores

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_track_scores

Maybe it's possible just to list to steps with 'raw' action. Each element of the list would be dict with 'root_key' and value. At the end of .build_search() qs dict would be updated with values from this list.

@willkg
Copy link
Member

willkg commented Mar 25, 2014

If you want to do a PR, I'll happily look at it.

@willkg
Copy link
Member

willkg commented May 30, 2014

I'm going to bump this to post-0.10 where we'll have more wiggle room for new features and refactoring.

@willkg willkg removed this from the 0.10 milestone May 30, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants