just an update: I'm using default similarity only. Ignore that
customsimilarity line.


On Wed, Jan 29, 2014 at 9:47 PM, Mukul Gupta <[email protected]> wrote:

> But why am I getting exactly same score for two documents even though
> their po field hase different values. If I'm multiplying my score by this
> value the resultant value should be different for two, why am I getting
> same scores then ?
>
> Also, here is my mapping looks like:
>
> curl -XPUT 
> 'http://localhost:9200/auto_index/<http://localhost:9200/acqindex/>'
> -d '{
>      "settings" : {
>         "index" : {
>             "number_of_shards" : 1,
>             "number_of_replicas" : 1,
>             "analysis" : {
>                "analyzer" : {
>                   "str_search_analyzer" : {
>                       "tokenizer" : "standard",
>                       "filter" : ["lowercase","asciifolding","
> suggestion_shingle","edgengram"]
>                    },
>                    "str_index_analyzer" : {
>                      "tokenizer" : "standard",
>                      "filter" :
> ["lowercase","asciifolding","suggestions_shingle","edgengram"]
>                   }
>                },
>                "filter" : {
>                    "suggestions_shingle": {
>                        "type": "shingle",
>                        "min_shingle_size": 2,
>                        "max_shingle_size": 5
>                   },
>                   "edgengram" : {
>                       "type" : "edgeNGram",
>                       "min_gram" : 2,
>                       "max_gram" : 30,
>                       "side"     : "front"
>                   },
>                   "mynGram" : {
>                         "type" : "nGram",
>                         "min_gram" : 2,
>                         "max_gram" : 30
>                   }
>               }
>           },
>           "similarity" : {
>                      "index": {
>                              "type":
> "org.elasticsearch.index.similarity.CustomSimilarityProvider"
>                      },
>                      "search": {
>                              "type":
> "org.elasticsearch.index.similarity.CustomSimilarityProvider"
>                      }
>           }
>      }
>   }
>
> curl -XPUT 'localhost:9200/auto_index/autocomplete/_mapping' -d '{
>     "autocomplete":{
>        "_boost" : {
>             "name" : "po",
>             "null_value" : 4.0
>        },
>        "properties": {
>                 "ad": {
>                     "type": "string",
>                     "search_analyzer" : "str_search_analyzer",
>                     "index_analyzer" : "str_index_analyzer",
>                     "omit_norms": "true",
>                     "similarity": "index"
>                 },
>                 "category": {
>                     "type": "string",
>                     "include_in_all" : false
>                 },
>                 "cn": {
>                     "type": "string",
>                     "search_analyzer" : "str_search_analyzer",
>                     "index_analyzer" : "str_index_analyzer",
>                     "omit_norms": "true",
>                     "similarity": "index"
>                 },
>                 "ctype": {
>                     "type": "string",
>                     "search_analyzer" : "keyword",
>                     "index_analyzer" : "keyword",
>                     "omit_norms": "true",
>                     "similarity": "index"
>                 },
>                 "eid": {
>                     "type": "string",
>                     "include_in_all" : false
>                 },
>                 "st": {
>                     "type": "string",
>                     "search_analyzer" : "str_search_analyzer",
>                     "index_analyzer" : "str_index_analyzer",
>                     "omit_norms": "true",
>                     "similarity": "index"
>                 },
>                 "co": {
>                     "type": "string",
>                     "include_in_all" : false
>                 },
>                 "st": {
>                     "type": "string",
>                     "search_analyzer" : "str_search_analyzer",
>                     "index_analyzer" : "str_index_analyzer",
>                     "omit_norms": "true",
>                     "similarity": "index"
>                 },
>                 "co": {
>                     "type": "string",
>                     "search_analyzer" : "str_search_analyzer",
>                     "index_analyzer" : "str_index_analyzer",
>                     "omit_norms": "true",
>                     "similarity": "index"
>                 },
>                 "po": {
>                     "type": "double",
>                     "boost": 4.0
>                 },
>                 "en":{
>                     "type": "boolean"
>                 },
>                 "_oid":{
>                     "type": "long"
>                 },
>                 "text": {
>                     "type": "string",
>                     "search_analyzer" : "str_search_analyzer",
>                     "index_analyzer" : "str_index_analyzer",
>                     "omit_norms": "true",
>                     "similarity": "index"
>                 },
>                 "url": {
>                     "type": "string"
>                 }
>          }
>      }
> }'
>
> I hope I'm not doing anything wrong in my mapping for po field.
>
>
>
> On Wed, Jan 29, 2014 at 9:40 PM, Binh Ly <[email protected]> wrote:
>
>> Coder,
>>
>> Your query is probably working properly. The explain does not show your
>> custom score script logic but it should still be working as expected. You
>> can verify it easily by changing your script logic. For example:
>>
>> Try:
>>
>> String script = "doc['po'].empty ? 1000 : doc['po'].value";
>>
>> And you'll see that the actual score of the document is the value of your
>> po field. (or 1000 if it doesn't exist).
>>
>> --
>> 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/0e86cfc2-b19e-4662-86e6-aede06743d9f%40googlegroups.com
>> .
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
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/CAAVTvp5u2BpUcqs8HZvBYA3zUu8mLiuvfZ%3DXeySffz-yoOF_XA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to