I have views for solr search result and I have highlight processor enabled. There seems to be cache issue effecting search result. Search results are rendered array of entities. For example: If I search 'content'. I see my result highlighting word 'content' correctly but when I search for result 'extraction', in the page with both words 'content' and 'extraction', it highlights 'content'. I used


in views pre_render but didn't work as expected. Views advanced setting already has caching set to none.

Can anyone help me disabling cache for this particular view?

Thank you.

2 Answers 2


When you go to /admin/config/search/search-api and then click to edit your index, there is a checkbox for "Index items immediately" under the "Index Options" section. That is the only way I've found to get Solr Views to output new content immediately after it's created.


Issue was it was entity cache interfering with result. So, I ended up invalidating cache for entities when it is search result using hook_entity_view_alter. This might not be good idea but it fixes the problem. I am considering going with javascript approach to highlight so that I don't need to invalidate cache.

$build['#cache']['max-age'] = 0;

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.