[
https://issues.apache.org/jira/browse/SOLR-284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12662660#action_12662660
]
Grant Ingersoll commented on SOLR-284:
--------------------------------------
bq. Should the schema designer just use the UUID field type or decide to have
no unique key field? This seems more modular and follows other aspects of the
design.
I guess I usually prefer having a unique key field, as it always gives you that
one last handle to grab on to to find a specific document. However, I'm not
sure I follow what you mean by having no uniq. field being more modular.
I put in the code b/c I figured it was better to generate an ID than to
outright reject the document, since unlike when adding XML, sending large files
can be really expensive, so I wanted it to handle as many edge cases as
possible and still accept a document.
Here's the code:
{code}
SchemaField uniqueField = schema.getUniqueKeyField();
if (uniqueField != null) {
String uniqueFieldName = uniqueField.getName();
SolrInputField uniqFld = document.getField(uniqueFieldName);
if (uniqFld == null) {
String uniqId = generateId(uniqueField);
if (uniqId != null) {
document.addField(uniqueFieldName, uniqId);
}
}
}
{code}
> Parsing Rich Document Types
> ---------------------------
>
> Key: SOLR-284
> URL: https://issues.apache.org/jira/browse/SOLR-284
> Project: Solr
> Issue Type: New Feature
> Components: update
> Reporter: Eric Pugh
> Assignee: Grant Ingersoll
> Fix For: 1.4
>
> Attachments: libs.zip, rich.patch, rich.patch, rich.patch,
> rich.patch, rich.patch, rich.patch, rich.patch, SOLR-284.patch,
> SOLR-284.patch, SOLR-284.patch, SOLR-284.patch, SOLR-284.patch,
> SOLR-284.patch, SOLR-284.patch, solr-word.pdf, source.zip, test-files.zip,
> test-files.zip, test.zip, un-hardcode-id.diff
>
>
> I have developed a RichDocumentRequestHandler based on the CSVRequestHandler
> that supports streaming a PDF, Word, Powerpoint, Excel, or PDF document into
> Solr.
> There is a wiki page with information here:
> http://wiki.apache.org/solr/UpdateRichDocuments
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.