Erick, Thank you for your response to my concerns! After reading some documentations, I come up with the following "solution." It is not doing exactly what I would like it to do, but close.
Basically I set hl.snippets to be a large int, e.g. 50, and hl.fragsize a small positive int, e.g. 1. The parameter hl.snippets defines the maximum number of highlight snippets returned, and hl.fragsize defines the number of characters in each returned snippet. By setting hl.snippets=50&hl.fragsize=1, I can get a list of highlight snippets. Each snippet will include mainly the matched query words with a couple other words before or after the matched words. At least, the regex will have an easier job to do. It is simply a workaround before a formal solution can be found. I will post more information after I dig deeper in the issue. Jim ________________________________ From: Erick Erickson [via Lucene] [ml-node+s472066n348276...@n3.nabble.com] Sent: Saturday, November 05, 2011 8:56 AM To: Jian Ma Subject: Re: Highlighter showing matched query words only Not that I know of. The regex shouldn't be all that expensive, do you have proof that this is a performance issue? If you don't, I'd just do the simple thing first... And probably just searching for <em> would be better than REs.... Best Erick On Thu, Nov 3, 2011 at 7:04 PM, Nikeman <[hidden email]<UrlBlockedError.aspx>> wrote: > Hello Folks, > > I am a newbie of Solr. I wonder if Solr Highlighter can show the matched > query words only. Suppose my query is "godfather AND pacino." I just want to > display "godfather" and "pacino" in any of the highlighted fields. For the > sake of performance, I do not want to use regular expressions to parse the > text and locate the query words which are already enclosed between <em> and > </em>. Solr obviously has already done the searching and highlighting, but > the Solr output mixes what I want with what I do not want. > > I just want to get out the intermediate results, the matching query words, > and nothing else. > > Is there a way to get the intermediate results, the matching query words, > before they are mixed with other text? Thank you all very much for your help > in advance! > > N. J. > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Highlighter-showing-matched-query-words-only-tp3478731p3478731.html > Sent from the Solr - User mailing list archive at Nabble.com. > ________________________________ If you reply to this email, your message will be added to the discussion below: http://lucene.472066.n3.nabble.com/Highlighter-showing-matched-query-words-only-tp3478731p3482766.html To unsubscribe from Highlighter showing matched query words only, click here<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3478731&code=amlhbi5tYUBodWF3ZWkuY29tfDM0Nzg3MzF8LTI5MjQ4NzU5Mg==>. -- View this message in context: http://lucene.472066.n3.nabble.com/Highlighter-showing-matched-query-words-only-tp3478731p3491212.html Sent from the Solr - User mailing list archive at Nabble.com.