Here's the normal path to the example configuration in Solr 4.1:

.../solr-4.1.0/example/solr/collection1/conf

That's the directory in which the example schema.xml and other configuration files live.

There is no solr-4.1.0/example/conf directory, unless you managed to create one yourself.

I suggest that you start with a fresh install of Solr 4.1

As far as keywords, the existing field is set up to be a comma-separated list of keyword phrases. Of course, you can structure it any way that your application requires.

-- Jack Krupansky

-----Original Message----- From: Patrice Seyed
Sent: Saturday, March 16, 2013 2:48 AM
To: solr-user@lucene.apache.org
Subject: Re: status 400 on posting json

Hi,

Re:

-----------------
Is there some place I should indicate what parameters are including in
the json objects send? I was able to test books.json without the
error.

"Yes, in Solr's schema.xml (under the conf/ directory).  See
<http://wiki.apache.org/solr/SchemaXml> for more details.

       Erik Hatcher"

and:

-----------------

"I tried it and I get the same error response! Which is because... I
don't have a field named "datasource".

You need to check the Solr schema.xml for the available fields and
then add any fields that your JSON uses that are not already there. Be
sure to shutdown and restart Solr after editing the schema.

I did notice that there is a "keywords" field, but it is not
multivalued, while you keywords are multivalued.

Or, you can us dynamic fields, such as "datasource_s" and "keywords_ss
("s" for string and a second "s" for multivalued), etc. for your other
fields.

-- Jack Krupansky"

-----------------

Thanks very much for these responses.  I'm still confused by the fact
that there is no schema.xml for the books.json fields though. Was this
compiled into the start.jar? Also, where do I place my crafted
schema.xml? I tried in ~/solr-4.1.0/example/conf where the start.jar
is in/run from ~/solr-4.1.0/example but so far is still complaining
about not finding the 'datasource' field. (also tried placing it in
~/solr-4.1.0/example/solr/conf) (my current schema.xml is further
below.)

Also Jack, would it be better to parse this keywords field value
differently for it to be appropriately multivalued?:

"keywords":["EARTH SCIENCE
: Oceans : Ocean Temperature : Water
Temperature","Temperature","Integrated Ocean Observing
System","IOOS","Oceanographic Sensor Data","Intertidal Temperature
Data","continental shelf","seawater","temperature","Oregon","United
States of America","PISCO"]

Thanks,
Patrice


<?xml version="1.0" encoding="UTF-8" ?>
<schema name="example" version="1.5">
<fields>
  <field name="id" type="string" indexed="true" stored="true"
required="true" multiValued="false" />
  <field name="datasource" type="string" indexed="true" stored="true"
required="true" multiValued="false" />
  <field name="abstract" type="string" indexed="true" stored="true"
required="true" multiValued="false" />
  <field name="title" type="string" indexed="true" stored="true"
required="true" multiValued="false" />
  <field name="author" type="string" indexed="true" stored="true"
required="true" multiValued="false" />
  <field name="contactOrganization" type="string" indexed="true"
stored="true" required="true" multiValued="false" />
  <field name="keywords" type="string" indexed="true" stored="true"
required="true" multiValued="false" />
</fields>
</schema>

Reply via email to