context suggester not working in elasticsearch -


i'm using elasticsearch version 1.2.1:

i'm following example given in elasticsearch documentation throws error.

it may possible i'm missing something.

when run query, error is:

{    "_shards": {       "total": 5,       "successful": 4,       "failed": 1,       "failures": [          {             "index": "services",             "shard": 2,             "reason": "broadcastshardoperationfailedexception[[services][2] ]; nested: elasticsearchexception[failed execute suggest]; nested: nullpointerexception; "          }       ]    } } 

here's complete example:

put /services  put /services/service/_mapping {     "service": {         "properties": {             "name": {                 "type" : "string"             },             "tag": {                 "type" : "string"             },             "suggest_field": {                 "type": "completion",                 "context": {                     "color": {                          "type": "category",                         "path": "color_field",                         "default": ["red", "green", "blue"]                     },                     "location": {                          "type": "geo",                         "precision": "5m",                         "neighbors": true,                         "default": "u33"                     }                 }             }         }     } }  put services/service/1 {     "name": "knapsack",     "suggest_field": {         "input": ["knacksack", "backpack", "daypack"],         "context": {             "color": ["red", "yellow"]         }     } }   post services/_suggest?pretty' {     "suggest" : {         "text" : "m",         "completion" : {             "field" : "suggest_field",             "size": 10,             "context": {                 "color": "red"             }         }     } } 


Comments

Popular posts from this blog

.htaccess - htaccess convert request to clean url and add slash at the end of the url -

C# random value from dictionary and tuple -

algorithm - Testing tetrahedron-triangle intersection -