Answer the question
In order to leave comments, you need to log in
What is the search query in elasticsearch at different levels?
For view index
{
"posts": {
"mappings": {
"activity": {
"properties": {
"categories": {
"properties": {
"description": {
"type": "string",
"analyzer": "russian"
},
"name": {
"type": "string",
"analyzer": "russian"
}
}
},
"tags": {
"type": "nested",
"properties": {
"name": {
"type": "string",
"analyzer": "russian"
}
}
},
"description": {
"type": "string",
"analyzer": "russian"
},
"title": {
"type": "string",
"analyzer": "russian"
}
}
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Yes you can - https://www.elastic.co/guide/en/elasticsearch/refe...
Just put "_all". But if the index is gigantic, then there may be performance issues.
If you need exactly for all available fields, they already answered above about _all.
If the fields are still enumerable, a multi match query is better .
curl -XGET 'http://elasticsearch:9200/_search' -d '{
"query": {
"multi_match": {
"query": "My search query",
"fields": [
"title",
"description",
"tags.name",
"categories.name",
"categories.description"
]
}
}
}'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question