Hi , That should be fairly easy to make in alternateField() in DefaultSolrHighlighter. We made a small change there to support globs in alternateField.
Cheers, -----Original message----- > From:Jan Høydahl <jan....@cominvent.com> > Sent: Wed 09-Jan-2013 12:44 > To: solr-user@lucene.apache.org > Subject: Highlighting: When alternateField does not exist > > Hi, > > The alternateField and maxAlternateFieldLength params work well, but only as > long as the alternate field actually exists for the document. If it does not, > highlighting returns nothing. > > We would like this behavior > 1. Highlighting in "body" if matches > 2. Fallback to verbatim "teaser" if it exists > 3. If fallback field does not exist, look for a secondary fallback field > > To support this behaviour in a back-compat way, how about allowing a > comma-separated list of alternate fields to consider: > hl.alternateField=field1,field2,field3.. where the first existing one is > selected > > Or do you have other workarounds for this problem on the solr side? In this > case we cannot control the source DB to make sure the "teaser" exists. > > -- > Jan Høydahl, search solution architect > Cominvent AS - www.cominvent.com > Solr Training - www.solrtraining.com > >