开发者

Solr 'text' fields not accepting wild-cards

I am trying to search on a field declared as 'text' using the wildcard '*' but am getting mixed results. Basically, it seems to me that it's stripping off the '*' character and isn't handling numbers or spaces well.

I'm using the 'text' field type for case insensitive fields but after running an analysis, am starting to think itmight be the wrong type to use as it runs a lot more filters when compared with the string field. Ba开发者_运维百科sically all I want is a field type that can index or search on lowercase only with spaces stripped out (and works with wildcards). Is such a type available?

Thanks MARCO


If you look at your solrconfig.xml, you can see the definition of your "text" type. You should see a WhitespaceTokenizerFactory as the first tokenizer. This indicates that the content of the fields is cut on white spaces. Down in the list you should have a LowerCaseFilterFactory filter. This will lower-cased all words. If you have at least those two for both the index and query analyzer for the "text" type, you should be ok.

For you problems with numbers, take a look at the settings for the WordDelimiterFilterFactory filter. The generateNumberParts settings might not be what you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜