Search in sources :

Example 11 with SearchQueryInputDataset

use of org.opensearch.ml.common.dataset.SearchQueryInputDataset in project ml-commons by opensearch-project.

the class IntegTestUtils method generateEmptyDataset.

// Generate empty testing dataset.
public static MLInputDataset generateEmptyDataset() {
    SearchSourceBuilder searchSourceBuilder = generateSearchSourceBuilder();
    searchSourceBuilder.query(QueryBuilders.matchQuery("noSuchName", ""));
    return new SearchQueryInputDataset(Collections.singletonList(TESTING_INDEX_NAME), searchSourceBuilder);
}
Also used : SearchQueryInputDataset(org.opensearch.ml.common.dataset.SearchQueryInputDataset) SearchSourceBuilder(org.opensearch.search.builder.SearchSourceBuilder)

Aggregations

SearchQueryInputDataset (org.opensearch.ml.common.dataset.SearchQueryInputDataset)11 SearchSourceBuilder (org.opensearch.search.builder.SearchSourceBuilder)8 MLInputDataset (org.opensearch.ml.common.dataset.MLInputDataset)5 IntegTestUtils.generateSearchSourceBuilder (org.opensearch.ml.utils.IntegTestUtils.generateSearchSourceBuilder)4 ActionListener (org.opensearch.action.ActionListener)3 SearchHits (org.opensearch.search.SearchHits)3 TotalHits (org.apache.lucene.search.TotalHits)2 SearchRequest (org.opensearch.action.search.SearchRequest)2 SearchResponse (org.opensearch.action.search.SearchResponse)2 DataFrame (org.opensearch.ml.common.dataframe.DataFrame)2 MLInput (org.opensearch.ml.common.parameter.MLInput)2 SearchHit (org.opensearch.search.SearchHit)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Locale (java.util.Locale)1 Map (java.util.Map)1 IntConsumer (java.util.function.IntConsumer)1 AccessLevel (lombok.AccessLevel)1