當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。