You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by dmitri maziuk <dm...@gmail.com> on 2022/09/14 00:38:22 UTC

Can I force-delete a field?

Hi all,

apologies if this is a FAQ, my google-fu is failing me.

I've a field whose name I typo-ed in a data importer script, so Solr 
dutifully created the new TYPOed_field and a TYPOed_field_str as per my 
<dynamicField name="*_str" ... /> directive.

Now it won't let me delete either because "it's referred to by at least 
one copyfield directive".

Is there a way to force it? Or do I have to delete the dynamicField 
directive first, then the fields, and then re-create the dynamicField 
directive? Or something else?

(This is on 8.7)

TIA
Dima


Re: Can I force-delete a field?

Posted by Eric Pugh <ep...@opensourceconnections.com>.
I think you are definitly testing out a edge case scenario!   I think you are redoing all the steps….  The error message is there for a good reason…. What happens if you copyField and the target doesn’t exist…..




> On Sep 13, 2022, at 9:03 PM, Shawn Heisey <ap...@elyograg.org.INVALID> wrote:
> 
> On 9/13/22 18:38, dmitri maziuk wrote:
>> I've a field whose name I typo-ed in a data importer script, so Solr dutifully created the new TYPOed_field and a TYPOed_field_str as per my <dynamicField name="*_str" ... /> directive.
>> 
>> Now it won't let me delete either because "it's referred to by at least one copyfield directive".
>> 
>> Is there a way to force it? Or do I have to delete the dynamicField directive first, then the fields, and then re-create the dynamicField directive? Or something else?
> 
> I have no idea whether you have an option with an API call.  It sounds like there currently isn't a way, but I don't have much experience with the config-related APIs, so I could be wrong.
> 
> What I would do for this problem is manually edit the schema, re-upload the config to ZK if you're running Solr in cloud mode, and then either reload the collection/core or restart Solr.  I am used to manually editing configs already, though.
> 
> Thanks,
> Shawn
> 

_______________________
Eric Pugh | Founder & CEO | OpenSource Connections, LLC | 434.466.1467 | http://www.opensourceconnections.com <http://www.opensourceconnections.com/> | My Free/Busy <http://tinyurl.com/eric-cal>  
Co-Author: Apache Solr Enterprise Search Server, 3rd Ed <https://www.packtpub.com/big-data-and-business-intelligence/apache-solr-enterprise-search-server-third-edition-raw>	
This e-mail and all contents, including attachments, is considered to be Company Confidential unless explicitly stated otherwise, regardless of whether attachments are marked as such.


Re: Can I force-delete a field?

Posted by dmitri maziuk <dm...@gmail.com>.
On 2022-09-13 8:03 PM, Shawn Heisey wrote:
...
> What I would do for this problem is manually edit the schema, re-upload 
> the config to ZK if you're running Solr in cloud mode, and then either 
> reload the collection/core or restart Solr.  I am used to manually 
> editing configs already, though.

Thanks Shawn, but this is running "schemaless" -- which is why it just 
auto-creates fields for you whether you want them or not. I can drop the 
core and re-create from the initial schema.xml but I'll try a less 
disruptive way first.

Dima

Re: Can I force-delete a field?

Posted by Shawn Heisey <ap...@elyograg.org.INVALID>.
On 9/13/22 18:38, dmitri maziuk wrote:
> I've a field whose name I typo-ed in a data importer script, so Solr 
> dutifully created the new TYPOed_field and a TYPOed_field_str as per 
> my <dynamicField name="*_str" ... /> directive.
>
> Now it won't let me delete either because "it's referred to by at 
> least one copyfield directive".
>
> Is there a way to force it? Or do I have to delete the dynamicField 
> directive first, then the fields, and then re-create the dynamicField 
> directive? Or something else?

I have no idea whether you have an option with an API call.  It sounds 
like there currently isn't a way, but I don't have much experience with 
the config-related APIs, so I could be wrong.

What I would do for this problem is manually edit the schema, re-upload 
the config to ZK if you're running Solr in cloud mode, and then either 
reload the collection/core or restart Solr.  I am used to manually 
editing configs already, though.

Thanks,
Shawn