elasticsearch-nested

elastic search match query over array object

爷,独闯天下 提交于 2021-02-05 11:29:28
问题 Suppose i've 3 doc doc_1 = { "citedIn": [ "Bar Councils Act, 1926 - Section 15", "Contract Act, 1872 - Section 23" ] } doc_2 = { "citedIn":[ "15 C. B 400", "Contract Act, 1872 - Section 55" ] } doc_3 = { "citedIn":[ "15 C. B 400", "Contract Act, 1872 - Section 15" ] } Here citedIn field is a array object.Now i want run a stander match query { "query": { "match": {"citedIn":{"query": "Contract act 15" , "operator":"and" }} } } The above query return all of the 3 doc, but it suppose to return

Return only elements of an array in an object that contain a certain value

↘锁芯ラ 提交于 2021-01-28 19:23:33
问题 I've got the following document in an elastic search index: { "type": "foo", "components": [{ "id": "1234123", , "data_collections": [{ "date_time": "2020-03-02T08:14:48+00:00", "group": "1", "group_description": "group1", "measures": [{ "measure_name": "MEASURE_1", "actual": "23.34" }, { "measure_name": "MEASURE_2", "actual": "5" }, { "measure_name": "MEASURE_3", "actual": "string_message" }, { "measure_name": "MEASURE_4", "actual": "another_string" } ] }, { "date_time": "2020-03-03T08:14:48

ElasticSearch Nested Query - exclude parent document

∥☆過路亽.° 提交于 2019-12-11 02:27:52
问题 Trying to exclude top-level documents where one of the child documents doesn't match the query. For the example below, I'm trying to exclude all documents where one of its nested jobs has current: true , and matches with the company name: Elastic . But since one of the nested job documents matches with current: false and company name: Elastic , this document is returned. I am using a nested query with a must match on company name and a filter where current: false. How can I make it so that