我目前在我的一个模型中有这个Map实现,我不确定是否应用了分析器:
settings index: { analysis: { analyzer: { default: { type: :english } } } } do
mappings do
indexes :field1, type: :integer
indexes :field2, type: :integer
indexes :field3, type: :float
indexes :field4, type: :text do
indexes :keyword, type: :keyword
end
indexes :field5, type: :text do
indexes :keyword, type: :keyword
end
indexes :field6, type: :text do
indexes :keyword, type: :keyword
end
indexes :field7, type: :text
indexes :field8, type: :boolean
end
end
我看到过分析器使用的实现,其中字段的类型没有声明,但要使用的分析器是。大概是这样的:
settings index: { analysis: { analyzer: { default: { type: :english } } } } do
mappings do
indexes :field1, analyzer: "default"
indexes :field2, analyzer: "default"
...
end
end
所以我的问题是,在我当前的实现中,声明的分析器到底有没有做任何事情?
1条答案
按热度按时间irlmq6kh1#
为什么要使用
searchkick
click here?因为有了它的帮助,你可以处理不同模型之间Map的最佳方式。此外,您可以以最佳方式将查询写入弹性,就像我们在Rails中的ORM(活动记录)一样。
当您开始使用时,您可以将更多的精力放在应用程序代码上,而不是这些配置方面。
让我们给予它试试。它肯定会对您开发旅程产生影响。希望你有一个想法:)