On 6/6/07, Frédéric Glorieux <[EMAIL PROTECTED]> wrote:
Tests are going very well with sorl. I'm working for an academic
project, with not a lot of users, but with high demands, this will
explain the background of my question. For linguistic activities,
searching is a goal by itself, retrieving a document may be second.
That's why it's common to serve thousands of "highlighted snippets" from
results (in solr terms), like a "concordancer".
In such cases, it seems memory expensive to prepare really big snippets
lists from StandardRequestHandler. I'm beginning to make it work from a
ResponseWriter (thanks for all needed code already in
HighlightingUtils), so that snippets are directly written to the
response, without storing.
Before working too much on this code, is it good practice ? Did I miss
an important reason ?
Simplicity. The memory usage for highlight fields in normal responses
is not an issue.
If it becomes an issue for you, then you're roughly taking the right approach.
However, rather than write your own response writer to solve your
issue, you might consider
just your own response handler, and insert an Iterable (which will be
written as an array in the response writer). This way, all response
writers (xml, json, etc) will work.
-Yonik