Solr email address search returns 0 results -


i trying allow partial or full email search in solr 4.0.

here test cases:

  • flast@company.com
  • flast

i tried this. not getting exact result first case whole email provided , not getting result second result (which happens unique value), means solr isn't looking email field.

here truncated schema. must missing obvious, not seeing it.

<schema name="search" version="1.5"> <types>     <fieldtype name="long" class="solr.trielongfield" precisionstep="0" positionincrementgap="0"/>      <fieldtype name="text_email" class="solr.textfield" sortmissinglast="true" omitnorms="true" autogeneratephrasequeries="true">       <analyzer type="index">         <tokenizer class="solr.standardtokenizerfactory" />         <filter class="solr.lowercasefilterfactory" />         <filter class="solr.worddelimiterfilterfactory" />       </analyzer>       <analyzer type="query">         <tokenizer class="solr.standardtokenizerfactory" />         <filter class="solr.lowercasefilterfactory" />         <filter class="solr.worddelimiterfilterfactory" />       </analyzer>     </fieldtype> </types>  <fields>     .     .     .     <field name="email" type="text_email" indexed="true"  stored="true"/>     .     .     . </fields> 

use worddelimiterfilterfactory below.

<filter class="solr.worddelimiterfilterfactory"                 generatewordparts="1"                 generatenumberparts="0"                 catenatewords="0"                 catenatenumbers="0"                 catenateall="0"                 preserveoriginal="1"                 /> 

generatewordparts="1" generate parts of words:

preserveoriginal="1" causes original token indexed without modifications.

the final type should :

<analyzer type="index">         <tokenizer class="solr.standardtokenizerfactory" />         <filter class="solr.worddelimiterfilterfactory"                 generatewordparts="1"                 generatenumberparts="0"                 catenatewords="0"                 catenatenumbers="0"                 catenateall="0"                 preserveoriginal="1"                 />         <filter class="solr.lowercasefilterfactory" />       </analyzer>       <analyzer type="query">         <tokenizer class="solr.standardtokenizerfactory" />         <filter class="solr.worddelimiterfilterfactory"                 generatewordparts="1"                 generatenumberparts="0"                 catenatewords="0"                 catenatenumbers="0"                 catenateall="0"                 preserveoriginal="1"                 />         <filter class="solr.lowercasefilterfactory" />       </analyzer> 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -