Update Request Processors to the rescue!
Example - Ignore input values for any undefined fields
Add to solrconfig:
<updateRequestProcessorChain name="ignore-undefined">
<processor class="solr.IgnoreFieldUpdateProcessorFactory" />
<processor class="solr.LogUpdateProcessorFactory" />
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>
Index content:
curl
"http://localhost:8983/solr/update?commit=true&update.chain=ignore-undefined"
\
-H 'Content-type:application/json' -d '
[{"id": "doc-1",
"title": "Hello World",
"features": ["Fast", "Cheap"],
"bad_field_name": "Junk",
"abstract": "Not in schema either"}]'
Results:
"id":"doc-1",
"title":["Hello World"],
"features":["Fast",
"Cheap"],
(From the book!)
-- Jack Krupansky
-----Original Message-----
From: Igor Littig
Sent: Thursday, May 30, 2013 10:39 AM
To: solr-user@lucene.apache.org
Subject: Fwd: indexing only selected fields
---------- Forwarded message ----------
From: Igor Littig <igor.lit...@gmail.com>
Date: 2013/5/30
Subject: indexing only selected fields
To: solr-user-...@lucene.apache.org
Hello everyone.
I'm quite new in Solr and need your advice... Does anybody know how to
index not all fields in an uploading document but only those which I
mentioned in the schema, others fields and symbols just ignore. Is it
possible ???