I need to prioritize search results that start with the search term. I used "match_phrase_prefix". I used "match_phrase_prefix". But isn't working.
Details:
Query
GET /test/products/_search?pretty { "query": { "match_phrase_prefix": { "title": "iphone 5c" } } }Result
"_score": 10.440153 title": "Capa de Tpu para Iphone 5c Modelo Apple + Película""_score": 9.981493, "title": "Capa Bumper Iphone 5C + Pelicula", "_score": 8.610232 "title": "Pelicula Protetora para Iphone 5C Transparente" "_score": 5.154923, "title": "iPhone 5c Apple 8GB com Tela de 4”, iOS7, Câmera 8MP, Touch Screen, Wi-Fi, 3G/4G, GPS, MP3 e Bluetooth - Rosa" "_score": 5.154923 "title": "iPhone 5c Apple 8GB com Tela de 4”, iOS7, Câmera 8MP, Touch Screen, Wi-Fi, 3G/4G, GPS, MP3 e Bluetooth - Branco" "_score": 5.154923 "title": "iPhone 5c Apple 8GB com Tela de 4”, iOS7, Câmera 8MP, Touch Screen, Wi-Fi, 3G/4G, GPS, MP3 e Bluetooth - Preto"Mappings
"mappings": { "products": { "properties": { "title": { "type": "string", "analyzer": "brazilian" } } } }
In this example I need the first result is the device (Iphone 5c)