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


Java CombineFunction.MULTIPLY属性代码示例

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


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

示例1: AbstractDistanceScoreFunction

public AbstractDistanceScoreFunction(double userSuppiedScale, double decay, double offset, DecayFunction func,
        MultiValueMode mode) {
    super(CombineFunction.MULTIPLY);
    this.mode = mode;
    if (userSuppiedScale <= 0.0) {
        throw new IllegalArgumentException(FunctionScoreQueryBuilder.NAME + " : scale must be > 0.0.");
    }
    if (decay <= 0.0 || decay >= 1.0) {
        throw new IllegalArgumentException(FunctionScoreQueryBuilder.NAME + " : decay must be in the range [0..1].");
    }
    this.scale = func.processScale(userSuppiedScale, decay);
    this.func = func;
    if (offset < 0.0d) {
        throw new IllegalArgumentException(FunctionScoreQueryBuilder.NAME + " : offset must be > 0.0");
    }
    this.offset = offset;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:DecayFunctionBuilder.java

示例2: testTwoPhaseMinScore

public void testTwoPhaseMinScore() throws Exception {
    Term term = randomTerm();
    Query query = new TermQuery(term);
    Float minScore = random().nextFloat();

    FunctionScoreQuery fsq1 = new FunctionScoreQuery(query, null, minScore, null, Float.POSITIVE_INFINITY);
    FunctionScoreQuery fsq2 = new FunctionScoreQuery(new RandomApproximationQuery(query, random()), null, minScore, null,
            Float.POSITIVE_INFINITY);
    assertSameScores(fsq1, fsq2);

    FiltersFunctionScoreQuery ffsq1 = new FiltersFunctionScoreQuery(query, ScoreMode.SUM, new FilterFunction[0],
            Float.POSITIVE_INFINITY, minScore, CombineFunction.MULTIPLY);
    FiltersFunctionScoreQuery ffsq2 = new FiltersFunctionScoreQuery(query, ScoreMode.SUM, new FilterFunction[0],
            Float.POSITIVE_INFINITY, minScore, CombineFunction.MULTIPLY);
    assertSameScores(ffsq1, ffsq2);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:16,代码来源:FunctionScoreEquivalenceTests.java

示例3: testMinScoreAllIncluded

public void testMinScoreAllIncluded() throws Exception {
    Term term = randomTerm();
    Query query = new TermQuery(term);

    FunctionScoreQuery fsq = new FunctionScoreQuery(query, null, 0f, null, Float.POSITIVE_INFINITY);
    assertSameScores(query, fsq);

    FiltersFunctionScoreQuery ffsq = new FiltersFunctionScoreQuery(query, ScoreMode.SUM, new FilterFunction[0], Float.POSITIVE_INFINITY,
            0f, CombineFunction.MULTIPLY);
    assertSameScores(query, ffsq);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:FunctionScoreEquivalenceTests.java

示例4: testMinScoreAllExcluded

public void testMinScoreAllExcluded() throws Exception {
    Term term = randomTerm();
    Query query = new TermQuery(term);

    FunctionScoreQuery fsq = new FunctionScoreQuery(query, null, Float.POSITIVE_INFINITY, null, Float.POSITIVE_INFINITY);
    assertSameScores(new MatchNoDocsQuery(), fsq);

    FiltersFunctionScoreQuery ffsq = new FiltersFunctionScoreQuery(query, ScoreMode.SUM, new FilterFunction[0], Float.POSITIVE_INFINITY,
            Float.POSITIVE_INFINITY, CombineFunction.MULTIPLY);
    assertSameScores(new MatchNoDocsQuery(), ffsq);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:FunctionScoreEquivalenceTests.java

示例5: testWeightOnlyCreatesBoostFunction

public void testWeightOnlyCreatesBoostFunction() throws IOException {
    FunctionScoreQuery filtersFunctionScoreQueryWithWeights = new FunctionScoreQuery(new MatchAllDocsQuery(),
            new WeightFactorFunction(2), 0.0f, CombineFunction.MULTIPLY, 100);
    TopDocs topDocsWithWeights = searcher.search(filtersFunctionScoreQueryWithWeights, 1);
    float score = topDocsWithWeights.scoreDocs[0].score;
    assertThat(score, equalTo(2.0f));
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:FunctionScoreTests.java

示例6: buildFunctionScore

public Query buildFunctionScore() {
    return new FunctionScoreQuery(new MatchAllDocsQuery(),
            new FieldValueFactorFunction("score", FACTOR, LN2P, 0D,
                    new SortedNumericDVIndexFieldData(new Index("test", "123"),
                            "score", FLOAT)), 0F, CombineFunction.MULTIPLY, Float.MAX_VALUE);
}
 
开发者ID:o19s,项目名称:elasticsearch-learning-to-rank,代码行数:6,代码来源:LoggingFetchSubPhaseTests.java


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