Elasticsearch order by type -


i'm searching index multiple types using 'http://es:9200/products/_search?q=sony'. return lot of hits many different types. hits array contains results not in order want to; want 'television' type show before rest. possible @ order type?

you can achieve sorting on pre-defined field _type. query below sorts results in ascending order of document types.

post <indexname>/_search {    "sort": [       {          "_type": {             "order": "asc"          }       }    ],    "query": {       <query goes here>    } } 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -