In 0.90.9 the order in which fields would be highlighted would be field1,
field2, field3, field4, etc. In 1.2.1 it's arbitrary. I believe the cause
is the use of a HashMap vs using a LinkedHashMap in the constructor
of SearchContextHighlighter.java causing the insertion order to be lost.
The reason why I want order preserved is that I have a custom wrapping
highlighter to FVH that highlights only the first n fields (the ones most
likely to have hihglighting) and will only continue highlighting the
remaining fields (potentially hundreds) if no highlighting happened for the
initial set of fields. Doing this allows searches to execute very quickly
on average and only occasionally taking the hit of attempting to highlight
everything resulting in a 8-10x faster query on average.
In 0.90.9 the order in which fields would be highlighted would be field1,
field2, field3, field4, etc. In 1.2.1 it's arbitrary. I believe the cause
is the use of a HashMap vs using a LinkedHashMap in the constructor
of SearchContextHighlighter.java causing the insertion order to be lost.
The reason why I want order preserved is that I have a custom wrapping
highlighter to FVH that highlights only the first n fields (the ones most
likely to have hihglighting) and will only continue highlighting the
remaining fields (potentially hundreds) if no highlighting happened for the
initial set of fields. Doing this allows searches to execute very quickly
on average and only occasionally taking the hit of attempting to highlight
everything resulting in a 8-10x faster query on average.
In 0.90.9 the order in which fields would be highlighted would be field1,
field2, field3, field4, etc. In 1.2.1 it's arbitrary. I believe the cause
is the use of a HashMap vs using a LinkedHashMap in the constructor
of SearchContextHighlighter.java causing the insertion order to be lost.
The reason why I want order preserved is that I have a custom wrapping
highlighter to FVH that highlights only the first n fields (the ones most
likely to have hihglighting) and will only continue highlighting the
remaining fields (potentially hundreds) if no highlighting happened for the
initial set of fields. Doing this allows searches to execute very quickly
on average and only occasionally taking the hit of attempting to highlight
everything resulting in a 8-10x faster query on average.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.