I am using Search API 8.x-1.10 in Drupal 8.6.2, with the Database Server. I am temporarily developing remotely on Pantheon.

I have the HTML filter processor enabled on a fulltext taxonomy term field that is used to describe the taxonomy term. It is not stripping the HTML tags. I have tried different orders of processors, clearing the index and re-indexing, and flushing the caches. It's working correctly on another version of the site with the Solr backend and fewer processors. I can strip the tags in the Search View but feel I should rather be doing it earlier with the Search API processor.

What else could be causing this? These are my processors. Is the order correct/sensible?

Search API processors

Comments

Nick Hope created an issue. See original summary.

drunken monkey’s picture

Status: Active » Fixed

The HTML filter will only strip HTML from text fields at indexing time, the text fields shown in search results are untouched by this. If you want them stripped of HTML as well, you can either do it via Views, or get the displayed field values directly from Solr (enable “Retrieve results data from Solr” for the server, disable “Use entity field rendering” for the Views field). I expect you didn’t properly set up the latter. If it works on another site of yours, maybe just compare the settings.

nick hope’s picture

Thank you for the explanation. It gave me a eureka moment that the displayed contents of the results are not coming directly out of the actual index itself.

I did manage to strip the tags with Views, and was able to leave italics, which is nice for my species names. I have actually stopped using Solr for the time being (having seen the cost of the plan on Pantheon that includes it) and am getting on OK with the Database Server.

drunken monkey’s picture

Just FYI: There are actually lots of other Solr hosts for lower costs, and the Solr version provided by Pantheon (Solr 3.x!) is rubbish anyways.

nick hope’s picture

Yes, thanks. Platform.sh told me that Solr is available on all their plans.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Marko B’s picture

I was also confused a bit by how results are displayed, thought html would be stripped out, easy fix for this is to just put something like this.
<p class="search-snippet"><?php print strip_tags($snippet,'<strong>'); ?></p> and strip out all html tags but bold ones, that highlight keywords.