Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7490867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:46:50+00:00 2026-05-29T15:46:50+00:00

I am newbie to Solr and have no skills in Java, so maybe I

  • 0

I am newbie to Solr and have no skills in Java, so maybe I am missing something… I am trying to get Solr to strip off HTML from content, using the following CharFilter:

http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.HTMLStripCharFilterFactory

This is how I am including it into my schema.xml:

<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
  <analyzer type="index">
    <charFilter class="solr.HTMLStripCharFilterFactory"/>
    <tokenizer class="solr.StandardTokenizerFactory"/>
  </analyzer>
  <analyzer type="query">
    <charFilter class="solr.HTMLStripCharFilterFactory"/>
    <tokenizer class="solr.StandardTokenizerFactory"/>
  </analyzer>
</fieldType>

<fields>
  <field name="text" type="text" indexed="true" stored="true" multiValued="false" />
</fields>

If I query using the analyzer on the Solr admin panel for “d'Hèrcules”, I get a match (see field):

<doc>
<long name="comment_count">0</long>
<str name="ct_model_name">theatre</str>
<str name="django_ct">timeout.work</str>
<str name="django_id">2535</str>
<bool name="family">false</bool>
<long name="hits">0</long>
<str name="id">timeout.work.2535</str>
<str name="name">Les aventures d'Hèrcules</str>
<arr name="parent_sections">
<str>Escena</str>
</arr>
<long name="rating">0</long>
<bool name="recommended">false</bool>
<arr name="sections">
<str>Escena - Infantil</str>
</arr>
<str name="text">
Les aventures d&#39;Hèrcules Jordi Andújar &lt;p&gt;Prepareu-vos per viatjar a l’antiga Grècia on coneixereu l’heroi més gran de tots els temps: l’Hèrcules. De viatge cap a l’Olimp, l’heroi viurà les més increïbles aventures, lluitarà amb bèsties ferotges i perillosos monstres, i s’enfrontarà a la maldat de la temible deessa Hera. Per a tota la família&lt;/p&gt;
</str>
...
</doc>

but I need to match by searching the non-HTML-entity form: e.g. in this case, would be “l’Hèrcules” (note the single quote).

What am I doing wrong?

By the way, I am using django-haystack, if this info is useful in any way.

Thanks in advance,

Hector

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T15:46:50+00:00Added an answer on May 29, 2026 at 3:46 pm

    You’re doing well on Solr side, the only thing you should notice is that there’s a difference between what Solr stores and what Solr indexes. Solr stores data as they are without modifying anything, while through the analyzer chain you can change the way Solr indexes data.
    So you are actually telling Solr to strip any html tag from the index and to replace html entities with related characters, but Solr will always return them as you submitted them.

    You can search for d'Hèrcules or d&#39;Hèrcules and you should have the same results, since you have the HtmlStripCharFilterFactory fired even at query time, so you are basically submitting the same query for d'Hèrcules in both cases because &#39; is converted to '.

    Your search for l'Hèrcules makes me think that the unescaped character between l and Hercules in your document isn’t ' but something that looks really similar. I think you should check this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Newbie Warning I have a simple but vexing problem trying to disable an NSButton.
Newbie question... The objective: I intend to have an HTML text input field as
Solr newbie here. I have created a Solr index and write a whole bunch
newbie doing Java homework here. I have one class named Album which contains the
newbie here .. wondering why in the table i get something called '[object node]'
Newbie to C++ but I am a Java programmer. Trying to learn C++ now.
Newbie question on drools. I am trying to access the following java class in
Newbie question. I want to do something like: SELECT c1,c2,c3 FROM TABLE t1 UNION
Newbie Python question. I have a class that inherits from several classes, and some
Newbie question. I have a NSMutableArray that holds multiple objects (objects that stores Bezier

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.