简体   繁体   English

使用Nest Library进行弹性搜索自定义排序

[英]Elastic search Custom Sort with Nest Library

I have a data structure like: 我有一个像这样的数据结构:

在此处输入图片说明

And I want to do so sorting to the results based on the price but for a specific priceProfileId ex 1292 我想根据价格对结果进行排序,但要针对特定​​的priceProfileId,例如1292

I am using the nest library for that and my query looks like as below: 我为此使用了嵌套库,我的查询如下所示: 在此处输入图片说明

But its not sorting? 但是它不排序吗?

Addition Information: About ItemPrice Mapping 附加信息:关于ItemPrice映射

在此处输入图片说明

One thing is instead of the Price.Value I changed to Price and used .Order(SortOrder.Descending 一件事是代替Price.Value我更改为Price并使用.Order(SortOrder.Descending

Correct Code: 正确的代码:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM