Maybe you just want to use the white space tokenizer - the standard tokenizer treats the at-sign as if a space.

See:
http://lucene.apache.org/core/4_0_0/analyzers-common/org/apache/lucene/analysis/core/WhitespaceTokenizerFactory.html

Or, you could use the "classic" tokenizer which does keep email addresses and URLs.
http://lucene.apache.org/core/4_0_0/analyzers-common/org/apache/lucene/analysis/standard/ClassicTokenizerFactory.html

And, there is some variant of the new standard tokenizer that also preserves email addresses and URLs - but it's name is too complex for me to recommend it with a straight face: UAX29URLEmailTokenizerFactory.

See:
http://lucene.apache.org/core/4_0_0/analyzers-common/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizerFactory.html


-- Jack Krupansky

-----Original Message----- From: balaji.gandhi
Sent: Friday, November 09, 2012 8:38 AM
To: solr-user@lucene.apache.org
Subject: Re: Using AnalyzingQueryParser - Solr 4.0

Hi Jack,

We have an email field defined like this:-

       <fieldType name="text_email" class="solr.TextField"
positionIncrementGap="100">
           <analyzer>
               <tokenizer class="solr.StandardTokenizerFactory"/>
               <filter class="solr.LowerCaseFilterFactory"/>
               <filter class="solr.PatternReplaceFilterFactory"
pattern="\." replacement=" DOT " replace="all"/>
               <filter class="solr.PatternReplaceFilterFactory" pattern="@"
replacement=" AT " replace="all"/>
               <filter class="solr.WordDelimiterFilterFactory"
generateWordParts="1" generateNumberParts="1"
                       catenateWords="0" catenateNumbers="0"
catenateAll="0" splitOnCaseChange="0"/>
           </analyzer>
           <analyzer type="multiterm">
               <tokenizer class="solr.KeywordTokenizerFactory" />
           </analyzer>
       </fieldType>

A query like [emailAddress : bob*] would match b...@bob.com, but queries
which include any special characters like [bob@], [bob@*] and [bob@bob.*]
will not match any email addresses.

Yes, I tried the multi-term and it does not fix the issue. Any thots?

Thanks,
Balaji



--
View this message in context: http://lucene.472066.n3.nabble.com/Using-AnalyzingQueryParser-Solr-4-0-tp4019193p4019341.html Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to