Karthi Skb
Karthi Skb

Reputation: 322

Magento: SOLR: How to remove html tags from SOLR search keyword suggestion?

I'm using SOLR search for Magento search, got some problem while searching. Please see the image.

enter image description here

In my product description i'm having some html tags. So When we are searching, html tags also coming in auto suggestion without special chars. Is there any possible to eliminate html tags here?

Upvotes: 3

Views: 2549

Answers (1)

alexf
alexf

Reputation: 1301

You can use HTMLStripCharFilterFactory, which will strip HTML tags:

HTMLStripCharFilter strips HTML from the input stream and passes the result to either CharFilter or Tokenizer. Like other CharFilters, it's specified using a tag, and must come before the tokenizer. An example:

<analyzer>
  <charFilter class="solr.HTMLStripCharFilterFactory"/>
  <tokenizer class="solr.StandardTokenizerFactory"/>
</analyzer>

So, in the analyzer you used, just add this filter.

Upvotes: 5

Related Questions