Mike Klaas wrote:
Highlighting has definately grown to the point where it should be in
its own class, and I could see the justification for giving it its own
package, given there there are now at least three supporting classes
for Solr, and this could easily grow.
I was a bit nervous about doing anything as radical as repackaging, as I don't really have
a good grasp for how Solr fits together yet.
It isn't worth supporting formatterClass without making it more
general. I'd like to see an extension which allows the specification
of a class and an array of constructor args.
ex.
<class name="formatter"
classname="org.apache.lucene.search.highlighting.SimpleHTMLFormatter"
/>
<class name="formatter"
classname="org.apache.lucene.search.highlighting.SimpleHTMLFormatter">
<arr>
<str><strong></str>
<str>&tl;/string></str>
<arr>
</class>
Sounds like a good idea. Do you think there's still value in being able to choose between
simple/gradient with defined properties for the arguments? Unless someone wants to use a
custom formatter that's going to be easier to configure without consulting the javadoc for
those formatters (although I'm not sure I understand the Gradient formatter as it just
seems to put out the same background colour for everything - which may be a bug or
misunderstanding in what I've done).
I'm not sure I properly understand how Fragmenters work, so supplying
fragsize to GapFragmenter where >0 (instead of what was a default of
50) may not make sense.
Passing to the constructor makes sense, as it sets the fragmentSize of
the base SimpleFragmenter class (note the default is 100; 50 is the
position gap which indicates when to start a new fragment).
OK - I did mess this up then! Do you think the incrementThreshold in GapFragmenter (which
is what I was actually setting) is something that needs to be configurable as well?
-Andrew