简体   繁体   English

.net工具包未返回CloudSearch表达式

[英]CloudSearch expressions are not being returned using .net toolkit

When using the AWS .NET SDK to execute a cloudsearch searchrequest, expressions are not being returned in the field collection when specified in the SearchRequest.Return property. 使用AWS .NET SDK执行cloudsearch searchrequest时,在SearchRequest.Return属性中指定时,不会在字段集合中返回表达式。 When passing the following SearchRequest object to a AmazonCloudSearchDomainClient instance we get all fields save for the distance expression. 将以下SearchRequest对象传递到AmazonCloudSearchDomainClient实例时,我们将保存所有保存为距离表达式的字段。 How do we get access to the expression per hit using the SDK? 我们如何使用SDK每次访问访问表达式?

    new SearchRequest
    {
        QueryParser = QueryParser.Structured,
            FilterQuery = "location:['BOUNDING BOX COORDINATES','HERE']",
            Sort = "distance asc",
            Expr = @"{{""distance"":""haversin(SOME LATITUDE,SOME_LONGITUDE,location.latitude,location.longitude) * .621371""}}",
            Return = "_all_fields,distance",
            Query = "(term field=awesome 1)",
            Start = 0,
            Size = 50
    };

"How do we get access to the expression per hit using the SDK?" “我们如何使用SDK每次访问访问表达式?”

The short answer is, you don't. 简短的答案是,您不会。 There is a shortcoming with the .net sdk as it doesn't return expression values. .net sdk有一个缺点,因为它不返回表达式值。 https://forums.aws.amazon.com/thread.jspa?messageID=575746 Hopefully it will be resolved soon, until then we'll have to make the request via http and parse the results ourselves... oh the horror. https://forums.aws.amazon.com/thread.jspa?messageID=575746希望它将尽快解决,直到那时我们将不得不通过http发出请求并自己解析结果...恐怖。 We'll prob just adapt the json into a decorated Hit object with the additional Expr collection so when its fixed it won't be too big of a headache to switch back. 我们将通过附加的Expr集合将json修改为装饰的Hit对象,因此在修复后,切换回它不会太麻烦。

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

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