当前位置: 首页>>代码示例>>Java>>正文


Java Occur.MUST_NOT属性代码示例

本文整理汇总了Java中org.apache.lucene.search.BooleanClause.Occur.MUST_NOT属性的典型用法代码示例。如果您正苦于以下问题:Java Occur.MUST_NOT属性的具体用法?Java Occur.MUST_NOT怎么用?Java Occur.MUST_NOT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.lucene.search.BooleanClause.Occur的用法示例。


在下文中一共展示了Occur.MUST_NOT属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: _queryClauseJoinFor

private static Occur _queryClauseJoinFor(final QueryClauseOccur occur) {
	Occur outOccur = null;
	switch(occur) {
	case MUST:
		outOccur = Occur.MUST;
		break;
	case MUST_NOT:
		outOccur = Occur.MUST_NOT;
		break;
	case SHOULD:
		outOccur = Occur.SHOULD;
		break;
	default:
		throw new IllegalArgumentException();
	}
	return outOccur;
}
 
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:17,代码来源:LuceneSearchQuery.java

示例2: extractTerms

@Override
public void extractTerms(Set<Term> terms) {
  for (BooleanClause clause : clauses) {
    if (clause.getOccur() != Occur.MUST_NOT) {
      clause.getQuery().extractTerms(terms);
    }
  }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:BooleanQuery.java

示例3: CommonTermsQuery

/**
 * Creates a new {@link CommonTermsQuery}
 * 
 * @param highFreqOccur
 *          {@link Occur} used for high frequency terms
 * @param lowFreqOccur
 *          {@link Occur} used for low frequency terms
 * @param maxTermFrequency
 *          a value in [0..1) (or absolute number >=1) representing the
 *          maximum threshold of a terms document frequency to be considered a
 *          low frequency term.
 * @param disableCoord
 *          disables {@link Similarity#coord(int,int)} in scoring for the low
 *          / high frequency sub-queries
 * @throws IllegalArgumentException
 *           if {@link Occur#MUST_NOT} is pass as lowFreqOccur or
 *           highFreqOccur
 */
public CommonTermsQuery(Occur highFreqOccur, Occur lowFreqOccur,
    float maxTermFrequency, boolean disableCoord) {
  if (highFreqOccur == Occur.MUST_NOT) {
    throw new IllegalArgumentException(
        "highFreqOccur should be MUST or SHOULD but was MUST_NOT");
  }
  if (lowFreqOccur == Occur.MUST_NOT) {
    throw new IllegalArgumentException(
        "lowFreqOccur should be MUST or SHOULD but was MUST_NOT");
  }
  this.disableCoord = disableCoord;
  this.highFreqOccur = highFreqOccur;
  this.lowFreqOccur = lowFreqOccur;
  this.maxTermFrequency = maxTermFrequency;
}
 
开发者ID:europeana,项目名称:search,代码行数:33,代码来源:CommonTermsQuery.java

示例4: mustNot

public WebDSLFacet mustNot(){
    occur = Occur.MUST_NOT;
    return this;
}
 
开发者ID:webdsl,项目名称:webdsl,代码行数:4,代码来源:WebDSLFacet.java

示例5: toOccur

public static Occur toOccur(boolean required, boolean prohibited) {
	if(required && !prohibited)		return Occur.MUST;
	if(!required && !prohibited)	return Occur.SHOULD;
	if(!required && prohibited)		return Occur.MUST_NOT;
	throw new RuntimeException("invalid Occur definition (required and prohibited)");
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:6,代码来源:OccurUtil.java


注:本文中的org.apache.lucene.search.BooleanClause.Occur.MUST_NOT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。