You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Roopesh Uniyal <ro...@gmail.com> on 2021/06/02 14:19:05 UTC

Updating partial value of a column field

Hello All,

I have 100 rows in my solr index and one of the column field is "URL".

All of it values starts with \\nas like url=\\nas\image\123.jpg

How can I update only the first word from the url? I need to update it from
\\nas\.. to \\FS\..

Thanks,
Roopesh

Re: Updating partial value of a column field

Posted by Roopesh Uniyal <ro...@gmail.com>.
Thanks Shawn & Walter.
I will restore DB and reindex it.

On Wed, Jun 2, 2021 at 7:55 PM Shawn Heisey <ap...@elyograg.org> wrote:

> On 6/2/2021 5:07 PM, Roopesh Uniyal wrote:
> > I was just wondering if there is a way to "replace" part of field value
> in
> > Solr. That would have helped me with the hassle of restoring DB from
> tapes,
> > updating DB, and then rebuilding full solr index.
>
> That kind of functionality is not available.  You would need to have
> something that can query the data, change it as necessary, and then
> reindex it.  And if your index does not meet the requirements for Atomic
> Update functionality (simple version is "all fields must be stored" but
> there are some nuances to it), then you wouldn't be able to do this,
> because any info in the index that doesn't appear in the search results
> would be lost.
>
> Reindexing is such a fundamental part of a production Solr setup that it
> is important that you are always able to fully reindex from scratch.
>
> Thanks,
> Shawn
>

Re: Updating partial value of a column field

Posted by Shawn Heisey <ap...@elyograg.org>.
On 6/2/2021 5:07 PM, Roopesh Uniyal wrote:
> I was just wondering if there is a way to "replace" part of field value in
> Solr. That would have helped me with the hassle of restoring DB from tapes,
> updating DB, and then rebuilding full solr index.

That kind of functionality is not available.  You would need to have 
something that can query the data, change it as necessary, and then 
reindex it.  And if your index does not meet the requirements for Atomic 
Update functionality (simple version is "all fields must be stored" but 
there are some nuances to it), then you wouldn't be able to do this, 
because any info in the index that doesn't appear in the search results 
would be lost.

Reindexing is such a fundamental part of a production Solr setup that it 
is important that you are always able to fully reindex from scratch.

Thanks,
Shawn

Re: Updating partial value of a column field

Posted by Roopesh Uniyal <ro...@gmail.com>.
Thanks for the inputs Walter.

I was just wondering if there is a way to "replace" part of field value in
Solr. That would have helped me with the hassle of restoring DB from tapes,
updating DB, and then rebuilding full solr index.

Thanks,
Roopesh

On Wed, Jun 2, 2021 at 5:49 PM Walter Underwood <wu...@wunderwood.org>
wrote:

> You will need access to the original data in order to change the schema or
> upgrade to a new major version. I recommend starting the work to get access
> to the original database.
>
> If your schema is set up to allow it, you may be able to use partial
> updates.
>
> https://solr.apache.org/guide/8_8/updating-parts-of-documents.html
>
> wunder
> Walter Underwood
> wunder@wunderwood.org
> http://observer.wunderwood.org/  (my blog)
>
> On Jun 2, 2021, at 2:07 PM, Roopesh Uniyal <ro...@gmail.com>
> wrote:
>
> In production, I have 300 million records. Secondly, I don't have access
> to the original database.
> So, I need to run this update in the current prod solr index for all rows.
>
> On Wed, Jun 2, 2021 at 12:29 PM Walter Underwood <wu...@wunderwood.org>
> wrote:
>
>> Reload all the content, especially with only 100 documents.
>>
>> Note, URLs do not use backslash. They use regular slashes. So your URL
>> path should probably be “/nas/image/23.jpg"
>>
>> wunder
>> Walter Underwood
>> wunder@wunderwood.org
>> http://observer.wunderwood.org/  (my blog)
>>
>> > On Jun 2, 2021, at 7:19 AM, Roopesh Uniyal <ro...@gmail.com>
>> wrote:
>> >
>> > Hello All,
>> >
>> > I have 100 rows in my solr index and one of the column field is "URL".
>> >
>> > All of it values starts with \\nas like url=\\nas\image\123.jpg
>> >
>> > How can I update only the first word from the url? I need to update it
>> from
>> > \\nas\.. to \\FS\..
>> >
>> > Thanks,
>> > Roopesh
>>
>>
>

Re: Updating partial value of a column field

Posted by Walter Underwood <wu...@wunderwood.org>.
You will need access to the original data in order to change the schema or upgrade to a new major version. I recommend starting the work to get access to the original database.

If your schema is set up to allow it, you may be able to use partial updates.

https://solr.apache.org/guide/8_8/updating-parts-of-documents.html <https://solr.apache.org/guide/8_8/updating-parts-of-documents.html>

wunder
Walter Underwood
wunder@wunderwood.org
http://observer.wunderwood.org/  (my blog)

> On Jun 2, 2021, at 2:07 PM, Roopesh Uniyal <ro...@gmail.com> wrote:
> 
> In production, I have 300 million records. Secondly, I don't have access to the original database. 
> So, I need to run this update in the current prod solr index for all rows.
> 
> On Wed, Jun 2, 2021 at 12:29 PM Walter Underwood <wunder@wunderwood.org <ma...@wunderwood.org>> wrote:
> Reload all the content, especially with only 100 documents.
> 
> Note, URLs do not use backslash. They use regular slashes. So your URL path should probably be “/nas/image/23.jpg"
> 
> wunder
> Walter Underwood
> wunder@wunderwood.org <ma...@wunderwood.org>
> http://observer.wunderwood.org/ <http://observer.wunderwood.org/>  (my blog)
> 
> > On Jun 2, 2021, at 7:19 AM, Roopesh Uniyal <roopesh.uniyal@gmail.com <ma...@gmail.com>> wrote:
> > 
> > Hello All,
> > 
> > I have 100 rows in my solr index and one of the column field is "URL".
> > 
> > All of it values starts with \\nas like url=\\nas\image\123.jpg
> > 
> > How can I update only the first word from the url? I need to update it from
> > \\nas\.. to \\FS\..
> > 
> > Thanks,
> > Roopesh
> 


Re: Updating partial value of a column field

Posted by Roopesh Uniyal <ro...@gmail.com>.
In production, I have 300 million records. Secondly, I don't have access to
the original database.
So, I need to run this update in the current prod solr index for all rows.

On Wed, Jun 2, 2021 at 12:29 PM Walter Underwood <wu...@wunderwood.org>
wrote:

> Reload all the content, especially with only 100 documents.
>
> Note, URLs do not use backslash. They use regular slashes. So your URL
> path should probably be “/nas/image/23.jpg"
>
> wunder
> Walter Underwood
> wunder@wunderwood.org
> http://observer.wunderwood.org/  (my blog)
>
> > On Jun 2, 2021, at 7:19 AM, Roopesh Uniyal <ro...@gmail.com>
> wrote:
> >
> > Hello All,
> >
> > I have 100 rows in my solr index and one of the column field is "URL".
> >
> > All of it values starts with \\nas like url=\\nas\image\123.jpg
> >
> > How can I update only the first word from the url? I need to update it
> from
> > \\nas\.. to \\FS\..
> >
> > Thanks,
> > Roopesh
>
>

Re: Updating partial value of a column field

Posted by Walter Underwood <wu...@wunderwood.org>.
Reload all the content, especially with only 100 documents.

Note, URLs do not use backslash. They use regular slashes. So your URL path should probably be “/nas/image/23.jpg"

wunder
Walter Underwood
wunder@wunderwood.org
http://observer.wunderwood.org/  (my blog)

> On Jun 2, 2021, at 7:19 AM, Roopesh Uniyal <ro...@gmail.com> wrote:
> 
> Hello All,
> 
> I have 100 rows in my solr index and one of the column field is "URL".
> 
> All of it values starts with \\nas like url=\\nas\image\123.jpg
> 
> How can I update only the first word from the url? I need to update it from
> \\nas\.. to \\FS\..
> 
> Thanks,
> Roopesh