Search in sources :

Example 1 with TextIndex

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);
}
Also used : TextIndex(com.cloudant.client.api.query.TextIndex) Test(org.junit.jupiter.api.Test)

Example 2 with TextIndex

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);
}
Also used : TextIndex(com.cloudant.client.api.query.TextIndex) Test(org.junit.jupiter.api.Test)

Example 3 with TextIndex

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));
}
Also used : TextIndex(com.cloudant.client.api.query.TextIndex) Test(org.junit.jupiter.api.Test)

Example 4 with TextIndex

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}");
}
Also used : TextIndex(com.cloudant.client.api.query.TextIndex) Test(org.junit.jupiter.api.Test)

Aggregations

TextIndex (com.cloudant.client.api.query.TextIndex)4 Test (org.junit.jupiter.api.Test)4