开发solr功能问题点
Criteria criteria = new Criteria();
public Criteria and(Criteria criteria) {
this.criteriaChain.add(criteria);
return this;
}
和
public Criteria and(Criteria... criterias) {
this.criteriaChain.addAll(Arrays.asList(criterias));
return this;
}
这两个方法的区别是什么?
Map<String, String> map = new HashMap<String, String>();
map.put("q", "id:716669245129728 AND price:1000");
SolrParams solrParams = new MapSolrParams(map);
SolrServer solrServer = solrTemplate.getSolrServer();
QueryResponse queryResult = solrServer.query(solrParams);
SolrDocumentList solrList = queryResult.getResults();
System.out.println("result size-------------------" + solrList.size());
上面的AND 表示一起查询,id和price的查询条件都要满足
不能为小写,区分大小写
参考链接如下:
http://wiki.apache.org/solr/SolrQuerySyntax