小编use*_*706的帖子

在 searchkick 中定义自定义映射不起作用

我有一个 Campaign 模型,这就是我的自定义映射的样子:

searchkick mappings: { 
 campaign: {
   properties: {
     title: {type: "string", analyzer: "snowball"},
     deal_title: {type: "string", analyzer: "snowball"},
     description: {type: "string", analyzer: "snowball"}
   }                                         
 }                                           
}
Run Code Online (Sandbox Code Playgroud)

当我重新索引竞选文件时

c = Campaign.search "this is"
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

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
}
Run Code Online (Sandbox Code Playgroud)

此外,当我将 …

ruby-on-rails elasticsearch searchkick

5
推荐指数
0
解决办法
1265
查看次数

标签 统计

elasticsearch ×1

ruby-on-rails ×1

searchkick ×1