Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

133
Views
Can elastic search provide nested json results?

I know that elastic search provides good support for nested json. It has very good support for nested objects with advance indexing.

So, when I make a nested query in elastic search, can the query result be obtained in original nested form ? Or is the query result in flattened form like that in lucene or solr ?

Note: I have used apache solr and lucene before. And, I am evaluating other different search platforms for better support for nested json objects.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I'm giving you a simple example of results maintaining the depth.

PUT people { "mappings": { "list": { "properties": { "name": { "type": "nested" } } } } }

PUT people/list/1 { "age" : "19", "name" : [ { "first" : "John", "last" : "Smith" } ] }

PUT people/list/2 { "age" : "23", "name" : [ { "first" : "Wilber", "last" : "Smith" } ] }

GET people/list/_search { "query": { "match_all": {} } }

As far as I understand, you'll prefer nested mapping to object mapping. Because object would flatten results. See this for reference: https://www.elastic.co/guide/en/elasticsearch/reference/2.4/nested.html

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!