> I am using SOLR 1.3 and my server is > embedded and accessed using SOLRJ. > I would like to setup my searches so that exact matches are > the first > results returned, followed by near matches, and finally > token based > matches. > For example, if I have a summary field in schema which is > created > using copyField from a bunch of other fields: > "My item title, keyword, other, stuff" > > I want this search to match the item above first and > foremost: > 1) "My item title*" > > Then this one: > 2) "my item*"
Wildcards inside phrases are not supported by default. You can use SOLR-1604 for that in solr 1.4.0. But i am not sure it will work with 1.3. Can you try? > I tried creating a field to hold exact match data > (summaryExact) which > actually works if I paste in the precise text but stops > working as > soon as I add any wildcard to it. Your <fieldType name="exact" definition is wrong. You can use directly string field type which is not analyzed/tonenized. Where string definiton is: <fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/> > I could not quite figure out which tokenizer to use if I > don't want > any tokens created but just want to trim and lowercase the > string so > let me know if you have ideas on this. KeywordTokenizerFactory + TrimFilterFactory + LowercaseFilterFactory combination can do that put punctuations won't be removed between tokens. > Basically, I want something > similar to DB "like" matching without case sensitivity and > probably > trimmed as well. I don't really want the field to be > tokenized though. Your examples seem you want to search something like startsWith? Can you explain more in detail? Also your <fieldType name="name" class="solr.StrField" ..> declation is also wrong. It should use class="solr.TextField".