use of com.cloudant.client.api.query.TextIndex in project java-cloudant by cloudant.
the class IndexListTests method listSimpleTextIndex.
@Test
public void listSimpleTextIndex() throws Exception {
enqueueList(TEXT_SIMPLE);
List<TextIndex> indexes = db.listIndexes().textIndexes();
assertEquals(1, indexes.size(), "There should be 1 text index");
TextIndex simple = indexes.get(0);
assertSimpleText(simple);
}
use of com.cloudant.client.api.query.TextIndex in project java-cloudant by cloudant.
the class IndexListTests method listComplexTextIndex.
@Test
public void listComplexTextIndex() throws Exception {
enqueueList(TEXT_COMPLEX);
List<TextIndex> indexes = db.listIndexes().textIndexes();
assertEquals(1, indexes.size(), "There should be 1 text index");
TextIndex complex = indexes.get(0);
assertComplexText(complex);
}
use of com.cloudant.client.api.query.TextIndex in project java-cloudant by cloudant.
the class IndexListTests method listSimpleTextIndexWithSelector.
/**
* Note this checks deserialization of the old "selector" field instead of
* partial_filter_selector
*
* @throws Exception
*/
@Test
public void listSimpleTextIndexWithSelector() throws Exception {
enqueueList(TEXT_SIMPLE_SELECTOR);
List<TextIndex> indexes = db.listIndexes().textIndexes();
assertEquals(1, indexes.size(), "There should be 1 text index");
TextIndex simple = indexes.get(0);
assertTextIndex(simple, "simpleselector", SELECTOR_STRING, "\"keyword\"", "{}", Collections.singletonMap("Movie_name", Type.STRING));
}
use of com.cloudant.client.api.query.TextIndex in project java-cloudant by cloudant.
the class IndexListTests method listMultipleTextIndexes.
@Test
public void listMultipleTextIndexes() throws Exception {
enqueueList(TEXT_SIMPLE, TEXT_COMPLEX, TEXT_ALL_FIELDS);
List<TextIndex> indexes = db.listIndexes().textIndexes();
assertEquals(3, indexes.size(), "There should be 3 text indexes");
TextIndex simple = indexes.get(0);
assertSimpleText(simple);
TextIndex complex = indexes.get(1);
assertComplexText(complex);
// Assert the all text index
TextIndex all = indexes.get(2);
assertTextIndex(all, "textallfields", null, "\"keyword\"", "{\"enabled\":false}");
}