Search in sources :

Example 1 with SearchModule

use of org.opensearch.search.SearchModule in project OpenSearch by opensearch-project.

the class ShardValidateQueryRequestTests method setUp.

public void setUp() throws Exception {
    super.setUp();
    IndicesModule indicesModule = new IndicesModule(Collections.emptyList());
    SearchModule searchModule = new SearchModule(Settings.EMPTY, Collections.emptyList());
    List<NamedWriteableRegistry.Entry> entries = new ArrayList<>();
    entries.addAll(indicesModule.getNamedWriteables());
    entries.addAll(searchModule.getNamedWriteables());
    namedWriteableRegistry = new NamedWriteableRegistry(entries);
}
Also used : NamedWriteableRegistry(org.opensearch.common.io.stream.NamedWriteableRegistry) IndicesModule(org.opensearch.indices.IndicesModule) ArrayList(java.util.ArrayList) SearchModule(org.opensearch.search.SearchModule)

Example 2 with SearchModule

use of org.opensearch.search.SearchModule in project OpenSearch by opensearch-project.

the class AggregatorFactoriesTests method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    Settings settings = Settings.builder().put("node.name", AbstractQueryTestCase.class.toString()).put(Environment.PATH_HOME_SETTING.getKey(), createTempDir()).build();
    xContentRegistry = new NamedXContentRegistry(new SearchModule(settings, emptyList()).getNamedXContents());
}
Also used : SearchModule(org.opensearch.search.SearchModule) NamedXContentRegistry(org.opensearch.common.xcontent.NamedXContentRegistry) Settings(org.opensearch.common.settings.Settings) AbstractQueryTestCase(org.opensearch.test.AbstractQueryTestCase)

Example 3 with SearchModule

use of org.opensearch.search.SearchModule in project OpenSearch by opensearch-project.

the class AggregatorFactoriesBuilderTests method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    // register aggregations as NamedWriteable
    SearchModule searchModule = new SearchModule(Settings.EMPTY, emptyList());
    namedWriteableRegistry = new NamedWriteableRegistry(searchModule.getNamedWriteables());
    namedXContentRegistry = new NamedXContentRegistry(searchModule.getNamedXContents());
}
Also used : NamedWriteableRegistry(org.opensearch.common.io.stream.NamedWriteableRegistry) SearchModule(org.opensearch.search.SearchModule) NamedXContentRegistry(org.opensearch.common.xcontent.NamedXContentRegistry) Before(org.junit.Before)

Example 4 with SearchModule

use of org.opensearch.search.SearchModule in project OpenSearch by opensearch-project.

the class CollapseBuilderTests method init.

@BeforeClass
public static void init() {
    SearchModule searchModule = new SearchModule(Settings.EMPTY, emptyList());
    namedWriteableRegistry = new NamedWriteableRegistry(searchModule.getNamedWriteables());
    xContentRegistry = new NamedXContentRegistry(searchModule.getNamedXContents());
}
Also used : NamedWriteableRegistry(org.opensearch.common.io.stream.NamedWriteableRegistry) SearchModule(org.opensearch.search.SearchModule) NamedXContentRegistry(org.opensearch.common.xcontent.NamedXContentRegistry) BeforeClass(org.junit.BeforeClass)

Example 5 with SearchModule

use of org.opensearch.search.SearchModule in project OpenSearch by opensearch-project.

the class HighlightBuilderTests method init.

/**
 * setup for the whole base test class
 */
@BeforeClass
public static void init() {
    SearchModule searchModule = new SearchModule(Settings.EMPTY, emptyList());
    namedWriteableRegistry = new NamedWriteableRegistry(searchModule.getNamedWriteables());
    xContentRegistry = new NamedXContentRegistry(searchModule.getNamedXContents());
}
Also used : NamedWriteableRegistry(org.opensearch.common.io.stream.NamedWriteableRegistry) SearchModule(org.opensearch.search.SearchModule) NamedXContentRegistry(org.opensearch.common.xcontent.NamedXContentRegistry) BeforeClass(org.junit.BeforeClass)

Aggregations

SearchModule (org.opensearch.search.SearchModule)23 NamedWriteableRegistry (org.opensearch.common.io.stream.NamedWriteableRegistry)17 NamedXContentRegistry (org.opensearch.common.xcontent.NamedXContentRegistry)14 BeforeClass (org.junit.BeforeClass)9 ArrayList (java.util.ArrayList)6 NamedWriteableAwareStreamInput (org.opensearch.common.io.stream.NamedWriteableAwareStreamInput)5 StreamInput (org.opensearch.common.io.stream.StreamInput)4 Test (org.junit.Test)3 Version (org.opensearch.Version)3 BytesStreamOutput (org.opensearch.common.io.stream.BytesStreamOutput)3 Settings (org.opensearch.common.settings.Settings)3 XContentBuilder (org.opensearch.common.xcontent.XContentBuilder)3 IndicesModule (org.opensearch.indices.IndicesModule)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 Before (org.junit.Before)2 InputStreamStreamInput (org.opensearch.common.io.stream.InputStreamStreamInput)2 XContentParser (org.opensearch.common.xcontent.XContentParser)2 SearchPlugin (org.opensearch.plugins.SearchPlugin)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 InputStream (java.io.InputStream)1