-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Description
-> POST http://localhost:9200/products/_search
{
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "name:(\"smartphone\"^4 +\"samsung\"^3)"
}
}
],
"should": [
{
"term": {
"first_name": {
"value": "smartphone",
"boost": 3
}
}
}
],
"must_not": []
}
}
}
<- 200
{
"took": 3,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 4.5522094,
"hits": [
{
"_index": "products",
"_type": "ad",
"_id": "2",
"_score": 4.5522094,
"_source": {
"name": "capa para smartphone samsung xxx",
"first_name": "capa"
}
},
{
"_index": "products",
"_type": "ad",
"_id": "0",
"_score": 2.635168,
"_source": {
"name": "smartphone samsung galaxy",
"first_name": "smartphone"
}
}
]
}
}
Why the smartphone not win this score ? no make sense for me
the mapping bellow
{
"mappings": {
"ad": {
"properties": {
"name": {
"type": "text"
},
"first_name": {
"type": "keyword"
}
}
}
}
}
Metadata
Metadata
Assignees
Labels
No labels