use of com.xiaomi.linden.thrift.common.LindenSchema in project linden by XiaoMi.
the class TestLindenMetricPlugin 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").setIndexed(true).setStored(false));
schema.addToFields(new LindenFieldSchema().setName("field2").setIndexed(true).setTokenized(true).setStored(false).setOmitFreqs(true).setOmitNorms(true));
schema.addToFields(new LindenFieldSchema().setName("rank").setType(LindenType.FLOAT).setIndexed(true).setStored(true));
schema.addToFields(new LindenFieldSchema().setName("cat1").setType(LindenType.INTEGER).setIndexed(true).setStored(true));
schema.addToFields(new LindenFieldSchema().setName("cat2").setType(LindenType.DOUBLE).setIndexed(true).setStored(true));
schema.addToFields(new LindenFieldSchema().setName("tagstr").setIndexed(true));
schema.addToFields(new LindenFieldSchema().setName("hotwords").setStored(true));
schema.addToFields(new LindenFieldSchema().setName("tagnum").setType(LindenType.INTEGER).setIndexed(true));
lindenConfig.setSchema(schema);
}
use of com.xiaomi.linden.thrift.common.LindenSchema in project linden by XiaoMi.
the class TestLindenJiebaAnalyzerIndexMode method init.
@Override
public void init() {
lindenConfig.setIndexType(LindenConfig.IndexType.RAM);
lindenConfig.setClusterUrl("127.0.0.1:2181/mock");
LindenSchema schema = new LindenSchema().setId("id");
schema.addToFields(new LindenFieldSchema().setName("title").setIndexed(true).setTokenized(true).setSnippet(true).setMulti(true));
lindenConfig.setSchema(schema);
lindenConfig.putToProperties("search.analyzer.class", "com.xiaomi.linden.lucene.analyzer.LindenJiebaAnalyzerFactory");
lindenConfig.putToProperties("index.analyzer.class", "com.xiaomi.linden.lucene.analyzer.LindenJiebaAnalyzerFactory");
lindenConfig.putToProperties("index.analyzer.mode", "index");
}
use of com.xiaomi.linden.thrift.common.LindenSchema in project linden by XiaoMi.
the class TestHotSwapLindenCore method init.
public void init() throws Exception {
LindenSchema schema = new LindenSchema().setId("id");
schema.addToFields(new LindenFieldSchema().setName("title").setIndexed(true).setStored(true).setTokenized(true));
lindenConfig = new LindenConfig();
lindenConfig.setClusterUrl("127.0.0.1:2181/test");
lindenConfig.setSchema(schema);
String path = FilenameUtils.concat(TestMultiLindenCore.class.getResource("./").getPath(), "index/");
FileUtils.deleteQuietly(new File(path));
lindenConfig.setIndexDirectory(path);
lindenConfig.setLindenCoreMode(LindenConfig.LindenCoreMode.HOTSWAP);
}
use of com.xiaomi.linden.thrift.common.LindenSchema in project linden by XiaoMi.
the class TestLindenAggregation method init.
@Override
public void init() throws Exception {
LindenSchema schema = new LindenSchema().setId("id");
schema.addToFields(new LindenFieldSchema().setName("intValue").setType(LindenType.INTEGER).setDocValues(true));
lindenConfig.setSchema(schema);
}
use of com.xiaomi.linden.thrift.common.LindenSchema in project linden by XiaoMi.
the class TestLindenDynamicField method init.
@Override
public void init() {
schema = new LindenSchema().setId("id");
schema.addToFields(new LindenFieldSchema("name", LindenType.STRING).setIndexed(true).setTokenized(true).setStored(true));
schema.addToFields(new LindenFieldSchema("level", LindenType.STRING).setIndexed(true).setStored(true));
schema.addToFields(new LindenFieldSchema("log", LindenType.STRING).setIndexed(true).setTokenized(true).setStored(true));
schema.addToFields(new LindenFieldSchema("host", LindenType.STRING).setIndexed(true).setStored(true));
schema.addToFields(new LindenFieldSchema("shard", LindenType.INTEGER).setIndexed(true).setStored(true));
lindenConfig.setSchema(schema);
}
Aggregations