There is a skeleton example at the very bottom:
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#_relation_to_literal_custom_boost_literal_literal_custom_score_literal_and_literal_custom_filters_score_literal

-- 
Ivan


On Wed, Mar 26, 2014 at 12:43 PM, Kina Shah <[email protected]> wrote:

> Ivan,
>
> Thanks for your reply. Yes, I am using 1.0. I went over the Function Score
> documentation, but its bit confusing. Do you have any example of  Function
> Score queries?
>
> Thanks!
>
>
> On Wednesday, March 26, 2014 2:05:09 PM UTC-4, Ivan Brusic wrote:
>
>> Which version of Elasticsearch are you using? The custom filters score
>> query was deprecated in 0.90,4 and removed in 1.0.
>>
>> http://www.elasticsearch.org/guide/en/elasticsearch/
>> reference/0.90/query-dsl-custom-filters-score-query.html<http://www.google.com/url?q=http%3A%2F%2Fwww.elasticsearch.org%2Fguide%2Fen%2Felasticsearch%2Freference%2F0.90%2Fquery-dsl-custom-filters-score-query.html&sa=D&sntz=1&usg=AFQjCNEdX_xYmhxziBbqEV_sPF6Dvwb5mg>
>>
>> Look into using function score queries.
>>
>> --
>> Ivan
>>
>>
>> On Wed, Mar 26, 2014 at 8:24 AM, Kina Shah <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I am trying to apply the custom filter score to a filtered query. The
>>> filtered query works fine, but when I wrap the custom filter score with
>>> filters around it it gives me error.  Listed below is the query. Can
>>> someone tell me what's wrong with it?
>>>
>>> POST _search
>>> {
>>>  "query":
>>>             {
>>>            "custom_filters_score":
>>>         {
>>>             "query":
>>>             {
>>>              "filtered":
>>>             {
>>>                 "query":
>>>                 {
>>>                     "match_all": {}
>>>                 },
>>>                  "filter":
>>>                 {
>>>                     "or":
>>>                     [
>>>                         {
>>>                             "geo_distance" :
>>>                             {
>>>                                 "distance" : "20km",
>>>                                 "senGeoPointLst" :
>>>                                 {
>>>                                     "lat" : 31.8655875846,
>>>                                     "lon" : 65.8461840664
>>>                                 }
>>>                             }
>>>                         },
>>>                         {
>>>                             "geo_distance" :
>>>                             {
>>>                                 "distance" : "20km",
>>>                                 "fcGeoPointLst" :
>>>                                 {
>>>                                     "lat" : 88.1,
>>>                                     "lon" : -120.1
>>>                                 }
>>>                             }
>>>                         }
>>>                     ]
>>>                 }
>>>             }
>>>             },
>>>             " filters":
>>>                         [
>>>                                  {
>>>                                     "geo_distance" :
>>>                                     {
>>>                                         "distance" : "20km",
>>>                                         "fcGeoPointLst" :
>>>                                         {
>>>                                             "lat" : 88.1,
>>>                                             "lon" : -120.1
>>>                                         }
>>>                                     },
>>>                                     "boost":3
>>>                                  }
>>>                         ]
>>>         }
>>>             }
>>> }
>>>
>>> The error I get is :QueryParsingException[[hws] [custom_filters_score]
>>> query does not support [ filters]]; }]",
>>>
>>> Thanks!
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "elasticsearch" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>>
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/elasticsearch/0f7141d1-bb1f-49b5-ac5b-a4dc0c785138%
>>> 40googlegroups.com<https://groups.google.com/d/msgid/elasticsearch/0f7141d1-bb1f-49b5-ac5b-a4dc0c785138%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "elasticsearch" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/796ce883-453e-4a43-b183-285bebf651b9%40googlegroups.com<https://groups.google.com/d/msgid/elasticsearch/796ce883-453e-4a43-b183-285bebf651b9%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCajt%3DvsHLm%3DCv6ESd1nY1_TXFojdbxjgc2BTHd8t7w1Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to