4
votes

schema.xml (the part related to my question):

<field name="question" stored="true" type="text" multiValued="false" indexed="true"/>
<field name="question_highlight" stored="true" type="string" multiValued="false" indexed="true"/>
</fields>
<!-- AND -->
<copyField source="question" dest="question_highlight" />

Notes: I have stopwords enabled for fieldType: text

When I index a document I pass the question field now when I try to search using this query

select?q=question:have fever&hl=true&hl.fl=question_highlight

knowing that the word have is included in my stopwords list, the word have is not highlighted in the results How can I fix this? I need to highlight stopwords, I checked this post Solr highlighting without stop-words for phrases? that's why I put question_highlight as string but it's still not working

1

1 Answers

0
votes

The simple solution would be using hl.q parameter on highlight field while using q on the search field that has StopFilter and hl.q