How to update one field without losing the others?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

How to update one field without losing the others?

Thiago
Hi people,

I'm trying to update one field of my solr database, but I update all the others fields. For example, if I have a record with the following fields id, name, address and phone and I try to update just id and address, the name and the phone vanishes. Is there any way to keep those fields in a update command? I've already searched this and I found this http://lucene.472066.n3.nabble.com/Update-Index-Updating-Specific-Fields-td506165.html and it tells that I can't do this without losing my fields, but it was posted in 2010. Is this functionality present in solr nowadays?

Thanks to everybody,

Thiago

Reply | Threaded
Open this post in threaded view
|

Re: How to update one field without losing the others?

Michael Della Bitta-2
There's no current provision for this. I would suggest downloading the
document, making your changes, and uploading the document again.

Michael Della Bitta

------------------------------------------------
Appinions, Inc. -- Where Influence Isn’t a Game.
http://www.appinions.com


On Sat, Jun 16, 2012 at 8:59 AM, Thiago <[hidden email]> wrote:

> Hi people,
>
> I'm trying to update one field of my solr database, but I update all the
> others fields. For example, if I have a record with the following fields id,
> name, address and phone and I try to update just id and address, the name
> and the phone vanishes. Is there any way to keep those fields in a update
> command? I've already searched this and I found this
> http://lucene.472066.n3.nabble.com/Update-Index-Updating-Specific-Fields-td506165.html
> http://lucene.472066.n3.nabble.com/Update-Index-Updating-Specific-Fields-td506165.html
> and it tells that I can't do this without losing my fields, but it was
> posted in 2010. Is this functionality present in solr nowadays?
>
> Thanks to everybody,
>
> Thiago
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-to-update-one-field-without-losing-the-others-tp3989959.html
> Sent from the Solr - User mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: How to update one field without losing the others?

Thiago
I'm already downloading the document and updating it with all the changes. I thought it had an easier way to do it.
Thanks for the information, Michael Della Bitta.

Thiago de Sousa Silveira
Reply | Threaded
Open this post in threaded view
|

Re: How to update one field without losing the others?

Yonik Seeley-2-2
In reply to this post by Thiago
Atomic update is a very new feature coming in 4.0 (i.e. grab a recent
nightly build to try it out).

It's not documented yet, but here's the JIRA issue:
https://issues.apache.org/jira/browse/SOLR-139?focusedCommentId=13269007&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13269007

-Yonik
http://lucidimagination.com
Reply | Threaded
Open this post in threaded view
|

Re: How to update one field without losing the others?

preetesh dubey
Just googled and found that this facility is available in DSE search. I
don't know much about DSE but pasting the link here if someone can
get benefit from it.

http://www.datastax.com/docs/datastax_enterprise2.0/search/dse_search_cluster#updating-individual-fields-in-a-solr-document


On Sat, Jun 16, 2012 at 8:17 PM, Yonik Seeley <[hidden email]>wrote:

> Atomic update is a very new feature coming in 4.0 (i.e. grab a recent
> nightly build to try it out).
>
> It's not documented yet, but here's the JIRA issue:
>
> https://issues.apache.org/jira/browse/SOLR-139?focusedCommentId=13269007&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13269007
>
> -Yonik
> http://lucidimagination.com
>



--
Thanks & Regards
Preetesh Dubey
Reply | Threaded
Open this post in threaded view
|

RE: How to update one field without losing the others?

Kai Gülzau
In reply to this post by Yonik Seeley-2-2
I'm currently playing around with a branch 4x Version (https://builds.apache.org/job/Solr-4.x/5/) but I don't get field updates to work.

A simple GET testrequest
http://localhost:8983/solr/master/update/json?stream.body={"add":{"doc":{"ukey":"08154711","type":"1","nbody":{"set":"mycontent"}}}}

results in
{
  "ukey":"08154711",
  "type":"1",
  "nbody":"{set=mycontent}"}]
}

All fields are stored.
ukey is the unique key :-)
type is a required field.
nbody is a solr.TextField.


Is there any (wiki/readme) pointer how to test and use these feature correctly?
What are the restrictions?

Regards,

Kai Gülzau

 
-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Yonik Seeley
Sent: Saturday, June 16, 2012 4:47 PM
To: [hidden email]
Subject: Re: How to update one field without losing the others?

Atomic update is a very new feature coming in 4.0 (i.e. grab a recent
nightly build to try it out).

It's not documented yet, but here's the JIRA issue:
https://issues.apache.org/jira/browse/SOLR-139?focusedCommentId=13269007&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13269007

-Yonik
http://lucidimagination.com
Reply | Threaded
Open this post in threaded view
|

Re: How to update one field without losing the others?

Sami Siren-2
On Mon, Jun 18, 2012 at 5:03 PM, Kai Gülzau <[hidden email]> wrote:

> I'm currently playing around with a branch 4x Version (https://builds.apache.org/job/Solr-4.x/5/) but I don't get field updates to work.
>
> A simple GET testrequest
> http://localhost:8983/solr/master/update/json?stream.body={"add":{"doc":{"ukey":"08154711","type":"1","nbody":{"set":"mycontent"}}}}
>
> results in
> {
>  "ukey":"08154711",
>  "type":"1",
>  "nbody":"{set=mycontent}"}]
> }
>
> All fields are stored.
> ukey is the unique key :-)
> type is a required field.
> nbody is a solr.TextField.

With the Solr example (4.x), the following seems to work:

URL=http://localhost:8983/solr/update
curl $URL?commit=true -H 'Content-type:application/json' -d '{ "add":
{ "doc": { "id": "id", "title": "test", "price_f": 10 }}}'
curl $URL?commit=true -H 'Content-type:application/json' -d '{ "add":
{ "doc": { "id": "id", "price_f": {"set": 5}}}}'

If you are using solrj then there's a junit test method,
testUpdateField(), that does something similar:

http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java?view=markup

--
 Sami Siren
Reply | Threaded
Open this post in threaded view
|

Re: How to update one field without losing the others?

librarymark
In reply to this post by Thiago
I run into the same problem, but a little different. Using SOLR 4.6.0. When I try to update a couple of fields, all my fields are intact except the text field that was populated from a PDF file. How do I keep the text there? I resorted to re-indexing everything, all 1.2 million records. Took forever.
Reply | Threaded
Open this post in threaded view
|

Re: How to update one field without losing the others?

Jack Krupansky-2
Is this a schema in when the text field is actually populated via
<copyField> from other fields?

Or maybe not, but the text field may not have been a stored field. It needs
to be one of the two.

-- Jack Krupansky

-----Original Message-----
From: librarymark
Sent: Saturday, June 14, 2014 10:40 AM
To: [hidden email]
Subject: Re: How to update one field without losing the others?

I run into the same problem, but a little different. Using SOLR 4.6.0. When
I
try to update a couple of fields, all my fields are intact except the text
field that was populated from a PDF file. How do I keep the text there? I
resorted to re-indexing everything, all 1.2 million records. Took forever.



--
View this message in context:
http://lucene.472066.n3.nabble.com/How-to-update-one-field-without-losing-the-others-tp3989959p4141843.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: How to update one field without losing the others?

librarymark
It is a stored field. It is the only one that gets dropped. It is text from a PDF that is streamed into SOLR.