Questions tagged [elasticsearch-nested]

56 questions
6
votes
2 answers

Matching arrays in elastic search

I have document as below: { "_index": "abc_local", "_type": "users", "_id": "1", "_version": 5, "found": true, "_source": { "firstname": "simer", "lastname": "kaur", "gender": "1", "Address":…
Always_a_learner
  • 4,585
  • 13
  • 63
  • 112
4
votes
1 answer

NestedSortBuilder usage example for elasticsearch 6.3.2

I have to sort on a field that is one level nested using the elastic java high level rest client api. I could find this answer Elasticsearch nested sorting The problem is that the answer uses SortBuilder for sorting nested fields using the following…
humbleCoder
  • 667
  • 14
  • 27
2
votes
3 answers

Elasticsearch query on arrays of nested objects

I'm struggling with a query problem on ElasticSearch. I have this kind of objects recorded : { "obj_id": 1, "label": "label obj 1", "array_of_nested": [{ "nested_id": 1, "label": "label nested obj1" }, { …
2
votes
2 answers

elastic search match query over array object

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" …
2
votes
1 answer

Combining nested query with boolean query in Elastic Search

I am trying to filter hotel rooms by price range in Elastic Search. The rooms have a default nightly price and also custom prices can be set for specific days. I'm storing the nightlyPrice and a nested object for custom prices together with the…
madpoet
  • 1,023
  • 11
  • 28
2
votes
1 answer

How to compare parent field value with aggregated values from nested objects in Elasticsearch?

I have such documents in my index: { "Pieces": 5, "parts": [ { "Quantity": 1, "PartID": 1, }, { "Quantity": 1, "PartID": 2 }, { "Quantity": 1, "PartID": 3 …
2
votes
1 answer

How to query elasticsearch nested object using fuzziness and wildcard query

{ "took":1, "timed_out":false, "_shards":{ "total":5, "successful":5, "skipped":0, "failed":0 }, "hits":{ "total":1, "max_score":1, "hits":[ { …
Alvin Chettiar
  • 609
  • 5
  • 14
2
votes
0 answers

How to store a list of netsted array in elastcisearch

I have json file which is dynamic. So i have to store it using nested type. data: [ map[name: kish age: 26 ] map[name: kal age: 26 company: home] map[msg: hi date: 123456] ] How to store this data? And also can you explain about data mapping…
kish
  • 545
  • 2
  • 5
  • 11
2
votes
1 answer

ElasticSearch Nested Query - exclude parent document

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.…
2
votes
0 answers

Create Elasticsearch query for product catalog with .Net NEST client

Using the Elasticsearch NEST library for .NET I am trying to create a query that will search for products. The model's structure is the following: [ElasticsearchType(Name = "product", IdProperty = "ProductId")] public class ProductIndex { …
2
votes
1 answer

elastic search 5 - how to query Object datatype and nested array of json

I want to query against nested data already loaded into Elasticsearch 5 but every query returns nothing. The data is of object datatype and nested array of json. This the nested datatype ie team_members array of json: [{ "id": 6, "name":…
2
votes
2 answers

Elasticsearch mapping parser exception?

I'm trying to create a nested document in Elasticsearch. Structure: title,name,comments comments is a nested document - inside that - Comment & Star_Rating. Inside Comment, name and address. Here is the query mentioned below. PUT /sounduu …
1
vote
0 answers

Elasticsearch Aggregations with two nested fields

I have a Elasticsearch index for testing with following mapping having two nested fields: test/ { "mappings": { "dynamic": "strict", "properties": { "observation_session_id": { "type": "long" }, …
1
vote
0 answers

Elastic Search matrix_stats on both nested and non nested value

we have a doc structure [{ score: 10, list: [ // nested type { id : 3, value: 10 }, { id: 4 value: 20 }, { id: 5, value: 15 } ] }, { score: 1, list: [ { id : 3, …
1
vote
2 answers

Elasticsearch DSL queries - optional should terms & scores

I'm pretty new on Elasticsearch world and I might be missing some concept. That's the scenario I'm not understanding: I want to find a doc from the following criteria: category.level = A category.name = "John .G" OR "Chris T." approved = yes…
1
2 3 4