I have a Drupal 7 site using the Search API and Search API Apache SOLR modules to provide search functionality to site visitors.

I'm running Apache SOLR 4.10.2 within my development Vagrant VM environment, and search results are returned for both stemmed and unstemmed terms which is great:

Example search term: "car"

Apache SOLR returns nodes with fields containing the text "car" and "cars"

The problem is, when Apache Solr returns nodes containing the stemmed term "cars", no highlighted excerpts are returned. However results containing the exact term "car" are returned with a hightlighted excerpt as expected.

After extensive searching I found this blog post which contains instructions on how to enable stemming for highlighted excerpts, but no luck.

Here is the excerpt of my schema.xml config file as per the instructions in the blog post:

<!--  Setup simple analysis for spell checking -->

 <fieldType name="textSpell" class="solr.TextField" positionIncrementGap="100">
     <tokenizer class="solr.StandardTokenizerFactory" />
     <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
     <filter class="solr.LengthFilterFactory" min="4" max="20" />
     <filter class="solr.LowerCaseFilterFactory" />
     <filter class="solr.RemoveDuplicatesTokenFilterFactory" />
     <filter class="solr.PorterStemFilterFactory"/>

I have restarted my VM and cleared and reindexed all the nodes, but still no dice.

Has anyone else had this issue before?

Thanks in advance!

3 Answers 3


I'm guessing that you, like me, had the "Highlight" filter enabled, which you shouldn't actually do for Solr. I found this nugget of info here:


Though Solr returns the excerpt, that processor removes it if there's not an exact match.

  • awesome, thanks! will give this a go and post results Commented Aug 15, 2016 at 11:41

In case someone using Drupal 8 sees this question (as I did), the advice to turn off the Highlight filter, which was correct for Drupal 7, is not the solution for Drupal 8. Instead:

  • Edit your index at admin/config/search/search-api
  • At the Processors tab, select the Highlight checkbox
  • In the Highlight tab at the bottom of the page under Processor settings, select Create excerpt
  • Save
  • Edit your Solr Server at admin/config/search/search-api
  • Open the ADVANCED section near the bottom of the page
  • Select Retrieve result data from Solr and Retrieve highlighted snippets
  • Save

Now you'll get highlighted snippets for stemmed words. No need to reindex.


This issue is for Search API with Solr, but the same problem occurs without Solr (aka save the index in the Database).

I found a solution that kind of work. In the Highlight processor settings, tick the box "Highlight partial matches".

If the user searches for the word "car", it will highlight the word "cars" (well, it will highlight "car" and leave the "s" out of the highlight).

If the user searches for the word "cars", the search result will appear but with no excerpt.

It's not perfect. It's even misleading in some cases. For example, if the user search for the word "diversity", and an article is found with both the word "diversity" and "biodiversity", it will highlight the word "biodiversity", leaving the user thinking that the search is done on partial word, which is not the case. Articles that contains the word "biodiversity" but not the word "diversity" doesn't appear in the search results...

It would make more sense if the Highlight processor was working with the query processors instead of re-doing the search just to highlight the result.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.