Apache Solr is a serach engine build on top of Apache Lucene as a product and it has a full functional web server based search engine in it. We can use this as Search Engine for our requirement in Applications.
Apache Solr is a open-source search server which can be hosted in Web.
Solr give us th e ways to easily create search engines which searches databases,files and even in websites.
To install Apache Solr in windows machine
1> Download Apache Solr 4.0 from Web
2> Unzip it to Folder. Be sure about installation of JDK 1.5 or Above for the requirement.
3> Goto Solr Installation Folder \example
4>Run the command
java - jar start.jar
If everything goes fine, after the default installation, we will have the solr server up in -
http://localhost:8983/solr
Solr Query should be executed by typing
http://localhost:8983/solr/select?q=*:*&wt=xml
Now in Default installation for any of work of our own, we have to change at a minimal in
the schema.xml file in directory -
Solr Installation Folder \example\solr\collection1\conf
For change parameters the most important one is -
Fields
is the section of configuration in Schema.xml. Here we should put our fields of search.
name – put here our required field name to be able to search by solr engine.
type – Type can be of many – text_general, string, date, int, text_en etc. We should put those
carefully as per our requirement in the Fields
indexed – Whether this field will be indexed by our search engine or not.
stored – Whether this field will be stored by our search engine or not in the index.
We should mention those carefully because more the size of index in the solr server,
the search time of a term will be higher
here.
multivalued – One field can hold multiple values or not. Here the search api will store
and return multiple value in same field.
We will explain more on this when we write the solr4j integration in later articles.
These are all for now. To start in Solr, the above information is enough.
We will discuss and highlight other important parameters of solr configuration in later articles.