On Tue, Oct 15, 2013 at 10:57 AM, Michael McCandless <luc...@mikemccandless.com> wrote: > On Tue, Oct 15, 2013 at 10:11 AM, Robert Muir <rcm...@gmail.com> wrote: >> On Tue, Oct 15, 2013 at 9:59 AM, Michael McCandless >> <luc...@mikemccandless.com> wrote: >>> Well, unfortunately, this is a trap that users do hit. >>> >>> By requiring the user to think about the limit on creating >>> PostingsHighlighter, he/she would think about it and realize they are >>> in fact setting a limit. >>> >>> Silent limits are dangerous because you don't offhand know what's >>> wrong / why you see nothing getting highlighted. >>> >>> >> >> I already made my argument: for 99% of use cases the defaults are >> fine. In most cases highlighting is trying to summarize the document >> and something that deep just doesnt contribute much (see the default >> scoring model!). There is an optional ctor for the others doing expert >> things to specify the length. >> >> I don't think we should make APIs unusable because you think XYZ is a trap. > > How would this make the APIs unusable? > > I don't think requiring the user to set the truncation (a single int > parameter) up front is "unusable"? > > Instead, it's making it clear that this class silently discards tokens > from the document, which I think is dangerous for any class to > silently do. The user needs to think about what to pass, and realize > what they pass means truncation is happening.
Its a summarizer: its whole purpose is to truncate the document :) --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org