Arman
Arman

Reputation: 1084

ElasticSearch: how to mix terms query with wildcard

Say, I have the following query: 'document spreadsheet app*'. I want to construct the query dictionary which is equivalent to this type of query '_search?q=_all:document+spreadsheet+app*'. Say, query_words_list = ['document', 'spreadsheet', 'app']. I tried this:

{
  'query': {
     'terms': {
        '_all': query_words_list[:-1] + [query_words_list[-1] + '*'],
     }
   }
}

However, if you compare results of two queries, they are not equivalent. Any hints what query dictionary equivalent to '_search?q=_all:document+spreadsheet+app*' can look like? Thanks in advance!

Upvotes: 0

Views: 2747

Answers (1)

imotov
imotov

Reputation: 30163

The q parameter is equivalent to Query String Query.

Upvotes: 1

Related Questions