Introduction

It is open source enterprise search platform from the Apache Lucene. Its major features include

  • text search
  • hit highlighting
  • faceted search
  • near real-time indexing
  • dynamic clustering
  • database integration
  • rich document (e.g., Word, PDF) handling
  • geospatial search

Solr runs as a standalone full-text search server within a servlet container. Solr uses the Lucene Java search library at its core for full-text indexing and search, and has REST-like HTTP/XML and JSON APIs. Solr put documents (by indexing) via XML, JSON, CSV or binary over HTTP. Solr users can query it via HTTP GET and receive XML, JSON, CSV or binary results.

Below diagram is the Apache Solr architecture (conceptual) and Apache Solr is composed of multiple modules.

image

Download ::http://lucene.apache.org/solr/downloads.html

 

1. Start Apache S olr from ‘solr-4.9.0\example>java -jar start.jar’

image

1.1 Then go to http://localhost:8983/solr/

image

 

Indexing files

2. Now we will index some sample file in Solr.

solr-4.9.0\example\exampledocs>java -jar post.jar *.xml

image

Status can be check from http://localhost:8983/solr/admin/cores?action=STATUS

or web user interface

image

 

Search

 

3.1 Here we search for ‘video’ in our index

http://localhost:8983/solr/collection1/select?q=video

image

3.2 Picking up field only that you need

http://localhost:8983/solr/collection1/select?q=video&fl=id,name

image

3.3 Search for word "Dell" in the name field.

http://localhost:8983/solr/collection1/select?q=name:Dell

3.4.1 Used AND in search
name:Dell AND manu:Dell

3.4.2 Using OR with AND
(name:Dell AND manu:Dell)OR name:fox

3.4.3 Using NOT
name:Dell -name:server

3.5 Wildcard matching
name:Samsu*
http://localhost:8983/solr/collection1/select?q=name:Samsu*

3.6 Proximity matching
Search for "foo bar" within 2 words from each other.
http://localhost:8983/solr/collection1/select?q=name:"Samsung SpinPoint"~2

3.7 Range
http://localhost:8983/solr/collection1/select?q=price:[10 TO 300]

3.8 Facet search

Faceted search is the dynamic clustering of items or search results into categories

http://localhost:8983/solr/collection1/select?q=price:[10%20TO%20300]&facet=true&facet.field=manu

http://localhost:8983/solr/collection1/select?q=price:[10%20TO%20300]&facet=true&facet.field=cat

image

0

Add a comment

I am
I am
Archives
Total Pageviews
Total Pageviews
2 0 5 7 7 0 6
Categories
Categories
Loading