[ 
https://issues.apache.org/jira/browse/SOLR-308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12513972
 ] 

Hoss Man commented on SOLR-308:
-------------------------------

I understood your data entry/delete reindexing strategy, but i hadn't 
considered the use case of doing a query, and then issuing a followup query to 
get more details about specific items.

As yonik points out, exposing the internal lucene docid would be a bad idea 
since it may change every time an IndexReader is opened ... even if hte doc you 
are interested in is still in the index (ie: hasn't been deleted) other 
deletions may have changed it's internal id.

i have no objection to adding a FieldType that can generate UUID on demand for 
use cases like this, but having it ignore the input seems a little sketchy to 
me.  it seems like a better approach would be to have UUIDFieldType with a 
toInternal() method that tests it's input for some marker token (like "NEW" or 
"*") and if it sees that token, generates a new UUID, otherwise it uses the 
literal value.  then you can configure the id field with a defaultValue of 
"NEW" in the schema and any doc without an id will get a unique one, but if 
someone tries to update an existing doc whose id they already know, it will 
still work as well.

> Add a field that generates an unique id when you have none in your data to 
> index
> --------------------------------------------------------------------------------
>
>                 Key: SOLR-308
>                 URL: https://issues.apache.org/jira/browse/SOLR-308
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>            Reporter: Thomas Peuss
>            Priority: Minor
>         Attachments: GeneratedId.patch
>
>
> This patch adds a field that generates an unique id when you have no unique 
> id in your data you want to index.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to