Hi,
I've been trying out the highlighting added to Solr recently (thanks - it's really
useful), and I found myself wanting to highlight entire fields rather than just generating
fragments. i.e. I want to use the Lucene NullFragmenter rather than the default GapFragmenter.
I've made some changes locally to support custom fragmenters in the same way that custom
formatters are supported (i.e. either configured in solrconfig.xml or a parameter in the
request).
Before I submit a patch, I wanted to check a few things:
In CommonParams, the variables added for highlighting were declared static (unlike the
existing variables for the field list etc.). I made these non-static and everything still
compiles. Is that OK?
In SolrPluginUtils I added "getHighlighter(Query query, SolrQueryRequest request,
CommonParams params)". The idea was to move all the parameter checking into this method
instead of having it in doStandardHighlighting(), and have this as the single place
highlighters are generated.
However, I didn't remove getDefaultHighlighter(Query query) because this is used by
getHighlights(DocList docs, String[] fieldNames, Query query, SolrIndexSearcher searcher,
int numFragments), which doesn't have access to the SolrQueryRequest or CommonParams. I
can't see anywhere this getHighlights method is used, but I didn't want to remove it.
In SolrPluginUtils I did an Eclipse "organise imports" (force of habit). This has
re-arranged and shortened the list of imports considerably (there were some unused
imports, and also I've got Eclipse configured to use * if there is more than 1 import from
a package).
Basically I have a really hard time not fiddling with other people's code - it annoys the
hell out of some of my colleagues.
So, should I submit the patch as is (via JIRA I assume?), or should I change it to make
the minimal number of changes from the original classes?
Regards,
Andrew