Solr - Apache Solr is a fast open-source Java search server. Solr enables you to easily create search engines which searches websites, databases and files.
Solrj is a java client to access solr. It offers a java interface to add, update, and query the solr index.
Configuring Solr - The 2 most important files in the Solr configuration are:
schema.xml is usually the first file you configure when setting up a new Solr installation. The schema declares:
1. what kinds of fields there are
2. which field should be used as the unique/primary key
3. which fields are required
4. how to index and search each field
For e.g. If you create facet field name “product” you configure facet in schema.xml like as
Valid attributes for fields:
1. name: mandatory - the name for the field
2. type: mandatory - the name of a previously defined type from the section
3. indexed: true if this field should be indexed (searchable or sortable)
4. stored: true if this field should be retrievable
5. multiValued: true if this field may contain multiple values per document
6. omitNorms: (expert) set to true to omit the norms associated with this field (this disables length normalization and index-time boosting for the field, and saves some memory). Only full-text fields or fields that need an index-time boost need norms.
7. termVectors: [false] set to true to store the term vector for a given field. When using more like this, fields used for similarity should be stored for best performance.
8. termPositions: Store position information with the term vector. This will increase storage costs.
9. termOffsets: Store offset information with the term vector. This will increase storage costs.
10. default: a value that should be used if no value is specified when adding a document.
11. copyField- copyField commands copy one field to another at the time a document is added to the index. It's used either to index the same field differently, or to add multiple fields to the same field for easier/faster searching.
solrconfig.xml is usually the second file you configure when setting up a new Solr installation, after schema.xml. The more commonly-used elements in solrconfig.xml are:
1. data directory location
2. cache parameters
3. request handlers
4. search components
1. CommonsHttpSolrServer – Return a solr server
CommonsHttpSolrServer allows setting connection properties.
2. SolrInputDocument – Adding Data to Solr (Add documents)
3. SolrQuery - Solr Search
4. Delete everything from Solr Document
>Hope it helps !
Varun Sharma firstname.lastname@example.org