Answer the question
In order to leave comments, you need to log in
ElasticSearch: how to search nested structures correctly?
The elastic index stores nested data structures for which you want to perform a correct search.
Index example:
{
"title": {"type": "text"},
"subEntity": {
"type": "object",
"properties": {
"id": {"type": "integer"},
"value": {"type": "text"}
}
}
}
{
"title": "Stub",
"subEntity": [
{"id": 1, "value": "red"},
{"id": 2, "value": "yellow"},
{"id": 3, "value": "green"}
]
}
{
"query": {
"bool": {
"must": [
{"match": {"subEntity.id": 1}},
{"match": {"subEntity.value": "yellow"}}
]
}
}
}
Answer the question
In order to leave comments, you need to log in
you need to look in Google for the query "elastic search handle relations"
for example https://www.elastic.co/guide/en/elasticsearch/guid...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question