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
0 answers

Elasticsearch match multiple fields with AND and OR operators not working

I am trying to search specific field and value using elasticsearch boolean query. I am hitting this endpoint "http://localhost:9200/index/_search" using python requests. get sports/_search {"query": { "bool": { …
Madhu
  • 1
0
votes
1 answer

Elasticsearch error in getting a dynamic key's value

Partial mapping of one of my index is as follows: "schools": { "type": "object", "dynamic": true, "properties": {} } A sample schools object of an existing document is: "schools": { "8291": { "max": 11, "min": 11 }, "3546": { …
0
votes
1 answer

Elasticsearch query for promoting specific data

I have an example shopping app, i want to create searching page using elasticsearch, when user search for specific product for example "Iphone" then display all iphone products. But, i want to promote product to show on top of search result. It's…
andrey_derma
  • 43
  • 1
  • 6
0
votes
1 answer

Elastic search not considering as string field by default and not giving proper matching results

I am querying ElasticSearch by using the following query and it is giving me results as per the query along with some other irrelevant data. GET items/_search { "query" :{ "match": {"code": "*7000-8002-W*"} } } But if I query like this, I…
Karthikeyan
  • 1,927
  • 6
  • 44
  • 109
0
votes
1 answer

Multiple filter by array of object in Elastic 6.*

Need help with building query through the array in ElasticSearch 6. I have documents that represent some property units with a number of attributes: { "Unit":{ "Attributes":{ "Attribute":[ { …
0
votes
1 answer

ElasticSearch function_score throwing parsing_exception

I have having annoying trouble trying to get function_score to work for a price field. Originally I tried to used a scaled_float field. However it did not like that. So I changed my price field to a long with padding for decimal position. So I have…
0
votes
0 answers

Elasticsearch find the value of a dynamic key inside an object

My partial mapping is as follows (I am still using ES2.4): "name": { "type": "string" }, "misc": { "type": "object", "dynamic": "true", "properties": {} } Lets assume there is only one document in my storage, as follows { "name":…
JVK
  • 3,782
  • 8
  • 43
  • 67
0
votes
1 answer

ES Java dynamically add keyed filters to AggregationBuilder

I want to have a method that loops through an ArrayList and based on it's content dynamically generate x amount of Keyed Filters List filters = new ArrayList(); for (String a: b) { …
Justin
  • 4,461
  • 22
  • 87
  • 152
0
votes
0 answers

Elasticsearch groovy script not working as expected

My partial mapping of an index listing elasticsearch 2.5 (I know I have to upgrade to newer version and start using painless, let's keep that aside for this question) "name": { "type": "string" …
JVK
  • 3,782
  • 8
  • 43
  • 67
0
votes
1 answer

Elasticsearch query doesn't give me the expected result

I am using pretty old elasticsearch 2.5. I have the availability information of hotels in each doc. There is a field called "availabilities" whose mapping is as follows: "availabilities":{ "type": "nested", …
JVK
  • 3,782
  • 8
  • 43
  • 67
0
votes
2 answers

How to search starting and ending of a sentence in elasticsearch

I was trying to search the following two cases case 1: I want to search a name that starts with particular word. For example: name : test name name : name test name : test name test if I search for "test" then it should return me only "test name"…
Raviteja Gannoju
  • 117
  • 3
  • 16
0
votes
1 answer

Get Index names by multiple alias names

How to retrieve index name in elastic search based on some given aliases names. Example: Index_name: test Aliases names: a1,a2,a3 Index_name: test2 Aliases name: a1,a3 Index_name: test3 Aliases name: a1 retrieve the index name which has a1,a2,a3 in…
0
votes
1 answer

Retrieve unique documents from elasticsearch index

How to get all the unique documents from a index.Do i need to write the aggregation queries for all the fields of document. Can i get unique documents without writting the aggregation for each n every field.
0
votes
3 answers

Elasticsearch matching string with like operator

I would query elasticsearch for retrieve all the document that has field value like a given string. For example field LIKE "abc" has to return "abc" "abcdef" "abcd" "abc1" So all the field that has "abc" string inside. I try this query but return…
michele
  • 26,348
  • 30
  • 111
  • 168
0
votes
1 answer

ElasticSearch query for searching content exactly matching other values

In ElasticSearch I've documents following the structure of an example document given below: { "ProductType": "TV", "Manufacturer": "XYZ", "Model": "XYZ-52-TV", "ProductDocumentationTopic": "DeviceSpecifications", …
Temp O'rary
  • 5,366
  • 13
  • 49
  • 109