All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.elasticsearch.search.retriever.TestCompoundRetrieverBuilder Maven / Gradle / Ivy

There is a newer version: 9.0.2
Show newest version
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the "Elastic License
 * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
 * Public License v 1"; you may not use this file except in compliance with, at
 * your election, the "Elastic License 2.0", the "GNU Affero General Public
 * License v3.0 only", or the "Server Side Public License, v 1".
 */

package org.elasticsearch.search.retriever;

import org.apache.lucene.search.ScoreDoc;
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.search.rank.RankDoc;
import org.elasticsearch.xcontent.XContentBuilder;

import java.io.IOException;
import java.net.UnknownServiceException;
import java.util.ArrayList;
import java.util.List;

public class TestCompoundRetrieverBuilder extends CompoundRetrieverBuilder {

    public static final String NAME = "test_compound_retriever_builder";

    public TestCompoundRetrieverBuilder(int rankWindowSize) {
        this(new ArrayList<>(), rankWindowSize, new ArrayList<>());
    }

    TestCompoundRetrieverBuilder(List childRetrievers, int rankWindowSize, List preFilterQueryBuilders) {
        super(childRetrievers, rankWindowSize);
        this.preFilterQueryBuilders = preFilterQueryBuilders;
    }

    @Override
    protected TestCompoundRetrieverBuilder clone(List newChildRetrievers, List newPreFilterQueryBuilders) {
        return new TestCompoundRetrieverBuilder(newChildRetrievers, rankWindowSize, newPreFilterQueryBuilders);
    }

    @Override
    protected RankDoc[] combineInnerRetrieverResults(List rankResults, boolean explain) {
        return new RankDoc[0];
    }

    @Override
    public String getName() {
        return NAME;
    }

    @Override
    protected void doToXContent(XContentBuilder builder, Params params) throws IOException {
        throw new UnknownServiceException("should not be called");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy