On 8/23/2013 10:27 PM, Kamaljeet Kaur wrote:
> 
> Actually I wanted every single step to be clear, thats why I asked.
> Now there is written:
> 
> "Ensure that your solr schema (schema.xml) has the fields 'id',
> 'name', 'desc'. Change the appropriate details in the data-config.xml"
> 
> My schema.xml is not having these fields. That means I have to declare
> them. Can you tell me where? Where to declare them in that file? Isn't
> there the same option as in solr 3.5.0, Using a command, schema was
> built and we placed that output in schema.xml file?

You don't necessarily need these specific fields, unless these fields
are present in your database table, or they are present in your
data-config.xml file as field conversions.  Whatever you end up with
between your SELECT statement and data-config.xml is what you need in
your schema.

The only time a field with the exact name "id" is required is if you are
using SolrCloud with a numShards value higher than 1 and you expect Solr
to distribute your documents between your shards automatically.

> Also its written:
> 
> "Drop your JDBC driver jar file into the <solr-home>/lib directory."
> 
> It's a Java application to interact with database. Where is it? It
> must be a .jar file, rest I don't know yet. My solr/example/lib
> directory has an ext directory, jetty drivers and a
> servlet-api-3.0.jar driver. Is it fine? Then which one is JDBC driver?

It's not a full application, it's a Java library that translates between
your database and the JDBC layer provided by Java.  Your database vendor
will likely have a JDBC driver available.

The driver file that I use for connecting to a mysql database is named
mysql-connector-java-5.1.26-bin.jar and is available from
http://dev.mysql.com/downloads/connector/j/ .  If you are not using
mysql, then you would need to find the driver jar for your database, and
you would need to figure out the right driver name and URL information
to use in dataconfig.xml.

The solr/example/lib directory is for jetty, not Solr.  You should have
a solr.xml file that configures Solr.  The place where that file lives
is the solr home.  Jars for Solr work best in ${solr.solr.home}/lib.
The default solr.solr.home value is ./solr which is relative to the
current working directory when Jetty (or another container) is started.

Thanks,
Shawn

Reply via email to