小编Osc*_*dré的帖子

具有嵌套地理位置的Elasticsearch function_score

我正在尝试使用地理位置实现function_score,类似于弹性搜索地理距离排序中描述的内容.但是,我的文档geo-location字段位于一个具有嵌套映射的数组中.

{
  "mappings": {
    "bo_contentmodel": {
      "properties": {
        "contentId": {
          "type": "double"
        },
        "contentName": {
          "type": "string",
          "index": "no"
        },
        "geoInfo": {
          "type": "nested",
          "properties": {
            "geoPhone": {
              "type": "string",
              "index": "no"
            },
            "geoTitle": {
              "type": "string",
              "index": "no"
            },
            "point": {
              "type": "geo_point"
            }
          }
        }
      }
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

执行以下查询时:

{
  "from": 0,
  "size": 6,
  "query": {
    "function_score": {
      "query": {
        "match_all": {}
      },
      "functions": [{
        "filter": {
          "nested": {
            "query": {
              "geo_distance": { …
Run Code Online (Sandbox Code Playgroud)

sorting nested geolocation elasticsearch

5
推荐指数
0
解决办法
346
查看次数

ElasticSearch 5.x Context Suggester NEST .Net

我正在尝试使用ElasticSearch 5.1.2上的Nest 5.0创建一个带有上下文建议的索引.

目前,我可以创建映射:

elasticClient.MapAsync<EO_CategoryAutocomplete>(m => m
                .Properties(p => p
                    .Completion(c => c
                        .Contexts(ctx => ctx
                            .Category(csug => csug
                                .Name("lang")
                                .Path("l")
                            )
                            .Category(csug => csug
                                .Name("type")
                                .Path("t")
                            )
                            .Category(csug => csug
                                .Name("home")
                                .Path("h")
                            )
                        )
                        .Name(n => n.Suggest)
                    )
                )
            );
Run Code Online (Sandbox Code Playgroud)

但在POCO类我不知道什么对象类型必须是标题?????的建议属性 :

public class EO_CategoryAutocomplete
{
    public string Id { get; set; }
    public ????? Suggest { get; set; }
}

public class EO_CategoryAC
{
    public int Id { get; set; }
    public string …
Run Code Online (Sandbox Code Playgroud)

.net c# elasticsearch nest

2
推荐指数
1
解决办法
2130
查看次数

标签 统计

elasticsearch ×2

.net ×1

c# ×1

geolocation ×1

nest ×1

nested ×1

sorting ×1