【发布时间】:2016-10-26 07:39:16
【问题描述】:
我输入了我的数据,如果 type 是 A 然后我需要按 price1 排序 如果 type 是 B 那么我需要按 price2 排序,
那么在 c# NEST 中我们如何编写查询呢?
{
"test": {
"mappings": {
"listings": {
"properties": {
"productname": {
"type": "string"
},
"ptype": {
"type": "string"
},
"price1": {
"type": "float"
},
"price2": {
"type": "float"
}
}
}
}
}
}
【问题讨论】:
-
elasticsearch索引有两种类型?
-
我有一个“列表类型”字段,可以是A也可以是B。
-
您可以分享您的索引映射和示例文档吗?
标签: c# elasticsearch nest