lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <>
Subject Re: How to Update Value of One Field of a Document in Index?
Date Wed, 27 Apr 2011 11:55:49 GMT
(2) isn't viable. Updating a multiValued field is the same as any other field, a
    delete followed by an add of the entire document.
(1) could work. The problem here is how you need to search. If you need
    to search your notes it would be separate from the document. In other
    words, you couldn't form a query like
    "+body:(body text of interest) + notes:(stuff I put in my notes)
    You could search for each independently, but not both together.

There's the "limited join" patch, see:
that hasn't been applied  yet that *might* help. A variant of (1) is
that there's
really no need to have two separate cores. Documents in Solr don't need to all
have the same fields. So you could have, say, two types of documents,
"fulldoc" and "notesdoc". Fulldocs wouldn't have a "notes" field, and notesdocs
wouldn't have a "body" field. You'd have to take some care that the <uniqueKey>
was different for the two different types of documents. That might
work with 2272.
Warning: I haven't played with that patch, so caveat emptor.


On Wed, Apr 27, 2011 at 12:35 AM, Peter Spam <> wrote:
> My schema: id, name, checksum, body, notes, date
> I'd like for a user to be able to add notes to the notes field, and not have to re-index
the document (since the body field may contain 100MB of text).  Some ideas:
> 1) How about creating another core which only contains id, checksum, and notes?  Then,
"updating" (delete followed by add) wouldn't be that painful?
> 2) What about using a multValued field?  Could you just keep adding values as the user
enters more notes?
> Pete
> On Sep 9, 2010, at 11:06 PM, Liam O'Boyle wrote:
>> Hi Savannah,
>> You can only reindex the entire document; if you only have the ID,
>> then do a search to retrieve the rest of the data, then reindex.  This
>> assumes that all of the fields you need to index are stored (so that
>> you can retrieve them) and not just indexed.
>> Liam
>> On Fri, Sep 10, 2010 at 3:29 PM, Savannah Beckett
>> <> wrote:
>>> I use nutch to crawl and index to Solr.  My code is working.  Now, I want to
>>> update the value of one of the fields of a document in the solr index after the
>>> document was already indexed, and I have only the document id.  How do I do
>>> that?
>>> Thanks.

View raw message