use of io.zulia.client.config.ClientIndexConfig in project zuliasearch by zuliaio.
the class StartStopTest method initAll.
@BeforeAll
public static void initAll() throws Exception {
TestHelper.createNodes(3);
TestHelper.startNodes();
Thread.sleep(2000);
zuliaWorkPool = TestHelper.createClient();
ClientIndexConfig indexConfig = new ClientIndexConfig();
indexConfig.addDefaultSearchField("title");
indexConfig.addFieldConfig(FieldConfigBuilder.create("id", FieldType.STRING).indexAs(DefaultAnalyzers.LC_KEYWORD).sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("title", FieldType.STRING).indexAs(DefaultAnalyzers.STANDARD).sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("issn", FieldType.STRING).indexAs(DefaultAnalyzers.LC_KEYWORD).facet().sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("eissn", FieldType.STRING).indexAs(DefaultAnalyzers.LC_KEYWORD));
indexConfig.addFieldConfig(FieldConfigBuilder.create("uid", FieldType.STRING).indexAs(DefaultAnalyzers.LC_KEYWORD));
indexConfig.addFieldConfig(FieldConfigBuilder.create("an", FieldType.NUMERIC_INT).index().sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("country", FieldType.STRING).indexAs(DefaultAnalyzers.LC_KEYWORD).facet());
indexConfig.addFieldConfig(FieldConfigBuilder.create("date", FieldType.DATE).index().facetAs(DateHandling.DATE_YYYY_MM_DD).sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("testList", FieldType.STRING).index());
indexConfig.addFieldConfig(FieldConfigBuilder.create("testBool", FieldType.BOOL).index().facet().sort());
indexConfig.setIndexName(FACET_TEST_INDEX);
indexConfig.setNumberOfShards(1);
// force some commits
indexConfig.setShardCommitInterval(20);
zuliaWorkPool.createIndex(indexConfig);
}
use of io.zulia.client.config.ClientIndexConfig in project zuliasearch by zuliaio.
the class StatTest method reindex.
@Test
@Order(4)
public void reindex() throws Exception {
ClientIndexConfig indexConfig = new ClientIndexConfig();
indexConfig.addDefaultSearchField("title");
indexConfig.addFieldConfig(FieldConfigBuilder.create("id", FieldType.STRING).indexAs(DefaultAnalyzers.LC_KEYWORD).sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("title", FieldType.STRING).indexAs(DefaultAnalyzers.STANDARD).sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("pathFacet", FieldType.STRING).indexAs(DefaultAnalyzers.LC_KEYWORD).facetHierarchical().sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("normalFacet", FieldType.STRING).indexAs(DefaultAnalyzers.LC_KEYWORD).facet().sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("authorCount", FieldType.NUMERIC_INT).index().sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("rating", FieldType.NUMERIC_DOUBLE).index().sort());
indexConfig.setIndexName(STAT_TEST_INDEX);
indexConfig.setNumberOfShards(1);
// force some commits
indexConfig.setShardCommitInterval(20);
zuliaWorkPool.createIndex(indexConfig);
// trigger indexing again with path2 added in the index config
index();
}
use of io.zulia.client.config.ClientIndexConfig in project zuliasearch by zuliaio.
the class StatTest method initAll.
@BeforeAll
public static void initAll() throws Exception {
TestHelper.createNodes(3);
TestHelper.startNodes();
Thread.sleep(2000);
zuliaWorkPool = TestHelper.createClient();
ClientIndexConfig indexConfig = new ClientIndexConfig();
indexConfig.addDefaultSearchField("title");
indexConfig.addFieldConfig(FieldConfigBuilder.create("id", FieldType.STRING).indexAs(DefaultAnalyzers.LC_KEYWORD).sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("title", FieldType.STRING).indexAs(DefaultAnalyzers.STANDARD).sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("pathFacet", FieldType.STRING).indexAs(DefaultAnalyzers.LC_KEYWORD).facetHierarchical().sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("normalFacet", FieldType.STRING).indexAs(DefaultAnalyzers.LC_KEYWORD).facet().sort());
// indexConfig.addFieldConfig(FieldConfigBuilder.create("authorCount", FieldType.NUMERIC_INT).index().sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("rating", FieldType.NUMERIC_DOUBLE).index().sort());
indexConfig.setIndexName(STAT_TEST_INDEX);
indexConfig.setNumberOfShards(1);
// force some commits
indexConfig.setShardCommitInterval(20);
zuliaWorkPool.createIndex(indexConfig);
}
use of io.zulia.client.config.ClientIndexConfig in project zuliasearch by zuliaio.
the class AliasTest method initAll.
@BeforeAll
public static void initAll() throws Exception {
TestHelper.createNodes(3);
TestHelper.startNodes();
Thread.sleep(2000);
zuliaWorkPool = TestHelper.createClient();
ClientIndexConfig indexConfig = new ClientIndexConfig();
indexConfig.addDefaultSearchField("title");
indexConfig.addFieldConfig(FieldConfigBuilder.create("id", FieldType.STRING).indexAs(DefaultAnalyzers.LC_KEYWORD).sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("title", FieldType.STRING).indexAs(DefaultAnalyzers.STANDARD).sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("rating", FieldType.NUMERIC_DOUBLE).index().sort());
indexConfig.setIndexName(ALIAS_TEST_INDEX);
indexConfig.setNumberOfShards(1);
// force some commits
indexConfig.setShardCommitInterval(20);
zuliaWorkPool.createIndex(indexConfig);
}
use of io.zulia.client.config.ClientIndexConfig in project zuliasearch by zuliaio.
the class HierarchicalFacetTest method reindex.
@Test
@Order(4)
public void reindex() throws Exception {
ClientIndexConfig indexConfig = new ClientIndexConfig();
indexConfig.addDefaultSearchField("title");
indexConfig.addFieldConfig(FieldConfigBuilder.create("id", FieldType.STRING).indexAs(DefaultAnalyzers.LC_KEYWORD).sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("title", FieldType.STRING).indexAs(DefaultAnalyzers.STANDARD).sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("path", FieldType.STRING).indexAs(DefaultAnalyzers.LC_KEYWORD).facetHierarchical().sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("path2", FieldType.STRING).indexAs(DefaultAnalyzers.LC_KEYWORD).facetHierarchical().sort());
indexConfig.addFieldConfig(FieldConfigBuilder.create("date", FieldType.DATE).index().facetHierarchical().sort());
indexConfig.setIndexName(FACET_TEST_INDEX);
indexConfig.setNumberOfShards(1);
// force some commits
indexConfig.setShardCommitInterval(20);
zuliaWorkPool.createIndex(indexConfig);
// trigger indexing again with path2 added in the index config
index();
}
Aggregations