我想添加這3個屬性(如+評論+分享),也想排序3個屬性的總和。如何在Elasticsearch中對「3個屬性的總和」進行排序?
curl -XPUT 'http://XXX.X.XX.XXX:XXXXX/stores/' -d '{
"settings" : {
"index" : {
"number_of_shards" : 3,
"number_of_replicas" : 1
}
},
"mappings" : {
"store" : {
"_all":{ "enabled": true },
"properties":{
"url" : { "type" : "string", "analyzer" : "simple", "boost" : 3 },
"title" : { "type" : "string", "boost" : 2 },
"description" : { "type" : "string" },
"like":{"type":"long"},
"comment":{"type":"long"},
"share":{"type":"long"},
"time_added" : { "type" : "integer", "index" : "not_analyzed", "include_in_all": true }
}
}
} }'
在elasticsearch中做什麼查詢。 我elasticsearch版本是2.4.0
感謝sunkuet02的快速回復,你能幫我找到「config/elasticsearch.yml」路徑...其中的yml文件。 – Ganesh
你是如何安裝elasticsearch的? – sunkuet02
如果您使用的是Ubuntu,並且如果您從'.zip'文件運行它,那麼它在'config/elasticsearch.yml'中,您可以在'/ etc/elasticsearch/elasticsearch.yml'中找到它。如果您使用Windows,則轉到安裝文件夾。 – sunkuet02