use of io.zulia.client.command.GetTerms in project zuliasearch by zuliaio.
the class AliasTest method aliasSearchTest.
@Test
@Order(3)
public void aliasSearchTest() throws Exception {
Search search = new Search(ALIAS_TEST_INDEX);
SearchResult searchResult = zuliaWorkPool.search(search);
Assertions.assertEquals(repeatCount * 2 * uniqueDocs, searchResult.getTotalHits());
search = new Search("someAlias");
searchResult = zuliaWorkPool.search(search);
Assertions.assertEquals(repeatCount * 2 * uniqueDocs, searchResult.getTotalHits());
search = new Search(ALIAS_TEST_INDEX);
search.addQuery(new ScoredQuery("rating:[4.0 TO *]"));
searchResult = zuliaWorkPool.search(search);
Assertions.assertEquals(repeatCount * 2 * 3, searchResult.getTotalHits());
search = new Search("someAlias");
search.addQuery(new ScoredQuery("rating:[4.0 TO *]"));
searchResult = zuliaWorkPool.search(search);
Assertions.assertEquals(repeatCount * 2 * 3, searchResult.getTotalHits());
GetNumberOfDocsResult numberOfDocs = zuliaWorkPool.getNumberOfDocs("someAlias");
Assertions.assertEquals(repeatCount * 2 * uniqueDocs, numberOfDocs.getNumberOfDocs());
GetFieldsResult getFields = zuliaWorkPool.getFields("someAlias");
Assertions.assertEquals(3, getFields.getFieldNames().size());
GetTermsResult getTermsResult = zuliaWorkPool.execute(new GetTerms("someAlias", "title"));
Assertions.assertEquals(6, getTermsResult.getTerms().size());
GetIndexesResult indexes = zuliaWorkPool.getIndexes();
Assertions.assertEquals(1, indexes.getIndexNames().size());
GetNodesResult nodes = zuliaWorkPool.getNodes();
Assertions.assertEquals(1, nodes.getIndexAliases().size());
FetchResult fetch = zuliaWorkPool.fetch(new Fetch("1", "someAlias"));
Assertions.assertEquals("1", fetch.getDocument().getString("id"));
GetIndexConfigResult indexConfig = zuliaWorkPool.getIndexConfig("someAlias");
Assertions.assertEquals(indexConfig.getIndexConfig().getIndexName(), ALIAS_TEST_INDEX);
}
Aggregations