简单solr安装

参考:http://www.solrcn.com/
http://www.solr.cc/blog/
http://www.qikor.com/2014/08/08/apache-solr-4-9-and-ikanalyzer-up/
http://www.qikor.com/2014/08/10/apache-solr-4-9-and-ikanalyzer-down/
1、下载
http://archive.apache.org/dist/lucene/solr/
我下的是5.1.0的
安装solr:解压的一个过程
2、配置core
启动服务:solr start

http://localhost:8983/solr
创建core: solr create -c <name>

增加文档:(windows下)java -Durl=http://localhost:8983/solr/mycore/update -Ddata=files -jar post.jar *.xml

3、使用

简单查询:http://localhost:8983/solr/core/select?q=video(文档中默认为name)
http://localhost:8983/solr/core/select?q=name:black
过滤字段(只显示什么字段):http://localhost:8983/solr/core/select?q=*%3A*&fl=id%2Cname%2Cprice&wt=json&indent=true
区间查询:http://localhost:8983/solr/core/select?q=price%3A[0+TO+400]&fl=id%2Cname%2Cprice&wt=json&indent=true
分组查询:
http://localhost:8983/solr/core/select?q=price%3A[0+TO+400]&fl=id%2Cname%2Cprice&wt=json&indent=true&facet=true&facet.field=cat

猜你喜欢

转载自h972900846.iteye.com/blog/2212068