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 8BF51E413 for ; Fri, 8 Mar 2013 23:59:00 +0000 (UTC) Received: (qmail 35079 invoked by uid 500); 8 Mar 2013 23:58:57 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 35024 invoked by uid 500); 8 Mar 2013 23:58:56 -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 35016 invoked by uid 99); 8 Mar 2013 23:58:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Mar 2013 23:58:56 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of SRS0=e5hllp=M4=basetechnology.com=jack@yourhostingaccount.com designates 65.254.254.80 as permitted sender) Received: from [65.254.254.80] (HELO mailout06.yourhostingaccount.com) (65.254.254.80) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Mar 2013 23:58:51 +0000 Received: from mailscan21.yourhostingaccount.com ([10.1.15.21] helo=mailscan21.yourhostingaccount.com) by mailout06.yourhostingaccount.com with esmtp (Exim) id 1UE7BH-0006Np-38 for solr-user@lucene.apache.org; Fri, 08 Mar 2013 18:58:31 -0500 Received: from impout01.yourhostingaccount.com ([10.1.55.1] helo=impout01.yourhostingaccount.com) by mailscan21.yourhostingaccount.com with esmtp (Exim) id 1UE7BG-0003tL-Sa for solr-user@lucene.apache.org; Fri, 08 Mar 2013 18:58:30 -0500 Received: from authsmtp14.yourhostingaccount.com ([10.1.18.14]) by impout01.yourhostingaccount.com with NO UCE id 9ByW1l0070JCsUy01ByWNX; Fri, 08 Mar 2013 18:58:30 -0500 X-Authority-Analysis: v=2.0 cv=EJGEIilC c=1 sm=1 a=UdCbmyego4VUa/xJBgcoFg==:17 a=aQzbgH187woA:10 a=6tO-gIgaRbQA:10 a=3jZET7lWBKwA:10 a=8nJEP1OIZ-IA:10 a=jvYhGVW7AAAA:8 a=U8VShbtVeKUA:10 a=mV9VRH-2AAAA:8 a=5xm2zCbRAAAA:8 a=Y8_Vuajomj7-0jdZB0gA:9 a=wPNLvfGTeEIA:10 a=Qie4vLqxJHYA:10 a=rcbtdQGuPFtN9R+ZKREELQ==:117 X-EN-OrigOutIP: 10.1.18.14 X-EN-IMPSID: 9ByW1l0070JCsUy01ByWNX Received: from 207-237-114-232.c3-0.nyr-ubr1.nyr.ny.cable.rcn.com ([207.237.114.232] helo=JackKrupansky) by authsmtp14.yourhostingaccount.com with esmtpa (Exim) id 1UE7BG-0007cW-KM for solr-user@lucene.apache.org; Fri, 08 Mar 2013 18:58:30 -0500 Message-ID: From: "Jack Krupansky" To: References: <1362780470.1460.140661201894861.46162020@webmail.messagingengine.com> In-Reply-To: Subject: Re: update some fields vs replace the whole document Date: Fri, 8 Mar 2013 18:58:27 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3555.308 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308 X-EN-UserInfo: e0a4b55451ed9f27313ebf02e3d4348d:fc4a93e1349e680c52bdd723c0ab3ef6 X-EN-AuthUser: jack@basetechnology.com Sender: "Jack Krupansky" X-EN-OrigIP: 207.237.114.232 X-EN-OrigHost: 207-237-114-232.c3-0.nyr-ubr1.nyr.ny.cable.rcn.com X-Virus-Checked: Checked by ClamAV on apache.org Generally it will be more a matter of application semantics. Solr makes it reasonably efficient to completely overwrite the existing document and fields, if that is what you want. But, in some applications, it may be desirable to preserve some or most of the existing fields; whether that is easier to accomplish be completely regenerating the full document from data stored elsewhere in the application (e.g., a RDBMS) or doing a selective write will depend on the application. In some apps, the rest of the data may not be maintained separately, so a selective write makes more sense. Or, maybe the existing document contains metadata fields such as timestamps or counters that would get reset if the whole document was regenerated. -- Jack Krupansky -----Original Message----- From: Mingfeng Yang Sent: Friday, March 08, 2013 5:41 PM To: solr-user@lucene.apache.org Subject: Re: update some fields vs replace the whole document Then what's the difference between adding a new document vs. replacing/overwriting a document? Ming- On Fri, Mar 8, 2013 at 2:07 PM, Upayavira wrote: > With an atomic update, you need to retrieve the stored fields in order > to build up the full document to insert back. > > In either case, you'll have to locate the previous version and mark it > deleted before you can insert the new version. > > I bet that the amount of time spent retrieving stored fields is matched > by the time saved by not having to transmit those fields over the wire, > although I'd be very curious to see someone actually test that. > > Upayavira > > On Fri, Mar 8, 2013, at 09:51 PM, Mingfeng Yang wrote: > > Generally speaking, which has better performance for Solr? > > 1. updating some fields or adding new fields into a document. > > or > > 2. replacing the whole document. > > > > As I understand, update fields need to search for the corresponding doc > > first, and then replace field values. While replacing the whole > > document > > is just like adding new document. Is it right? >