Example usage for org.apache.lucene.index DocValuesType SORTED_SET

List of usage examples for org.apache.lucene.index DocValuesType SORTED_SET

Introduction

In this page you can find the example usage for org.apache.lucene.index DocValuesType SORTED_SET.

Prototype

DocValuesType SORTED_SET

To view the source code for org.apache.lucene.index DocValuesType SORTED_SET.

Click Source Link

Document

A pre-sorted Set<byte[]>.

Usage

From source file:com.stratio.cassandra.lucene.schema.mapping.BigDecimalMapperTest.java

License:Apache License

@Test
public void testSortedFieldCollection() {
    BigDecimalMapper mapper = new BigDecimalMapper("field", false, null, 4, 4);
    String base = mapper.base("name", "42.43");
    Field field = mapper.sortedField("name", base, true);
    assertNotNull(field);/*  ww w  .  ja va 2s  . c  o  m*/
    assertEquals(DocValuesType.SORTED_SET, field.fieldType().docValuesType());
}

From source file:com.stratio.cassandra.lucene.schema.mapping.BigIntegerMapperTest.java

License:Apache License

@Test
public void testSortedFieldCollection() {
    BigIntegerMapper mapper = new BigIntegerMapper("field", null, true, 10);
    String base = mapper.base("name", "4243");
    Field field = mapper.sortedField("name", base, true);
    assertNotNull(field);/* ww  w . j  av a 2 s.co  m*/
    assertEquals(DocValuesType.SORTED_SET, field.fieldType().docValuesType());
}

From source file:com.stratio.cassandra.lucene.schema.mapping.BlobMapperTest.java

License:Apache License

@Test
public void testSortedFieldCollection() {
    BlobMapper mapper = new BlobMapper("field", true, false);
    String base = mapper.base("name", "f1B2");
    Field field = mapper.sortedField("name", base, true);
    assertNotNull(field);//  w  w  w .  ja v a 2  s  .c  o  m
    assertEquals(DocValuesType.SORTED_SET, field.fieldType().docValuesType());
}

From source file:com.stratio.cassandra.lucene.schema.mapping.BooleanMapperTest.java

License:Apache License

@Test
public void testSortedFieldCollection() {
    BooleanMapper mapper = new BooleanMapper("field", true, false);
    Field field = mapper.sortedField("name", "true", true);
    assertNotNull(field);//from  w  ww.j a  v  a  2s . com
    assertEquals(DocValuesType.SORTED_SET, field.fieldType().docValuesType());
}

From source file:com.stratio.cassandra.lucene.schema.mapping.InetMapperTest.java

License:Apache License

@Test
public void testSortedFieldCollection() {
    InetMapper mapper = new InetMapper("field", true, true);
    Field field = mapper.sortedField("name", "192.168.0.13", true);
    assertNotNull(field);//from   ww  w  .j  a v  a2  s .  c om
    assertEquals(DocValuesType.SORTED_SET, field.fieldType().docValuesType());
}

From source file:com.stratio.cassandra.lucene.schema.mapping.StringMapperTest.java

License:Apache License

@Test
public void testSortedFieldCollection() {
    StringMapper mapper = new StringMapper("field", true, true, true);
    Field field = mapper.sortedField("name", "hello", true);
    assertNotNull(field);//from   w  w w  .j ava  2s  . c om
    assertEquals(DocValuesType.SORTED_SET, field.fieldType().docValuesType());
}

From source file:com.stratio.cassandra.lucene.schema.mapping.TextMapperTest.java

License:Apache License

@Test
public void testSortedFieldCollection() {
    TextMapper mapper = new TextMapper("field", null, true, "org.apache.lucene.analysis.en.EnglishAnalyzer");
    Field field = mapper.sortedField("name", "hello", true);
    assertNotNull(field);/*from   w ww.  ja  v  a2s  .  c om*/
    assertEquals(DocValuesType.SORTED_SET, field.fieldType().docValuesType());
}

From source file:com.stratio.cassandra.lucene.schema.mapping.UUIDMapperTest.java

License:Apache License

@Test
public void testSortedFieldCollection() {
    UUIDMapper mapper = new UUIDMapper("field", true, true);
    Field field = mapper.sortedField("name", "550e8400-e29b-41d4-a716-446655440000", true);
    assertNotNull(field);/*from   www.  j av a 2 s  .  c om*/
    assertEquals(DocValuesType.SORTED_SET, field.fieldType().docValuesType());
}

From source file:com.vmware.xenon.services.common.Lucene60FieldInfosFormatWithCache.java

License:Open Source License

private static DocValuesType getDocValuesType(IndexInput input, byte b) throws IOException {
    switch (b) {//from   ww w  . j  ava2s.c  o m
    case 0:
        return DocValuesType.NONE;
    case 1:
        return DocValuesType.NUMERIC;
    case 2:
        return DocValuesType.BINARY;
    case 3:
        return DocValuesType.SORTED;
    case 4:
        return DocValuesType.SORTED_SET;
    case 5:
        return DocValuesType.SORTED_NUMERIC;
    default:
        throw new CorruptIndexException("invalid docvalues byte: " + b, input);
    }
}

From source file:dk.statsbiblioteket.netark.dvenabler.DVReaderTest.java

License:Apache License

private Set<DVConfig> createDVFieldDescriptions(File index) throws IOException {
    List<DVConfig> baseConfigs = IndexUtils.getDVConfigs(index);
    List<DVConfig> dvConfigs = new ArrayList<DVConfig>();
    for (DVConfig baseConfig : baseConfigs) {
        if (SINGLE.equals(baseConfig.getName())) {
            dvConfigs.add(baseConfig.set(FieldInfo.DocValuesType.SORTED));
        } else if (MULTI.equals(baseConfig.getName())) {
            dvConfigs.add(baseConfig.set(FieldInfo.DocValuesType.SORTED_SET));
        } else if (DOUBLE.equals(baseConfig.getName())) {
            dvConfigs.add(baseConfig.set(FieldInfo.DocValuesType.NUMERIC, FieldType.NumericType.DOUBLE));
        } else if (FLOAT.equals(baseConfig.getName())) {
            dvConfigs.add(baseConfig.set(FieldInfo.DocValuesType.NUMERIC, FieldType.NumericType.FLOAT));
        } else if (LONG.equals(baseConfig.getName())) {
            dvConfigs.add(baseConfig.set(FieldInfo.DocValuesType.NUMERIC, FieldType.NumericType.LONG));
        }// w w w.jav a 2 s .c o  m
    }
    return new HashSet<DVConfig>(dvConfigs);
}