Why not use Object like the patch on
LUCENE-4906 and try to get some consistency:
I can easily see this becoming hell because different expert users want different things.
It might work for your particular case to have String text + boolean, but other people might want to know crazy things like:
- score for the passage
- which multi-valued field instance they hit
- position or something of the passage within the doc
In general I also think its really bad to add additional classes that users must learn (the previous api here is "string", which everyone already knows).
anyway i dont care too much for this class, but I'd hate for us to make this mistake over on
LUCENE-4906. I feel like the other highlighters already introduce way too many new classes (besides already known simple ones like IndexSearcher,TopDocs,String, etc) and it makes them difficult to use.