ruby on rails - defining custom mapping in searchkick does not work -


i have campaign model , how custom mapping looks like:

searchkick mappings: {   campaign: {    properties: {      title: {type: "string", analyzer: "snowball"},      deal_title: {type: "string", analyzer: "snowball"},      description: {type: "string", analyzer: "snowball"}    }                                           }                                            } 

when reindex campaign documents, , do

c = campaign.search "this is" 

i following error:

searchkick::invalidqueryerror: [400] {      "error":{         "root_cause":[            {               "type":"query_parsing_exception",             "reason":"[match] analyzer [searchkick_search] not found",             "index":"campaigns_development_20160205130806185",             "line":1,             "col":96          }       ],       "type":"search_phase_execution_exception",       "reason":"all shards failed",       "phase":"query",       "grouped":true,       "failed_shards":[            {               "shard":0,             "index":"campaigns_development_20160205130806185",             "node":"kitxkzieqjui9undzxz1da",             "reason":{                  "type":"query_parsing_exception",                "reason":"[match] analyzer [searchkick_search] not found",                "index":"campaigns_development_20160205130806185",                "line":1,                "col":96             }          }       ]    },    "status":400 } 

also when add merge_mappings: true existing mapping,

searchkick merge_mappings: true, mappings: {   campaign: {    properties: {      title: {type: "string", analyzer: "snowball"},      deal_title: {type: "string", analyzer: "snowball"},      description: {type: "string", analyzer: "snowball"}    }                                           }                                            } 

and

search c = campaign.search "this is" 

, results campaigns having words "this is" in either of title/deal_title/description.

but since using snowball analyzer, these common stop words should have never been indexed , return 0 result.

also in second scenario mapping changed, gives no error. think searchkick not identify snowball analyzer , since did merge_mappings: true, must have used default analyzer indexing. , thats why not give error.

so question is: there wrong in first mapping showed or searchkick not identify snowball(or analyzer matter, tried same thing stop analyzer) analyzer?


Comments

Popular posts from this blog

Unlimited choices in BASH case statement -

Redirect to a HTTPS version using .htaccess -

javascript - jQuery: Add class depending on URL in the best way -