elasticsearch - Boosting Filtered query based on field value -


i have following filtered query , want use custom_score query or custom_filters_score query boost results based on specific field value. however, i'm hitting errors such as:

no query registered [custom_filters_score]];  no query registered [custom_score]];  

where going wrong? appreciated !

here query:

{ "query": {     "custom_score": {         "query": {             "filtered": {                 "query": {                     "bool": {                         "should": [                             {                                 "constant_score": {                                     "query": {                                         "match": {                                             "question": {                                                 "query": "diabetes"                                             }                                         }                                     },                                     "boost": 1                                 }                             },                             {                                 "dis_max": {                                     "queries": [                                         {                                             "constant_score": {                                                 "query": {                                                     "match": {                                                         "question": {                                                             "query": "diabetes"                                                         }                                                     }                                                 },                                                 "boost": 0.01                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "match": {                                                         "answer_text": {                                                             "query": "diabetes"                                                         }                                                     }                                                 },                                                 "boost": 0.0001                                             }                                         }                                     ]                                 }                             },                             {                                 "dis_max": {                                     "queries": [                                         {                                             "constant_score": {                                                 "query": {                                                     "match_phrase": {                                                         "question_phrase": {                                                             "query": "what diabetes",                                                             "slop": 0                                                         }                                                     }                                                 },                                                 "boost": 100                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "match_phrase": {                                                         "question_phrase": {                                                             "query": "what diabetes",                                                             "slop": 1                                                         }                                                     }                                                 },                                                 "boost": 50                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "match_phrase": {                                                         "question_phrase": {                                                             "query": "what diabetes",                                                             "slop": 2                                                         }                                                     }                                                 },                                                 "boost": 33                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "match_phrase": {                                                         "question_phrase": {                                                             "query": "what diabetes",                                                             "slop": 3                                                         }                                                     }                                                 },                                                 "boost": 25                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "question_group_four",                                                         "query": "what__is__diabetes"                                                     }                                                 },                                                 "boost": 0.1                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "question_group_five",                                                         "query": "what__is__diabetes"                                                     }                                                 },                                                 "boost": 0.15                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "concept_words_no_synonyms_20",                                                         "query": "what__is__diabetes"                                                     }                                                 },                                                 "boost": 35                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "concept_words_no_synonyms_15",                                                         "query": "what__is__diabetes"                                                     }                                                 },                                                 "boost": 25                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "concept_words_no_synonyms_10",                                                         "query": "what__is__diabetes"                                                     }                                                 },                                                 "boost": 15                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "concept_words_20",                                                         "query": "what__is__diabetes"                                                     }                                                 },                                                 "boost": 28                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "concept_words_15",                                                         "query": "what__is__diabetes"                                                     }                                                 },                                                 "boost": 16                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "concept_words_10",                                                         "query": "what__is__diabetes"                                                     }                                                 },                                                 "boost": 13                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "concept_words_05",                                                         "query": "what__is__diabetes"                                                     }                                                 },                                                 "boost": 4                                             }                                         }                                     ]                                 }                             },                             {                                 "dis_max": {                                     "queries": [                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "question_group_four",                                                         "query": "diabetes"                                                     }                                                 },                                                 "boost": 0.1                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "question_group_five",                                                         "query": "diabetes"                                                     }                                                 },                                                 "boost": 0.15                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "concept_words_no_synonyms_20",                                                         "query": "diabetes"                                                     }                                                 },                                                 "boost": 35                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "concept_words_no_synonyms_15",                                                         "query": "diabetes"                                                     }                                                 },                                                 "boost": 25                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "concept_words_no_synonyms_10",                                                         "query": "diabetes"                                                     }                                                 },                                                 "boost": 15                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "concept_words_20",                                                         "query": "diabetes"                                                     }                                                 },                                                 "boost": 28                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "concept_words_15",                                                         "query": "diabetes"                                                     }                                                 },                                                 "boost": 16                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "concept_words_10",                                                         "query": "diabetes"                                                     }                                                 },                                                 "boost": 13                                             }                                         },                                         {                                             "constant_score": {                                                 "query": {                                                     "query_string": {                                                         "default_field": "concept_words_05",                                                         "query": "diabetes"                                                     }                                                 },                                                 "boost": 4                                             }                                         }                                     ]                                 }                             }                         ],                         "disable_coord": true                     }                 },                 "filter": {                     "and": [                         {                             "term": {                                 "posted_by_expert": false                             }                         },                         {                             "term": {                                 "tip_question": false                             }                         },                         {                             "term": {                                 "show_in_work_queue": true                             }                         },                         {                             "range": {                                 "verified_answers_count": {                                     "gt": 0                                 }                             }                         }                     ]                 }             }         },         "script": "_score * doc['my_numeric_field'].value"     } }, "sort": [     "_score",     {         "count_words_with_high_concepts": {             "order": "asc"         }     },     {         "popularity": {             "order": "desc"         }     },     {         "length": {             "order": "asc"         }     } ], "fields": [], "size": 10, "from": 0} 

these 2 queries not available in latest versions of elastic search after 0.90.4 . if using elastic search > 0.90.4( pretty old version), have use function score query replaced custom filters score query after 0.90.4 version


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -