You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "WangFeiCheng (Jira)" <ji...@apache.org> on 2020/11/14 07:44:00 UTC

[jira] [Updated] (LUCENE-9609) When the term of more than 16, highlight the query does not return

     [ https://issues.apache.org/jira/browse/LUCENE-9609?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

WangFeiCheng updated LUCENE-9609:
---------------------------------
    Description:     (was: 我注意到,当术语过多时,突出显示的查询受到限制

我知道在TermInSetQuery中,当词条较少时,请使用BOOLEAN_REWRITE_TERM_COUNT_THRESHOLD = 16来提高查询效率
{code:java}
静态最终整数BOOLEAN_REWRITE_TERM_COUNT_THRESHOLD = 16;

公共查询重写(IndexReader阅读器)引发IOException {
    最终int阈值= Math.min(BOOLEAN_REWRITE_TERM_COUNT_THRESHOLD,BooleanQuery.getMaxClauseCount());
    如果(termData.size()<=阈值){
      BooleanQuery.Builder bq =新的BooleanQuery.Builder();
      TermIterator迭代器= termData.iterator();
      for(BytesRef term = iterator.next(); term!= null; term = iterator.next()){
        bq.add(new TermQuery(new Term(iterator.field(),BytesRef.deepCopyOf(term))),Occur.SHOULD);
      }
      返回新的ConstantScoreQuery(bq.build());
    }
    返回super.rewrite(reader);
  }
{code}
但是,在extractTerms中使用TermInSetQuery方法时,查询条件的重点超过16个

 
{code:java}
@Override
public void extractTerms(Set <Term>术语){
    //无操作
    //此查询用于术语数量过多而无法使用的滥用情况
    //作为BooleanQuery有效运行。因此,我们同样将其术语隐藏在
    //为了保护荧光笔
}
{code}
我想问一下,为什么要说“所以同样,我们为了保护荧光笔而隐藏了它的术语”

为什么这个阈值可以保护重点,以及如何实现这种“保护”?

 

 )

> When the term of more than 16, highlight the query does not return
> ------------------------------------------------------------------
>
>                 Key: LUCENE-9609
>                 URL: https://issues.apache.org/jira/browse/LUCENE-9609
>             Project: Lucene - Core
>          Issue Type: Wish
>          Components: core/search
>    Affects Versions: 7.7.3
>            Reporter: WangFeiCheng
>            Priority: Minor
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org