Open pziemkowski opened 10 years ago
With the code you've written, you can't accept a Q
argument. You need to process the Q
turning it into Elasticsearch JSON stuff.
You probably want something like this:
def process_query_has_child(self, key, val, action):
return {'has_child', {'type': key, 'query': self._process_queries([val])}}
Or we could do it using Q
and F
parametrized with child type, to keep the API clean, something like:
S().query(has_child=Q(child_field=search_text), child_type=some_type)
which would give more flexibility
I don't think you can do that without rewriting how S._process_queries
works.
Now that I'm re-reading what you've written, I don't think I understand what you're asking for in this issue. Are you asking for support on code you've written that isn't working? Or are you asking to have support for something new in ElasticUtils and tossing around how it could be implemented?
@jmizgajski ^^^ ?
I think your solution is sound, you can close it or add support to the new release the way you described it.
I'm going to bump this to post-0.10 where we'll have a lot more wiggle room for new features and refactoring.
any news here?
Parent child can be easily implemented by appropriate mapping definition and raw queries.
2014-07-31 14:50 GMT+02:00 Grzegorz Ślusarek notifications@github.com:
any news here?
— Reply to this email directly or view it on GitHub https://github.com/mozilla/elasticutils/issues/226#issuecomment-50754072 .
I would like to use has_child query, which requires me to pass another query as a value.
Here is the process_query method.
From what I understand, right now it is impossible to pass another query as a value, e.g.