简体   繁体   English

使用sunspot_rails和heroku进行SOLR子字符串搜索

[英]SOLR substring search using sunspot_rails and heroku

I recently altered my schema.xml (as suggested by this post in the sunspot wiki ) to help with substring searching. 我最近更改了schema.xml(如黑子Wiki上的这篇文章所建议),以帮助进行子字符串搜索。 This works great locally. 这在本地效果很好。 But after pushing to production and reindexing, the changes don't appear to have taken effect (ie substring matching doesn't seem to work). 但是在推向生产和重新索引之后,这些更改似乎并未生效(即子字符串匹配似乎不起作用)。 In other words, if I take the same string (ie "Mastercard") and search "Ma" locally, I get a "Mastercard" string as a result... but on production, I don't get anything. 换句话说,如果我使用相同的字符串(即“万事达卡”)并在本地搜索“ Ma”,结果将得到“万事达卡”字符串...但是在生产中,我什么也没得到。 I'm using the sunspot_rails gem on heroku. 我在heroku上使用sunspot_rails gem。

Figured it out. 弄清楚了。 My app's schema.xml file didn't touch the websolr instance, which has its own schema.xml (editable through the "advanced configuration" tab). 我应用程序的schema.xml文件没有碰到websolr实例,该实例具有自己的schema.xml(可通过“高级配置”选项卡进行编辑)。 Made the change there and now everything works as expected. 在那里进行更改,现在一切正常。 Awesome. 太棒了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM