Wednesday, May 27, 2009

Solr wildcards and omitnorms

I have been using solr for some time now. And I like the tool. With its schema definition it does allow a level of flexibility.
So the other day I was working on a task where I wanted to match a "text" field with wildcard queries e.g. "doc*" or "C*". But even after trying to hours I could not get it working... Until ofcourse I experimented with the omitnorms attribute on the field definition. I was able to confirm that by using omitnorms="true" on the field I was able to perform wildcard searches.



<field name="categoryCode" type="text" multivalued="true" indexed="true" stored="true" omitnorms="true">


I could not find any document on solr wiki that explaned about wildcards and omitnorms. I hope this saves someone time.

Do post your comments/findings.

No comments: