Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的 ruby on rails 应用程序中实现了对轮胎的弹性搜索。 到目前为止,我做得很好。现在我想检索与精确值匹配的结果。 例如,如果有两个标题为“once on”和“once on a time”的记录,“title: once on”应该只返回一个标题正好为“once on”的记录
这是示例代码:
Tire.search 'articles', do |search| search.size 100 # Limit record search.from 0 # start offeset # search.query.text keyword, :type => :phrase search.query do |query| query.text :_all, keyword, :type => :phrase end end end
希望它会有所帮助!