Search in sources :

Example 6 with Field

use of com.yelp.nrtsearch.server.grpc.Field in project nrtsearch by Yelp.

the class AnalyzerCreatorTest method testHasAnalyzerAnalyzerPresent.

@Test
public void testHasAnalyzerAnalyzerPresent() {
    Field field = Field.newBuilder().setAnalyzer(getPredefinedAnalyzer()).build();
    assertTrue(hasAnalyzer(field));
}
Also used : Field(com.yelp.nrtsearch.server.grpc.Field) Test(org.junit.Test)

Example 7 with Field

use of com.yelp.nrtsearch.server.grpc.Field in project nrtsearch by Yelp.

the class FieldDefCreatorTest method testCustomFieldNotDefined.

@Test(expected = IllegalArgumentException.class)
public void testCustomFieldNotDefined() {
    Field field = Field.newBuilder().setType(FieldType.CUSTOM).setAdditionalProperties(Struct.newBuilder().putFields("type", Value.newBuilder().setStringValue("custom_field_type").build()).build()).build();
    FieldDefCreator.getInstance().createFieldDef("test_field", field);
}
Also used : Field(com.yelp.nrtsearch.server.grpc.Field) Test(org.junit.Test)

Aggregations

Field (com.yelp.nrtsearch.server.grpc.Field)7 Test (org.junit.Test)6 JsonObject (com.google.gson.JsonObject)1 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)1 FieldDefResponse (com.yelp.nrtsearch.server.grpc.FieldDefResponse)1 FieldDef (com.yelp.nrtsearch.server.luceneserver.field.FieldDef)1 IdFieldDef (com.yelp.nrtsearch.server.luceneserver.field.IdFieldDef)1 IndexableFieldDef (com.yelp.nrtsearch.server.luceneserver.field.IndexableFieldDef)1 VirtualFieldDef (com.yelp.nrtsearch.server.luceneserver.field.VirtualFieldDef)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1