基于Elasticsearch中的内部命中的脚本排序

时间:2019-02-10 13:49:31

标签: elasticsearch

是否可以对Elastic的内部点击进行脚本排序?我不确定是否可以,如果可以,如何访问脚本中的innerhit字段?

这是我想访问的嵌套部分,在AvailabilityPeriodV2中有一个集合“ Amounts”,在这里我想对该脚本进行一些价格检索/计算:

{  
           "nested":{  
              "query":{  
                 "bool":{  
                    "must":[  
                       {  
                          "match":{  
                             "AvailabilityPeriodV2.ArrivalDate":{  
                                "query":"2019-05-13",
                                "operator":"OR",
                                "prefix_length":0,
                                "max_expansions":50,
                                "fuzzy_transpositions":true,
                                "lenient":false,
                                "zero_terms_query":"NONE",
                                "auto_generate_synonyms_phrase_query":true,
                                "boost":1.0
                             }
                          }
                       },
                       {  
                          "match":{  
                             "AvailabilityPeriodV2.DepartureDate":{  
                                "query":"2019-05-27",
                                "operator":"OR",
                                "prefix_length":0,
                                "max_expansions":50,
                                "fuzzy_transpositions":true,
                                "lenient":false,
                                "zero_terms_query":"NONE",
                                "auto_generate_synonyms_phrase_query":true,
                                "boost":1.0
                             }
                          }
                       }
                    ],
                    "adjust_pure_negative":true,
                    "boost":1.0
                 }
              },
              "path":"AvailabilityPeriodV2",
              "ignore_unmapped":false,
              "score_mode":"avg",
              "boost":1.0,
              "inner_hits":{  
                 "ignore_unmapped":false,
                 "from":0,
                 "size":3,
                 "version":false,
                 "explain":false,
                 "track_scores":false
              }
           }
        }

0 个答案:

没有答案