0
我使用寶石'elasticsearch-rails','〜> 0.1.6'。當試圖根據電子郵件(字符串)進行排序時,例如[email protected],它會分成多個部分。結果排序結果不正確。
有什麼想法?Elasticsearch分類在rails(基於電子郵件)
我使用寶石'elasticsearch-rails','〜> 0.1.6'。當試圖根據電子郵件(字符串)進行排序時,例如[email protected],它會分成多個部分。結果排序結果不正確。
有什麼想法?Elasticsearch分類在rails(基於電子郵件)
我發現這個解決方案,這對我很有用。
settings do
mapping dynamic: false do
[:sort_name, :email, :status].each do |attr|
indexes attr, type: 'string', index: :not_analyzed
end
[:name].each do |attr|
indexes attr, type: 'string'
end
end
end
我解決了這個問題 – 2015-02-13 12:12:27