0
請對下面的代碼一看,它爲thinking sphinx
爲ElasticSearch替代語法VS ThinkingSphinx
indexes owned_tags.name, :as => :owned_tag_names
has owned_tags.id, :as => :owned_tag_ids, :facet => true
正常索引的語句可以在任何一個導向會是什麼語法有ElasticSearch
相同指數?
我試過了。
tire.mapping do
indexes :owned_tag_names, type: 'array', analyzer: :ngram_analyzer, index_name: 'tag'
indexes :owned_tag_ids, type: 'array'
end
def to_indexed_json
{
owned_tag_names: owned_tags.collect(&:name),
owned_tag_ids: owned_tags.collect(&:id)
}.to_json
end
和它給我的錯誤:
400 : {"error":"MapperParsingException[mapping [user]]; nested: MapperParsingException[No handler for type [array] declared on field [owned_tag_ids]]; ","status":400}