You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2007/09/07 10:03:33 UTC
[Solr Wiki] Update of "mySolr" by ThorstenScherler
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by ThorstenScherler:
http://wiki.apache.org/solr/mySolr
The comment on the change is:
Focusing on using ant for generate our mySolr
------------------------------------------------------------------------------
= Work in progress - Help wanted =
This document is not fully finished but it may be useful for people getting started with solr development. Please share your experience, collaborating on this document.
- == SOLR-130 Open questions ==
+ == Open questions ==
1. The schema.xml and solrconfig.xml are in parts very well explained. But in some areas like as an example .. <indexDefaults> and other places there are no explanation. It would be nice to get more info there. Specifically for example if increase <mergeFactor> to 1000 what will happen? what are the highest value for each properties? what is for example a "safe value".
2. It would be nice to create a deployment scenarios i.e a single server install with XXX CPU and YYY memory just running Solr with AAA thousand docs how should your config look like and why? and you can get about xxx Query/Sec or something..
@@ -14, +14 @@
Solr is an open source enterprise search server based on the Lucene Java search library. Solr tries to expose all of the Lucene goodness through an easy to use, easy to configre, HTTP interface. Besides the configuration, Solr's other means of being a value add is in it's IndexReader management, it's caching, and it's plugin support for mixing and matching request handlers, output writers, and field types as easily as you can mix and match Analyzers.
= Architecture =
+ == Production ==
Typically it's not recommended do have your front end users/clients hitting Solr directly as part of an HTML form submit ... the more conventional way to think of it is that Solr is a backend service, which your application can talk to over HTTP -- if you were dealing with a database, you wouldn't expect that you could generate an HTML form for your clients and then have them submit that form in some way that resulted in their browser using JDBC (or ODBC) to communicate directly with your database, their client would communicate with your App, which would validate their input, impose some security checks on the input, and then execute the underlying query to your database -- working with Solr should be very similar, it just so happens that instead of using JDBC or some other binary protocol, Solr uses HTTP, and you *can* talk to it directly from a web browser, but that's really more of a debugging feature then anything else.
+ == Development ==
+ This document describes how to create and deploy your custom solr server based on an out-of-the-box solr distribution. We will use Apache Ant for the deployment and possible patching of standard solr files.
= Getting started =
- If you followed the tutorial you may now ask yourself how to create your own application based on SOLR. The easiest way is to use the example webapp and strip everything that you do not need.
+ If you followed the tutorial you may now ask yourself how to create your own application based on SOLR. We use the example webapp dir structure and strip everything that we do not need or do not want to duplicate. The most likely files you need are in the solr/conf directory since they are controlling the behavior of our application.
- First we will setup a basic directory structure:
+ First we will setup a basic directory structure (assuming we only want to change some fields) and create a blank build.xml:
{{{
$mySolr
|-- solr
- | |-- README.txt
| `-- conf
- | |-- admin-extra.html
- | |-- protwords.txt
| |-- schema.xml
- | |-- scripts.conf
- | |-- solrconfig.xml
+ | `-- solrconfig.xml
+ `-- build.xml
- | |-- stopwords.txt
- | |-- synonyms.txt
- | `-- xslt
- | `-- example.xsl
- `-- webapps
- `-- mySolr
}}}
+ In the build.xml we will later generate a fully functional web-application using Jetty as servlet engine. The following is the basic structure when you are developing with a standalone jetty included. Where etc/, ext/, lib/ and start.jar are jetty specific and not needed when developing for tomcat. However in our small example we will use jetty and copy this files from the example via our ant script.
- Now we need content in the webapps/, for this we can first build the core application and then extract the content again into the webapps/mySolr/ (with any zip application):{{{ant dist-war}}}
- Alternative we can copy all resources referenced by the ant target ourself (of course compiled).
+ The most important directoy is solr/. Here we store all configuration parameter needed by solr where the idea is our above defined files have priority before the core files from solr which we will copy over via our little ant script.
+
- = Basic structure with jetty =
+ = Basic structure with jetty after build=
{{{
$mySolr
|-- etc
@@ -80, +75 @@
| `-- example.xsl
|-- start.jar
`-- webapps
- `-- mySolr
+ `-- solr
|-- META-INF
| |-- LICENSE.txt
| |-- MANIFEST.MF
@@ -97, +92 @@
| `-- web.xml
`-- index.html
}}}
- This is the basic structure when you are developing with a standalone jetty included. Where etc/, ext/, lib/ and start.jar are jetty specific and not needed when developing for tomcat. However in our small example we will use jetty and copy this files from the example.
- The most important directoy is solr/. Here we store all configuration parameter needed by solr.
+ = Ant script=
+ {{{
+ <project>
+ <property environment="env"/>
+ <!-- SOLR_HOME must be set as an environment variable -->
+ <property name="solr.home" value="${env.SOLR_HOME}"/>
+ <condition property="solr.set" >
+ <isset property="solr.home" />
+ </condition>
+ <fail unless="solr.set">Please set SOLR_HOME in your environment.
+ export SOLR_HOME=~/src/apache/solr/
+ </fail>
+ <import file="${env.SOLR_HOME}/build.xml"/>
+ </project>
+ }}}
+ = Extending ==
= Setting up your own fields =
As soon you are using your own fields you will have to define them in the schema.xml. Since we used the example schema as basis for our app, remove the following fields and add your own:
{{{