参考: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、下载
[url]http://archive.apache.org/dist/lucene/solr/[/url]
我下的是5.1.0的
安装solr:解压的一个过程
2、配置core
启动服务:solr start
[img]http://dl2.iteye.com/upload/attachment/0108/6618/034bd374-7cfc-347d-bc68-b088e0085d76.png[/img]
[url]http://localhost:8983/solr[/url]
创建core: solr create -c <name>
[img]http://dl2.iteye.com/upload/attachment/0108/6620/cfe99347-a7fe-3c5b-ae19-7a0d0640d062.png[/img]
增加文档:(windows下)java -Durl=http://localhost:8983/solr/mycore/update -Ddata=files -jar post.jar *.xml
[img]http://dl2.iteye.com/upload/attachment/0108/6622/7fdc8577-3998-3ff9-bcb7-948ce7932717.png[/img]
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
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、下载
[url]http://archive.apache.org/dist/lucene/solr/[/url]
我下的是5.1.0的
安装solr:解压的一个过程
2、配置core
启动服务:solr start
[img]http://dl2.iteye.com/upload/attachment/0108/6618/034bd374-7cfc-347d-bc68-b088e0085d76.png[/img]
[url]http://localhost:8983/solr[/url]
创建core: solr create -c <name>
[img]http://dl2.iteye.com/upload/attachment/0108/6620/cfe99347-a7fe-3c5b-ae19-7a0d0640d062.png[/img]
增加文档:(windows下)java -Durl=http://localhost:8983/solr/mycore/update -Ddata=files -jar post.jar *.xml
[img]http://dl2.iteye.com/upload/attachment/0108/6622/7fdc8577-3998-3ff9-bcb7-948ce7932717.png[/img]
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