Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9A8EB2E68 for ; Wed, 27 Apr 2011 11:56:19 +0000 (UTC) Received: (qmail 27919 invoked by uid 500); 27 Apr 2011 11:56:16 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 27870 invoked by uid 500); 27 Apr 2011 11:56:16 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 27862 invoked by uid 99); 27 Apr 2011 11:56:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Apr 2011 11:56:16 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of erickerickson@gmail.com designates 209.85.216.48 as permitted sender) Received: from [209.85.216.48] (HELO mail-qw0-f48.google.com) (209.85.216.48) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Apr 2011 11:56:10 +0000 Received: by qwj9 with SMTP id 9so995425qwj.35 for ; Wed, 27 Apr 2011 04:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=4kJvP4imZvH9nhQod6IOsMazRho/JC9Lr2vwjjjdkD0=; b=snMm2r+H6NLfax4ADn/o881ya98vSc12NMDAlIPS+mhVAdFdRCuuiOYnFUECGIMXWE /7rKyEKIa+bBUBhDm3DQpQfCu9XV/gQzt35GoIiuknZ2VZVpR/uwQD2bZgqFd/UIkgav daC1LxaPJFnZRRo3FrYhaB30XiQHxrbLy6dwg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=uNwd81X76xXfv/ftcEE+DmAH6fBt0Y6SSCXdhH3kkH+JFz7yNe0IHudbdp2wW64cCY 2GbrI7ysAfwlJIc4vTrJyYYUSF6kzVkc8f32uAjFTmI2CZkA/a3hW7uIyzihezbT8m1P 4sH6MXsBm2I5JjJ1+M/7KMOWE6q2mmFJNnOFk= MIME-Version: 1.0 Received: by 10.229.105.153 with SMTP id t25mr1624138qco.123.1303905349560; Wed, 27 Apr 2011 04:55:49 -0700 (PDT) Received: by 10.229.245.81 with HTTP; Wed, 27 Apr 2011 04:55:49 -0700 (PDT) In-Reply-To: References: <499870.45881.qm@web120613.mail.ne1.yahoo.com> Date: Wed, 27 Apr 2011 07:55:49 -0400 Message-ID: Subject: Re: How to Update Value of One Field of a Document in Index? From: Erick Erickson To: solr-user@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable (2) isn't viable. Updating a multiValued field is the same as any other fie= ld, 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: https://issues.apache.org/jira/browse/SOLR-2272 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 notes= docs wouldn't have a "body" field. You'd have to take some care that the 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. Best Erick 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 h= ave to re-index the document (since the body field may contain 100MB of tex= t). =A0Some ideas: > > 1) How about creating another core which only contains id, checksum, and = notes? =A0Then, "updating" (delete followed by add) wouldn't be that painfu= l? > > 2) What about using a multValued field? =A0Could you just keep adding val= ues 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. =A0This >> 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. =A0My code is working. =A0Now, = I want to >>> update the value of one of the fields of a document in the solr index a= fter the >>> document was already indexed, and I have only the document id. =A0How d= o I do >>> that? >>> >>> Thanks. >>> >>> >>> > >