
2、将solr-4.7.1/example/lib/ext/目录下的jar文件复制到tomcat/lib目录下,将solr-4.7.1/example/resources/下的log4j.properties文件复制到tomcat_dir/lib目录下
切把 solr-4.7.1/example/solr,复制到tomcat_dir/bin下。
3、修改tomcat_dir/conf/server.xml
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="UTF-8" />
4、创建solr.xml,存放在路径:tomcat/conf/Catalina/localhost/solr.xml,内容:
<Context path="/solr" docBase="C:\Tomcat 7.0\webapps\solr.war"
debug="0" crossContext="true">
一条索引包含了
Tips
solrJ 创建core只是把自己的文件夹加入到solr中,各种文件还要自建立
<field name="5#城市" type="string" indexed="false" stored="true"/>
pf 查询字段 qf 设置字段性对查询字段的比重 bf 设置权重的值
Searchers are presented with the indexed terms, along with numerical counts of how many matching documents were found were each term. Faceting makes it easy for users to explore search results, narrowing in on exactly the results they are looking for
简单说,solr的facet特性会搜索特定的facet.item,返回query中查询字段在item字段上的统计值且仅仅返回统计数量.
facet.poivt 实现了多维统计.例如统计班级学生的成绩分布,可以设置poivt=class,poivt=socore 返回的结果就是每个班各个成绩段学生的数量
在SolrJ中使用facet功能需要手动开启: query.setFacet(true) .然后根据需要 query.set(,) 添加条件.
facet 简单使用
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)