mozilla / elasticutils

[deprecated] A friendly chainable ElasticSearch interface for python
http://elasticutils.rtfd.org
BSD 3-Clause "New" or "Revised" License
243 stars 76 forks source link

multi_match support #204

Open noirbizarre opened 10 years ago

noirbizarre commented 10 years ago

Hi !

Are you planning to support multi_match queries ?

Something like that would be great:

def multi(query, fields=[], type='best_fields', **options)

So I can simply write:

S().multi('my query', ['field1', 'field2^3'])
S().multi('other query', ['field1', 'field2^3'], 'most_fields')
S().multi('another one', ['field1', 'field2^3'], operator='and')
willkg commented 10 years ago

I had no plans to implement this, but I'll happily accept a PR. It looks pretty handy.

For whoever wants to implement this, the Elasticsearch 0.90 docs for this are here:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/query-dsl-multi-match-query.html

willkg commented 10 years ago

I'm bumping this out of the 0.10 time frame. If someone wants to take a stab at implementing it, I'll happily accept a pull request.