Description
CachingTokenFilter could use a simple boolean isCached() method implemented as-such:
/** If the underlying token stream was consumed and cached */ public boolean isCached() { return cache != null; }
It's useful for the highlighting code to remove its wrapping of CachingTokenFilter if after handing-off to parts of its framework it turns out that it wasn't used.
Furthermore, use an ArrayList, not a LinkedList. ArrayList is leaner when the token count is high, and this class doesn't manipulate the list in a way that might favor LL.
A separate patch will come that actually uses this method.
Attachments
Attachments
Issue Links
- duplicates
-
LUCENE-5861 CachingTokenFilter should use ArrayList not LinkedList
- Closed
- is related to
-
LUCENE-6121 Fix CachingTokenFilter to propagate reset() the first time
- Closed
- is required by
-
SOLR-6680 DefaultSolrHighlighter can sometimes avoid CachingTokenFilter
- Closed
- relates to
-
LUCENE-937 Make CachingTokenFilter faster
- Closed