You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Will Johnson <wj...@GETCONNECTED.COM> on 2007/04/25 20:53:30 UTC

unused fields

Is there any way to make Solr not throw an Exception when unknown field
names are submitted as a part of an otherwise valid document?  Ie. I
have field named 'foo' in my document but it's not in my schema.  For
various bookkeeping / tracking purposes I need to annotate the documents
with extra info as they make their way to Solr.  However, I'd like to
avoid going back to clean up all those extra fields before sending them
to solr.

I took a peek at the DocumentBuilder and it seems to suggest that a very
conscious decision was made on this topic:

Line ~94
// error if this field name doesn't match anything
if (sfield==null && (destArr==null || destArr.length==0)) {
  throw new SolrException(400,"ERROR:unknown field '" + name + "'");
}

I'm happy to submit a patch + config option for this but I figured I'd
ask first to see if someone has really strong opinions about it... so I
can share my equally strong opinions with them.

- will

RE: unused fields

Posted by Will Johnson <wj...@GETCONNECTED.COM>.
Moved to:

https://issues.apache.org/jira/browse/SOLR-217

patch included.

- will

-----Original Message-----
From: Will Johnson [mailto:wjohnson@getconnected.com] 
Sent: Wednesday, April 25, 2007 2:54 PM
To: solr-user@lucene.apache.org
Subject: unused fields

Is there any way to make Solr not throw an Exception when unknown field
names are submitted as a part of an otherwise valid document?  Ie. I
have field named 'foo' in my document but it's not in my schema.  For
various bookkeeping / tracking purposes I need to annotate the documents
with extra info as they make their way to Solr.  However, I'd like to
avoid going back to clean up all those extra fields before sending them
to solr.

I took a peek at the DocumentBuilder and it seems to suggest that a very
conscious decision was made on this topic:

Line ~94
// error if this field name doesn't match anything
if (sfield==null && (destArr==null || destArr.length==0)) {
  throw new SolrException(400,"ERROR:unknown field '" + name + "'");
}

I'm happy to submit a patch + config option for this but I figured I'd
ask first to see if someone has really strong opinions about it... so I
can share my equally strong opinions with them.

- will