[ 
https://issues.apache.org/jira/browse/LUCENE-7397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15396812#comment-15396812
 ] 

donghyun Kim commented on LUCENE-7397:
--------------------------------------

I think it's better to reuse read termVector when each document x many 
highlight field search.

eg) 
1. each document indexed as many fields.
2. search for document.
3. I want get highlight fragments for many docs each. 
for each doc that searched
    for each field that I want to get highlight fragment
        4. I may call [getBestFragments] method that takes IndexReader, docId.
        5. execute [final Fields vectors = reader.getTermVectors(docId);]. and 
I think It's possibly slow depends on size of termVector
 
we may read termvector once per doc highlight process outer elsewhere and pass 
(Fields Object) as param I think.
overloading the method possibly can solve my problem.

my scenario is :
for each doc that searched
    execute [final Fields vectors = reader.getTermVectors(docId);]. and I think 
It's possibly slow depends on size of 
    for each field that I want to get highlight fragment
          I may call [getBestFragments] method that takes IndexReader, docId, 
(Fields vectors).

Any reason to reader.getTermVectors(docId) must located inside each 
getBestFragment?


> Inefficient FVhighlighting when set many HighlightedField.
> ----------------------------------------------------------
>
>                 Key: LUCENE-7397
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7397
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/highlighter
>         Environment: CentOS release 6.4 (Final)
> quad core 1.87
> 8gb memory
> tested Elasticsearch - 1.5 with lucene 4.10.4 
> But i see mirrored Master version in github 
> https://github.com/apache/lucene-solr
>            Reporter: donghyun Kim
>            Priority: Minor
>
> when highlighting, search result 
> org.apache.lucene.search.vectorhighlight.FastVectorHighlighter.java
> getBestFragment method ~ FieldTermStack.java read whole doc's termvector 
> every highlighted field.
> It causes slow query when many highlight field



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to