Introduction to SOLR for Java applications

Source: Internet
Author: User

Objective

SOLR is a full-text search application for the Apache Project.

Official Document HTTP://LUCENE.APACHE.ORG/SOLR/GUIDE/6_6/

Getting Started process

1. installation---> 2. start---> 3. Create a core---> 4. Add a document---> 5.url interface query

1. installation

Download solr-6.6.0.tgz package, Unzip any directory

2. start
/opt/solr-6.6. 0/bin. /SOLR Start  -force  #root用户需要加force
3. Create the Core

#创建索引数据文件存放地方.

./SOLR create-c Ttt-force  #ttt为核心名称, post and query are used
4. Add a document (POST)
Bin/post-c TTT  example/exampledocs/*.xml #默认用的官方例子
5.url interface Query
A.curl http://Localhost:8983/solr/ttt/select?q=video#q为基本查询, Fixed value constant video is the value of the Query. Q queries are full-text queries and can be followed by regular symbols. b.http://Localhost:8983/solr/ttt/select?q=video&fl=id,name,price#fl固定值, The result returns the Id,name,price field c.http://Localhost:8983/solr/ttt/select?q=name:black#还是模糊查询, Experiment under Name:black No special meaning, is a whole string d.http://Localhost:8983/solr/ttt/select?q=price:0%20to%20400&fl=id,name,price#price:0To -Scope Query E.http://localhost:8983/solr/ttt/select?q=price:0%20to%20400&fl=id,name,price&facet=true&facet.field= Cat#facet固定值, aggregate queries, equivalent to Sql's GROUP by or countf.http://192.168.0.110:8983/solr/ttt/select?q=price:0%20to%20400&fl=id,name,price&wt=json#wt返回json格式

More tips

1. Query with the management side

2. A blogger finishing the Solr-query syntax/parameters

http://blog.csdn.net/zhufenglonglove/article/details/51518846

  

Introduction to SOLR for Java applications

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.