【发布时间】:2017-10-24 11:58:18
【问题描述】:
我已经使用以下映射创建了 ElasticSearch 索引。 我需要编写复杂的搜索查询,例如在查询结果中查找相关项目。 例如,查找价格为“100”的项目。从搜索结果中获取 ItemBrand,然后找到具有相同 ItemBrand 的其他项目。(类似产品)。 谁能帮我吗?
PUT myindex-solvisoft2
{
"mappings": {
"ItemCategory":{
"properties": {Category":{"type": "text"},"IsActive":{"type": "boolean"},"Comment":{"type": "text" }}
},
"ItemBrand": {
"properties": {"Creator": {"type": "keyword"},"DateEffective": {"type": "date"},"DateTerminated": {"type": "date"},"Description": {"type": "text"},
"IsActive": {"type": "boolean"},"ItemBrand": {"type": "keyword"}}
},
"Item": {
"properties": {
"Comment": {"type": "text"},"Creator": {"type": "keyword"},"DateEffective": {"type": "date"},
"DateTerminated": {"type": "date"},"IsActive": {"type": "boolean"},"ItemBrand": {"type": "keyword" },
"ItemDescription": { "type": "text" },"ItemCategory": {"type": "keyword"},"ItemId": {"type": "integer" },
"Price": {"type": "double" } }
}
}
}
【问题讨论】:
标签: elasticsearch