“ }
车型/ hall.rb
协会 </跨度> searchkick word_start:[:name,:slug,:description,:facebook_link], word_middle:[:name “:”1527437182297“,” 分析 </跨度> “:{” 过滤器 “:{” searchkick_suggest_shingle “:{” max_shingle_size “:” 5" , “类型”: “木瓦”}, “searchkick_edge_ngram”:{ “类型”: “edgeNGram”, “min_gram”: “1” ,“max_gram”:“50”},“searchkick_index_shingle
我解决了上述错误,让我分享一下。
我认为有一些原因是因为我的开发和产品上有Elasticsearch的版本。
========on dev========== Loading development environment (Rails 4.2.6) 2.2.4 :001 > Elasticsearch::Model.client.info => {"name"=>"Sunpyre", "cluster_name"=>"elasticsearch", "version"=>{"number"=>"2.3.5", "build_hash"=>"90f433701e64ccd01edbb4", "build_timestamp"=>"2016-07-27T10:36:52Z", "build_snapshot"=>false, "lucene_version"=>"5.5.0"}, "tagline"=>"You Know, for Search"} 2.2.4 :002 > =======on prod========= Loading production environment (Rails 4.2.6) 2.2.0 :001 > Elasticsearch::Model.client.info => {"name"=>"Production Node", "cluster_name"=>"elasticsearch", "cluster_uuid"=>"NCPUn7V084cpIA", "version"=>{"number"=>"2.4.6", "build_hash"=>"5376dca9f70f3abe0ace8240fd", "build_timestamp"=>"2017-07-18T12:17:44Z", "build_snapshot"=>false, "lucene_version"=>"5.5.4"}, "tagline"=>"You Know, for Search"} 2.2.0 :002 >
所以像下面的映射在dev中工作但不在prod上工作。
====在dev上工作但不在prod上工作=====
searchkick word_start: [:name, :slug], word_middle: [:name, :slug], text_start: [:name, :slug], locations: ["location"]
但是,当我添加显式映射时,它可以用于生产......也可以用于dev(不用说)
searchkick merge_mappings: true, mappings: {hall: {properties: { locations: { type:"geo_point" } } } }, locations: ["location"], word_start: [:name, :slug], word_middle: [:name, :slug], text_start: [:name, :slug] mapping do indexes :location, type: 'geo_point' end
我认为所有的自定义映射都是2.4版本所需的东西,在ChangeLog上看不到。
希望这有助于某人。