cancel
Showing results for 
Search instead for 
Did you mean: 

Solr search for Alphanumeric value isn't working

Former Member
0 Kudos

Hi Experts,

When I'm searching, any alphanumeric product code isn't coming out in my search result. In below example when I searching by "6737325", it's returning (6737325EF) Product which is Correct.

But when I'm searching by "6737325EF" I'm not getting this product (6737325EF) instead other products having "EF" in their Name or Description coming out in search result.

I want 6737325EF product at top of my search result list.

Can somebody help here.

Thanks.. !!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can add parameter splitOnNumerics="0" and try on your WordDelimiterFilterFactory property, inside your \config\solr\embedded\conf\schema.xml file as given below.

 <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
             <analyzer>
                 <tokenizer class="solr.StandardTokenizerFactory" />
                 <filter class="solr.StandardFilterFactory" />
                 <filter class="solr.LowerCaseFilterFactory" />
                 <filter    class="de.hybris.platform.solrfacetsearch.ysolr.synonyms.HybrisSynonymFilterFactory" ignoreCase="true" synonyms="en" coreName="${solr.core.name}"/>
                 <filter class="solr.WordDelimiterFilterFactory"
                     generateWordParts="1" generateNumberParts="1" catenateWords="1"
                     catenateNumbers="1" catenateAll="0" splitOnCaseChange="0" splitOnNumerics="0"/>
                 <filter    class="de.hybris.platform.solrfacetsearch.ysolr.stopwords.HybrisStopWordsFilterFactory" ignoreCase="true" lang="en" coreName="${solr.core.name}"/>
                 <filter class="solr.StopFilterFactory" words="lang/stopwords_en.txt" ignoreCase="true" />
                 <filter class="solr.ASCIIFoldingFilterFactory" />
                 <filter class="solr.SnowballPorterFilterFactory" language="English" />
             </analyzer>
         </fieldType>

The below link about the property is given for your reference. You may have to do this change for all the different fieldType name="text_" you had set for example(text_en, text_de, etc), then restart server and perform a full indexing.

https://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.WordDelimiterFilterFactory

I hope this helps.

Thanks,

Jayahar

Former Member
0 Kudos

Hi Jayahar,

Thanks for your instant response, but unfortunately the issue isn't fix yet, I did the same as your said and modified the \hybris\config\solr\embedded\conf\schema.xml for following types

text textgen text_en . .

.. and so on.

but the issue isn't resolved. Which part I'm missing here.

Former Member
0 Kudos

I hope you have tried build, restnd full indexing after making changes. If so it would be better if you attach schema file to analyze further.

Former Member
0 Kudos

Hello Jayahar,

I employed the proposed approach. The search works when I have alphanumeric in either Product name or description. But the search for alpha numeric fails, when I try to search by Product code.

To reiterate, the search works when I do a search by Product name or description which contain alpha numeric. But the search fails when I do a search by Product code which contains alpha numeric.

Former Member
0 Kudos

The product code issue got resolved by changing its type from string to text