我在solr中创建了几个索引。 其中有一列索引名字为xm,其内容为中文的。其他的索引 我可以用SolrQuery query = new SolrQuery("studentid:801000003217"); 这样的方式查询出来,请问中文的xm列 我要如何进行查询呢。 用SolrQuery query = new SolrQuery("xm:张三")这样的方式查询不出来。谢谢大家
我的schema.xml配置文件:
inrowkey
我的java 查询代码:
public void query() throws SolrServerException, IOException {
Configuration conf = this.getCon();
HTable table = new HTable(conf, "myTable");
Get get = null;
List list = new ArrayList();
String url = "http://localhost:8080/solr";
SolrServer server = new HttpSolrServer(url);
//SolrQuery query = new SolrQuery("XM:张*"); //这种方式查询不出来
SolrQuery query = new SolrQuery("SFZH:101110203217");//这种方式可以
query.setStart(0); // 数据起始行,分页用
query.setRows(10); // 返回记录数,分页用
QueryResponse response = server.query(query);
SolrDocumentList docs = response.getResults();
System.out.println("文档个数:" + docs.getNumFound());
System.out.println("查询时间:" + response.getQTime());