gpt4 book ai didi

ruby-on-rails - Sunspot/Solr 无法按 bool 值搜索

转载 作者:行者123 更新时间:2023-12-04 05:36:18 25 4
gpt4 key购买 nike

我有一个带有 bool 字段的 RoR 模型:

field :active, :type => Boolean

在可搜索 block 中列出:

searchable do
boolean :active

还有在搜索查询中:

s = Document.search do
with(:active, true)
end

还有我的 Solr schema.xml 文件:

<field name="active_b" type="boolean" indexed="true" stored="true"/>

问题是我的搜索没有将结果限制为仅将 active 设置为 true 的文档。这在我的本地开发环境中有效,但在 Heroku 中无效。

有什么想法吗?

最佳答案

如果它在开发中工作,那么这是部署或 Heroku 问题,而不是 solr/sunspot 问题。

来自 Heroku 文档 https://devcenter.heroku.com/articles/websolr

Websolr 在 http://websolr.com/ 提供了一个控制面板您可以在其中更改索引,例如添加或删除不同的 Solr 功能、选择不同的 Solr 客户端、提供您自己的 schema.xml 等。

您需要将 schema.xml 上传到 Websolr。

关于ruby-on-rails - Sunspot/Solr 无法按 bool 值搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13247952/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com