简体   繁体   English

SOLR搜索问题的野性

[英]SOLR search issue in wild character

I have a search query in SOLR with wild char . 我在SOLR中使用野生字符搜索查询。 My need is I need to set the character length. 我的需要是我需要设置字符长度。 Is it possible in SOLR ?. SOLR有可能吗?

For Eg 对于Eg

status:(d*mo) - I need to get only a word with 4 character, ie one character should be replaced in second position 状态:(d * mo) - 我只需要一个带有4个字符的单词,即一个字符应该被替换为第二个位置

Please help 请帮忙

Thanks 谢谢


Great ! 好极了! One more doubt. 还有一个疑问。 Do we need to put back slash before "?" 我们需要在“?”之前放回斜杠吗? ? ie does d\\?mo is needed ? 即是否需要d??mo? Also in SOLR whether single slash is supporting ? 同样在SOLR中是否支持单斜杠? For Eg : Can I check the word "jack's" ? 对于Eg:我可以查看“jack's”这个词吗?

There are two forms of wildcard character: 通配符有两种形式:

  • asterisk ("*") which will match zero or more arbitrary characters and asterisk ("*")将匹配零个或多个任意字符和
  • question mark ("?") which will match exactly one arbitrary character. question mark ("?")将恰好匹配一个任意字符。

If you want to check for single arbitary character you should use ? 如果你想检查单个仲裁字符,你应该使用?

So d?mo would match words with 4 characters with second character being the variable part. 所以d?mo会匹配4个字符的单词,第二个字符是变量部分。

For Detailed information refer to Wildcard Queries 有关详细信息,请参阅通配符查询

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

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