You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Alexandre Rafalovitch <ar...@gmail.com> on 2015/11/25 18:09:18 UTC

Should schema API allow deleting uniqueKey?

I am testing 5.4 branch and was enjoying new UI for adding/removing
fields in the schema.

So, for a test of an error message, I decided to delete the ID field.
And it let me. And then I indexed some files and the ID got recreated
as a generic field.

Should this be allowed or should delete field API check that we are
not deleting the uniqueKey? I can kind of see it both ways.

Regards,
   Alex.
----
Newsletter and resources for Solr beginners and intermediates:
http://www.solr-start.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Should schema API allow deleting uniqueKey?

Posted by Steve Rowe <sa...@gmail.com>.
I don't think we should allow deleting the uniqueKey field.  I'm surprised
it even works - I would have thought that there would be a schema validity
check: you shouldn't be able to specify a non-existent field as the
uniqueKey.  Note that the replace-field operation should be fine in this
case.

Schemaless makes the situation less clear-cut, since as you say the field
will be auto-created on first doc update containing the field, but even
then the schema will be effectively invalid in the interim.

On Wed, Nov 25, 2015 at 12:09 PM, Alexandre Rafalovitch <ar...@gmail.com>
wrote:

> I am testing 5.4 branch and was enjoying new UI for adding/removing
> fields in the schema.
>
> So, for a test of an error message, I decided to delete the ID field.
> And it let me. And then I indexed some files and the ID got recreated
> as a generic field.
>
> Should this be allowed or should delete field API check that we are
> not deleting the uniqueKey? I can kind of see it both ways.
>
> Regards,
>    Alex.
> ----
> Newsletter and resources for Solr beginners and intermediates:
> http://www.solr-start.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Re: Should schema API allow deleting uniqueKey?

Posted by Upayavira <uv...@odoko.co.uk>.

On Wed, Nov 25, 2015, at 05:09 PM, Alexandre Rafalovitch wrote:
> I am testing 5.4 branch and was enjoying new UI for adding/removing
> fields in the schema.
> 
> So, for a test of an error message, I decided to delete the ID field.
> And it let me. And then I indexed some files and the ID got recreated
> as a generic field.
> 
> Should this be allowed or should delete field API check that we are
> not deleting the uniqueKey? I can kind of see it both ways.

There's much damage can be done with the "delete field" button :-)

I think it makes sense to add a "are you sure you want to delete your
unique key?" warning to the UI, in 5.5.

We could actually add a check to see if the field has content, and warn
them before deleting a field with content. Those would both make lots of
sense.

Upayavira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org