On Fri, Dec 19, 2008 at 8:44 PM, David Bowen <davidlbo...@gmail.com> wrote: > We have two text fields, one for author names, and the other for the body of > the document. It often happens that the author names also appear in the > body of the document. We turned off stemming for the author field to avoid > unexpected matches when searching by author. > > Now, suppose we have an author named "Joe Bloggs" whose name appears in both > the fields. If the user searches for him by author, we get correct > highlighting in the author field, but only "Joe" and not "Bloggs" is > highlighted in the main body field. Conversely, if the user searches for > "Joe Bloggs" in the main body field, the highlighting is correct in that > field but this time only "Joe" is highlighted in the author field. > > Any suggestions on how we could make this work as we expected (name properly > highlighted in both fields)? Is it a bug that the query isn't re-tokenized > when highlighting a field that has different tokenization specified than was > used for the search?
That's not the problem (or at least it's not a general problem). I just tried this with the example (and latest dev version of Solr) using the "cat" field (unstemmed) and the "features" field (stemmed), and both were highlighted at the same time as expected. I even put in "Joe Bloggs", verified that it was searching for "Bloggs" in the cat field and "blogg" in the features field. -Yonik