Questions tagged [elasticsearch-query]

Elasticsearch provides a full Query DSL based on JSON to define queries. In general, there are basic queries such as term or prefix. There are also compound queries like the bool query. Queries can also have filters associated with them such as the filtered or constant_score queries, with specific filter queries.

Elasticsearch provides a full Query DSL based on JSON to define queries. In general, there are basic queries such as term or prefix. There are also compound queries like the bool query. Queries can also have filters associated with them such as the filtered or constant_score queries, with specific filter queries.

Certain queries can contain other queries (like the bool query), others can contain filters (like the constant_score), and some can contain both a query and a filter (like the filtered). Each of those can contain any query of the list of queries or any filter from the list of filters, resulting in the ability to build quite complex (and interesting) queries.

634 questions
0
votes
1 answer

Max number of combined queries in Elasticsearch

I have a search query something like this: ((q1 AND q2) OR (q3 AND q4)). I can replicate it using must, should in Elasticsearch's search or scroll API query. But I want to know how many such queries can be combined in single query in Elasticsearch.…
Rohanil
  • 1,717
  • 5
  • 22
  • 47
0
votes
0 answers

Elastic Search sort by distance on a sub tag

I am just starting with ElasticSearch, and have managed to do basic queries, etc, but right now I have a data mapping like so: merchant: { properties: { id: { type: 'integer' }, name: { type: 'text' }, logo: { …
Amit
  • 3,952
  • 7
  • 46
  • 80
0
votes
1 answer

How to construct Elasticsearch query with Go?

I'm using olivere's Elasticsearch library for Go - https://github.com/olivere/elastic I'm not able to properly construct the search query, it keeps returning 0 hits. termQuery := elasticClient.NewTermQuery("hash",…
covfefe
  • 2,485
  • 8
  • 47
  • 77
0
votes
1 answer

Why does my Elasticsearch multi-match query look only for prefixes?

I am trying to write an Elasticsearch multi-match query (with the Java API) to create a "search-as-you-type" program. The query is applied to two fields, title and description, which are analyzed as ngrams. My problem is, it seems that Elasticsearch…
Daneel
  • 1,173
  • 4
  • 15
  • 36
0
votes
1 answer

Search Elasticsearch 2.4 if a field contains some particular string

Used elasticsearch version 2.4.1, lucene version 5.5.2. Issue I am facing is I am having documents like below: { "_index": "_myIndex", "_type": "_mytype", "_id":…
0
votes
1 answer

Elastic Search query return terms within array of a specific type

I've a mapping of an index as following: {"tagged_index":{"mappings":{"tagged":{"properties":{"tags":{"properties":{"resources":{"properties":{"tagName":{"type":"string"},"type":{"type":"string"}}}}},"content":{"type":"string"}}}}}} Where Resources…
0
votes
0 answers

ElasticSearch Multiple Phrases, Multiple Distances

We have an application where you can follow keywords such as 'Ford Mustang' and 'Fly Rod'. However when you follow a keyword you can assign a range distance to it. For instance you might be willing to travel 500 miles for a '1969 Ford Mustang' but…
Joseph Crawford
  • 1,470
  • 1
  • 15
  • 29
0
votes
1 answer

optimize elasticsearch query using filter, query or mix of both

I am trying to improve the performance of a elasticsearch query. The goal o the query is just retrieve those document that match the query, so score does not matter, also is important to mention we got an index per day, so the quer. As far as I know…
Joseratts
  • 97
  • 1
  • 9
0
votes
1 answer

Elasticsearch query - print certain field based on other field

My goal is to find max value in one field and print another field in this found document. My query so far: { "fields": ["text"], //NOT WORKING "query": { "query_string": { "query": "_type:bmw AND _exists_:car_type", …
bzadm
  • 133
  • 2
  • 9
0
votes
1 answer

How to know the ES index from the ES query?

I have the Elastic search query(got it from the XHR call - using ARC), but need to know to which index, the query is being hit.
0
votes
1 answer

create query on subfield (field contained in another field) using elasticsearch-dsl-py?

similar to question I want to create a query on a sub field (which is not of type nested) if data is in format "fs": { "used": 1000, "mount_point": "/" } as mentioned in answer by aaronfay I tried querying with search.query('match',…
0
votes
2 answers

Full Text Search as well as Terms Search on same filed of Elasticsearch

I'm from MySql background. So I don't know much about elasticsearch and it's working. Here is my requirements There will be table of resulted records with sorting option on all the column. There will be filter option from where user will select…
0
votes
0 answers

ElasticSearch distinct query ran in logstash showing duplicate rows

I'm trying to grab distinct latest data from Elasticsearch server using Logstash, eliminate some fields and zero values, and then insert it into Redis. For the elastic search data, i have a name field, some description fields, and 2 location values…
0
votes
1 answer

How to construct Elasticsearch to filter only URL with subdomain?

I store URL as a field in Elasticsearch. However, I would like to filter only documents that has subdomain in the url. For example. I want my search result to have http://any-subdomain.example.com But I don't want the result to have…
toy
  • 11,711
  • 24
  • 93
  • 176
0
votes
1 answer

Elastic search(2.4) - search and aggregate over arrays

I have a index with mapping as - GET /sampledesc/desc/_mapping { "sampledesc": { "mappings": { "desc": { "properties": { "labels": { "type": "string", "index": "not_analyzed" }, …