solr多域搜索

2019-03-27 01:02|来源: 网路

近期在开发时候需要将商品按照某些属性归类,lucene是很难做到了,自己开发效率不能够保证,于是想到使用solr。一直认为solr配置比较复杂,使用也不容易上手,网上中文资料极少,将自己的摸索成果记下来,供大家分享。

solr在schema.xml中配置defaultSearchField,即为默认搜索的域,要想在多个域中搜索,需要将这些域复制到同一个域 中,一般就这些域复制到默认搜索的域,在schema.xml中配置copyFiled,注意被目的域的multiValued属性药设置为true。


转自:http://www.cnblogs.com/wycg1984/archive/2009/09/16/1567545

相关问答

更多
  • 你也可以检查下面: - SolrPerformanceFactors ImproveSearchingSpeed ImproveIndexingSpeed SolrCaching 在-七致命-罪-OF-的Solr You can also check below :- SolrPerformanceFactors ImproveSearchingSpeed ImproveIndexingSpeed SolrCaching the-seven-deadly-sins-of-solr
  • 尝试使用olr.WordDelimiterFilterFactory 测试用例:
    是否与搜索问候和世界一样? 我相信是这样。 或者,您可以使用过滤器查询 ,例如?q=hello&fq=world 这可能不是“Hello world”情况下的正确解决方案,但它可能是一个有趣的例子。 Is it the same thing as searching hello AND world? I believe so. Alternately, you can use a filter query, e.g. ?q=hello&fq=world This probably isn't the rig ...
  • 您需要将字段复制到默认搜索字段(在本例中为文本),或者使用要搜索的字段限定查询: .../select?q=city:Nashua&wt=xml&indent=true 要阅读的内容: 默认搜索字段 复制字段 两者都记录在这里: https://wiki.apache.org/solr/SchemaXml You need to either copy your fields into the default search field (in this case text) or qualify your ...
  • 如果您正在查找包含只是一个数字的标记的所有文档,则应该使用正则表达式搜索: q=field:/[0-9]+/ 如果文本中包含其他字符中的数字(但这些字符不会与您的示例匹配)中的令牌,则可以在匹配数字之前和之后添加通配符: q=field:/.*[0-9]+.*/ If you're looking for all documents that contain a token that just is a number, a regular expression search should work: q ...
  • 回答我自己的问题:是的,还有另一种选择。 如果 100% 在requestHandler中设置为100%,这等于“AND”,而0%等于“OR”。 我有这个设置,似乎它是在旧版本的Solr中完成的方式。 抱歉给你带来不便。 to answer my own question: yes, there is an other option. If 100% is set in the requestHandler to 100 ...
  • 我认为在这种情况下,StandardTokenizer可以提供更好的帮助。 它将Internet域名和电子邮件地址保留为单个令牌。 如果您发布示例文档和几个您想要匹配的搜索词,它会有所帮助。 更新:查看text_general字段类型,它完全符合您的要求。 我对xyz.facebook.com,faceboook.com,abc.xyz.facebook.com和facebook进行了分析,并将它们保持在一起并按照您想要的方式进行匹配。 I ended using a PatternCaptureGroup ...
  • Solr核心本质上是在应用程序服务器的相同上下文中运行的多个索引。 你可以认为它为每个用户安装了1个war文件 。 每个核心都以名称分隔,因此您必须自己跟踪哪个网址对哪个用户有效。 例如, http://host.com/solr/usercore1/select?q=test http://host.com/solr/usercore2/select?q=test 它基于config solr.xml :
  • 尝试这个 http://localhost:8887/solr/souro_core2/select?q=name:souro&indent=true&shards=shard1,shard2 这应该工作如果你有收藏名称souro_core2有两个分片。 Finally i got my answer. In both shards there was an "id" field and both were containing value 1. But after doing bit research ...
  • 嗯好吃 首先,对于所有这些问题,使用Solr分析工具是你的朋友。 其次,请记住,如果查询和术语是字符相同的100%字符,则Solr仅匹配。 对于以下过滤器