خرید بک لینک

Vote count: 0

I have multiple queries, each of them will retu own score. What i need to do is that if one specific query retu score i need to take this score. What i am doing now

POST crawler/company/_search
{
  "query": {
    "function_score": {
      "bool": {
        "should": [
          {
            "term": {
              "SecondProperty": {
                "value": "term5"
              }
            }
          },
          {
            "has_child": {
              "score_mode": "max",
              "type": "ranking",
              "query": {
                "function_score": {
                  "query": {
                    "term": {
                      "Term": {
                        "value": "term5"
                      }
                    }
                  },
                  "script_score": {
                    "script": "1000-doc['ranking.Rank'].value"
                  }
                }
              }
            }
          }
        ],
        "minimum_number_should_match": 1
      }
    }
  }
}

So idea is following I am searching in companies but if specific company has ranking that it should be sorted by ranking. If not then Score from term query should be taken.

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 18 فروردين 1395 ساعت: 22:20

صفحه بندی