lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <>
Subject Re: index special characters solr
Date Wed, 06 Jun 2012 02:40:58 GMT
Thanks. I'm sure someone else will have the same issue at some point.

-- Jack Krupansky

-----Original Message----- 
From: KPK
Sent: Tuesday, June 05, 2012 9:51 PM
Subject: Re: index special characters solr

Thanks Jack for your help!
I found my mistake, rather than classifying those special characters as
ALPHA , I classified it as a DIGIT. Also I missed the same entry for search
analyzer. So probably that was the reason for not getting relevant results.

I spent a lot of time figuring this out. So I'll paste my code snippet of
schema.xml which was changed for newbies so that they dont waste so much
time in this.
I classified my field as text in which I wanted to search for keywords
including special characters. In fieldType definition modify the filter

<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1"
generateNumberParts="1" catenateWords="1" catenateNumbers="1"
catenateAll="0" splitOnCaseChange="1" preserveOriginal="1"
types="characters.txt" />

in BOTH  <analyzer type="index"> and  <analyzer type="query">

And make a new characters.txt in the same folder as schema.xml and add the
content :

$ => ALPHA
% => ALPHA

(i wanted $ and % to behave as alphabets so that they could be searched)

Then restart jetty/tomcat

This is how i solved this problem.
Hope this would help someone :)

View this message in context:
Sent from the Solr - User mailing list archive at 

View raw message