Answer the question
In order to leave comments, you need to log in
How to compose a relevant search in Elastic Search?
Hello everyone, I'm trying to build a relevant search on the site. and partially implemented.
This request has already been
{
"query": {
"bool": {
"filter": {
"bool": {
"must": [{
"terms": {
"visibility": [3, 4]
}
}, {
"terms": {
"status": [0, 1]
}
}, {
"terms": {
"sku": ["5111-0243", "9901-0131", "5111-0202", "5111-0301", "5115-0071"]
}
}]
}
},
"must": {
"query_string": {
"fields": ["name"],
"query": "*Ка*"
}
}
}
}
}
{
"query": {
"simple_query_string": {
"query": "Кар*",
"fields": [
"name^2",
"shot_name"
],
"default_operator": "and",
"analyze_wildcard": true
}
}
}
{
"query": {
"bool": {
"filter": {
"bool": {
"must": [
{
"terms": {
"visibility": [
3,
4
]
}
},
{
"terms": {
"status": [
0,
1
]
}
},
{
"terms": {
"sku": [
"5111-0243",
"9901-0131"
]
}
}
]
}
},
"simple_query_string": {
"query": "Кар*",
"fields": [
"name^2",
"shot_name"
],
"default_operator": "and",
"analyze_wildcard": true
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question