very slow highlight performance in lucene

前端 未结 1 1032
广开言路
广开言路 2021-01-02 05:12

Lucene (4.6) highlighter has very slow performance, when a frequent term is searched. Search is fast (100ms), but highlight may take more than an hour(!).

Detail

相关标签:
1条回答
  • 2021-01-02 05:49

    BestFragments relies on the tokenization done by the analyzer that you're using. If you have to analyse such a big text, you'd better to store term vector WITH_POSITIONS_OFFSETS at indexing time.

    Please read this and this book

    By doing that, you won't need to analyze all the text at runtime as you can pick up a method to reuse the existing term vector and this will reduce the highlighting time.

    0 讨论(0)
提交回复
热议问题