use of com.xiaomi.linden.thrift.common.LindenSchema in project linden by XiaoMi.
the class TestLindenCore 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).setMulti(true).setStored(true).setMulti(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 TestLindenFacet method init.
@Override
public void init() throws Exception {
LindenSchema schema = new LindenSchema().setId("id");
schema.addToFields(new LindenFieldSchema().setName("Language").setTokenized(false).setIndexed(true));
schema.addToFields(new LindenFieldSchema().setName("Title").setTokenized(true).setIndexed(true));
schema.addToFields(new LindenFieldSchema().setName("Author").setType(LindenType.FACET).setStored(true).setIndexed(true));
schema.addToFields(new LindenFieldSchema().setName("PublishDate").setType(LindenType.FACET).setStored(true));
lindenConfig.setSchema(schema);
lindenConfig.putToProperties("cluster.url", "localhost:2183/facettest");
lindenConfig.putToProperties("port", "19090");
lindenConfig.putToProperties("shard.id", "0");
lindenConfig.putToProperties("index.directory", "/tmp/linden-facet-test/index/0");
lindenConfig.putToProperties("log.path", "/tmp/linden-facet-test/log/0");
lindenConfig.putToProperties("search.timeout", "0");
}
use of com.xiaomi.linden.thrift.common.LindenSchema in project linden by XiaoMi.
the class TestLindenFieldCache method init.
@Override
public void init() throws Exception {
LindenSchema schema = new LindenSchema().setId("id");
schema.addToFields(new LindenFieldSchema().setName("title").setIndexed(true).setTokenized(true));
schema.addToFields(new LindenFieldSchema().setName("ids_int").setType(LindenType.INTEGER).setIndexed(true).setTokenized(true).setMulti(true));
schema.addToFields(new LindenFieldSchema().setName("ids_long").setType(LindenType.INTEGER).setIndexed(true).setTokenized(true).setMulti(true));
schema.addToFields(new LindenFieldSchema().setName("ids_str").setType(LindenType.STRING).setIndexed(true).setTokenized(true).setMulti(true));
schema.addToFields(new LindenFieldSchema().setName("ids_float").setType(LindenType.FLOAT).setIndexed(true).setTokenized(false).setMulti(true));
schema.addToFields(new LindenFieldSchema().setName("ids_double").setType(LindenType.DOUBLE).setIndexed(true).setTokenized(false).setMulti(true));
schema.addToFields(new LindenFieldSchema().setName("rank").setType(LindenType.FLOAT).setIndexed(true));
lindenConfig.setSchema(schema);
}
use of com.xiaomi.linden.thrift.common.LindenSchema in project linden by XiaoMi.
the class TestLindenJiebaAnalyzerSearchMode 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", "search");
}
use of com.xiaomi.linden.thrift.common.LindenSchema in project linden by XiaoMi.
the class TestLindenMMSeg4jAnalyzer 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.LindenMMSeg4jAnalyzerFactory");
lindenConfig.putToProperties("index.analyzer.class", "com.xiaomi.linden.lucene.analyzer.LindenMMSeg4jAnalyzerFactory");
}
Aggregations