Hi all,
I'm a bit surprised with the result of the query (see the code below)
I would expect the doc 4 to be first ... but this is the 1, 2, 5,6,3,4
If anyone can help.
Thanks a lot
DELETE shop
PUT shop
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"properties": {
"title": {
"type": "text"
},
"title_full": {
"type": "text"
},
"colour": {
"type": "keyword"
},
"brand": {
"type": "text"
},
"size": {
"type": "text"
},
"price": {
"type": "double"
},
"family_id": {
"type": "keyword"
}
}
}
}
POST shop/_doc/1
{
"title": "iPad Air 2",
"title_full": "iPad Air 2 Silver Apple 32gb",
"colour": "Silver",
"brand": "Apple",
"size": "32gb",
"price": 399,
"family_id": "apple-1234"
}
POST shop/_doc/2
{
"title": "iPad Air 2",
"title_full": "iPad Air 2 Gold Apple 32gb",
"colour": "Gold",
"brand": "Apple",
"size": "32gb",
"price": 399,
"family_id": "apple-1234"
}
POST shop/_doc/3
{
"title": "iPad Air 2",
"title_full": "iPad Air 2 Space grey Apple 32gb",
"colour": "Space Grey",
"brand": "Apple",
"size": "32gb",
"price": 399,
"family_id": "apple-1234"
}
POST shop/_doc/4
{
"title": "iPad Air 2",
"title_full": "iPad Air 2 Space Grey Apple cccdd",
"colour": "Space Grey",
"brand": "Apple",
"size": "128gb",
"price": 499,
"family_id": "apple-1234"
}
POST shop/_doc/5
{
"title": "iPad Pro",
"title_full": "iPad Pro Space Grey Apple 128gb",
"colour": "Space Grey",
"brand": "Apple",
"size": "128gb",
"price": 899,
"family_id": "apple-5678"
}
POST shop/_doc/6
{
"title": "iPad Pro",
"title_full": "iPad Pro Space Grey Apple 256gb",
"colour": "Space Grey",
"brand": "Apple",
"size": "256gb",
"price": 999,
"family_id": "apple-5678"
}
GET shop/_search
{
"query": {
"match": {
"title_full": "ipad ccc"
}
}
}```