Search in sources :

Example 1 with IntPointField

use of org.apache.solr.schema.IntPointField in project lucene-solr by apache.

the class TestFacetMethods method testPointFields.

@Test
public void testPointFields() {
    // Methods other than FCS are not currently supported for PointFields
    SchemaField field = new SchemaField("foo", new IntPointField());
    assertEquals(SimpleFacets.FacetMethod.FCS, SimpleFacets.selectFacetMethod(field, null, 0));
    assertEquals(SimpleFacets.FacetMethod.FCS, SimpleFacets.selectFacetMethod(field, FacetMethod.ENUM, 0));
    assertEquals(SimpleFacets.FacetMethod.FCS, SimpleFacets.selectFacetMethod(field, FacetMethod.FC, 0));
    assertEquals(SimpleFacets.FacetMethod.FCS, SimpleFacets.selectFacetMethod(field, FacetMethod.FCS, 0));
    //MultiValued
    field = new SchemaField("fooMV", new IntPointField(), 0x00000200, "0");
    assertTrue(field.multiValued());
    assertEquals(SimpleFacets.FacetMethod.FCS, SimpleFacets.selectFacetMethod(field, null, 0));
    assertEquals(SimpleFacets.FacetMethod.FCS, SimpleFacets.selectFacetMethod(field, FacetMethod.ENUM, 0));
    assertEquals(SimpleFacets.FacetMethod.FCS, SimpleFacets.selectFacetMethod(field, FacetMethod.FC, 0));
    assertEquals(SimpleFacets.FacetMethod.FCS, SimpleFacets.selectFacetMethod(field, FacetMethod.FCS, 0));
}
Also used : SchemaField(org.apache.solr.schema.SchemaField) IntPointField(org.apache.solr.schema.IntPointField) Test(org.junit.Test)

Aggregations

IntPointField (org.apache.solr.schema.IntPointField)1 SchemaField (org.apache.solr.schema.SchemaField)1 Test (org.junit.Test)1