lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Twaddell <>
Subject How to request multiple snippet lengths
Date Mon, 05 Nov 2012 12:41:43 GMT

I am trying to find a way to request multiple snippets of different lengths
for a single field. I know that this could be accomplished by issuing two
separate queries or duplicating the field, but I want to avoid doubling the
query load or index size. I'd also rather not resort to writing a custom
snippet generator.

I am using Solr 4.0 and I thought perhaps the new field aliasing feature
would be an ideal solution. However it appears that the highlighting
component doesn't understand this new syntax. For instance the following
request would ideally return two highlighted snippets: a short snippet and
the full field:


This results in something like the following:

    "snippet":["<em>foo</em> bar baz"]},

>From this I gather that the highlighter looks for the field named
"snip:content" and fails. I tried a number of variations with the field
alias specified in the fl, qf and f.myalias.qf params, but to no avail.
I've been pouring over JIRA issues, patches and source code but I can't
determine what the proper syntax should be.

Does anyone have an ideas on how to go about this?


"Where there is love, nothing is too much trouble and there is always
time." ~ ‘Abdu’l-Bahá

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message