Search in sources :

Example 21 with LindenSchema

use of com.xiaomi.linden.thrift.common.LindenSchema in project linden by XiaoMi.

the class TestLindenUpdate method init.

@Override
public void init() throws Exception {
    LindenSchema schema = new LindenSchema().setId("id");
    schema.addToFields(new LindenFieldSchema().setName("title").setIndexed(true).setStored(true).setTokenized(true));
    schema.addToFields(new LindenFieldSchema().setName("field1").setDocValues(true));
    schema.addToFields(new LindenFieldSchema().setName("rank").setType(LindenType.FLOAT).setIndexed(true));
    schema.addToFields(new LindenFieldSchema().setName("cat1").setType(LindenType.INTEGER).setStored(true));
    schema.addToFields(new LindenFieldSchema().setName("cat2").setType(LindenType.DOUBLE).setDocValues(true));
    schema.addToFields(new LindenFieldSchema().setName("tagstr").setType(LindenType.STRING).setIndexed(true).setDocValues(true));
    schema.addToFields(new LindenFieldSchema().setName("tagnum").setType(LindenType.INTEGER).setIndexed(true).setStored(true).setMulti(true));
    lindenConfig.setSchema(schema);
    lindenConfig.setEnableSourceFieldCache(true);
}
Also used : LindenFieldSchema(com.xiaomi.linden.thrift.common.LindenFieldSchema) LindenSchema(com.xiaomi.linden.thrift.common.LindenSchema)

Aggregations

LindenSchema (com.xiaomi.linden.thrift.common.LindenSchema)21 LindenFieldSchema (com.xiaomi.linden.thrift.common.LindenFieldSchema)17 File (java.io.File)5 Test (org.junit.Test)3 LindenConfig (com.xiaomi.linden.core.LindenConfig)1 LindenIndexRequest (com.xiaomi.linden.thrift.common.LindenIndexRequest)1 IOException (java.io.IOException)1 DocumentBuilder (javax.xml.parsers.DocumentBuilder)1 DocumentBuilderFactory (javax.xml.parsers.DocumentBuilderFactory)1 Document (org.w3c.dom.Document)1 Element (org.w3c.dom.Element)1 Node (org.w3c.dom.Node)1 NodeList (org.w3c.dom.NodeList)1