在solr中搜索没有空格的单词 [英] Searching words with spaces for word without spaces in solr

查看:61
本文介绍了在solr中搜索没有空格的单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我的索引中有icecube",我如何搜索ice cube"?我已将 mm 设置为 2<-1 4<70%.在查询分析器中使用 shingle 时,查询ice cube"会创建三个标记,分别为ice"、cube"、icecube".但是 mm 是这里的限制.只搜索冰块和立方体,但不搜索冰块".即虽然我使用的是带状疱疹过滤器,但不能成对使用.但是在分析工具中,创建了三个令牌.如何解决?.这里是模式配置链接:http://pastebin.com/74xaKEyv

how can i search "ice cube" if I have "icecube" in my index. I have set mm as 2<-1 4<70%. While using shingle in query analyzer, the query "ice cube" creates three tokens as "ice","cube", "icecube". But mm is the limitation here. Only ice and cubes are searched but not "icecubes".i.e not working for pair though I am using shingle filter. However in analysis tool, three tokens are created. How to solve it ?. Here the schema configuration link: http://pastebin.com/74xaKEyv

推荐答案

我认为您应该只在架构中的索引化时使用 Shingle 过滤器.

I think you should use the Shingle filter only at indexation in your schema.

尝试从分析器的查询部分删除 <filter class="solr.ShingleFilterFactory" maxShingleSize="2" outputUnigrams="true" tokenSeparator=""/>.

Try removing <filter class="solr.ShingleFilterFactory" maxShingleSize="2" outputUnigrams="true" tokenSeparator=""/> from the query part of your analyzer.

这篇关于在solr中搜索没有空格的单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆