带过滤器的Function_score查询

时间:2017-05-10 14:09:05

标签: elasticsearch

我需要在搜索结果中考虑公司的优先级。该文档有一个类似的" Boosting Filtered Subsetsedit"选项。在结果中,我收到此json请求并收到错误。也许我没有按照相同的顺序提出过滤请求。请告诉我,考虑过滤,有必要写一个问题。

{
"index":"base",
"type":"info",
"from":0,
"size":10,
"fields":["cID","firm_html"],
"body":
       {
        "query":
                {
                "bool":
                      {
                       "must_not":[
                                  {
                                  "match":
                                         {
                                        "info.published":"no"
                                         }
                                  }
                                  ],
                       "should":[
                                {
                                "query_string":
                                               {
                                                "default_field":
                                                    "info.shortname",
                                                    "query":"value"
                                                }
                                },
                                {
                                "match":
                                        {
                                        "_all":"value"
                                        }
                                },
                                ]
                       },
                "function_score":
                                {
                                "functions":[
                                            {
                                            "filter":
                                                     {
                                                 "term":
                                                        {
                                                         "razm_prio":"0.4"
                                                        }
                                                 },
                                            "weight":"0.4"
                                            },
                                            ],
                                "score_mode":"sum"
                                }
                }
        }
}

0 个答案:

没有答案