On May 28, 2009, at 9:46 PM, Eric Pugh wrote:

Updating to latest and greatest added that data, thank you for the pointer. Too many copies of Solr 1.4 trunk, and I'd neglected to update.

However, the issue with the mapping not working with the ext.metadata.prefix seems to remain:

budapest:site epugh$ curl http://localhost:8983/solr/update/extract?ext.def.fl=text \&ext.map.stream_name=id\&ext.metadata.prefix=metadata_ -F "fi...@tutorial.pdf "

<body><h2>HTTP ERROR: 500</ h2><pre>org.apache.solr.common.SolrException: Document [null] missing required field: id

AFAICT, here's what's going on:

In the SolrContentHandler, the first thing it does is try to add the Metadata to the document. So, for every metadata item, it goes and looks up the metadata name to see if there is a mapping _and_ it attaches the prefix (see findMappedMetadataName()) so, in your case, you end up with metadata_id.

I still wonder, however, why you need to even do that. why not just &ext.literal.id=tutorial.pdf?

If you really want what you describe above, the current best way would be to extend SolrContentHandler and override findMappedMetadataName() to check to see if the name is stream_name or to check if it is being mapped to the Solr unique field.

Alternatively, you could make your unique id be metadata_id.

Otherwise, I'm not sure if this is a bug or not.

HTH,
Grant

Reply via email to