Return-Path: Delivered-To: apmail-lucene-solr-dev-archive@locus.apache.org Received: (qmail 25351 invoked from network); 4 Feb 2007 16:13:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Feb 2007 16:13:27 -0000 Received: (qmail 69543 invoked by uid 500); 4 Feb 2007 16:13:33 -0000 Delivered-To: apmail-lucene-solr-dev-archive@lucene.apache.org Received: (qmail 69514 invoked by uid 500); 4 Feb 2007 16:13:33 -0000 Mailing-List: contact solr-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-dev@lucene.apache.org Received: (qmail 69504 invoked by uid 99); 4 Feb 2007 16:13:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Feb 2007 08:13:33 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Feb 2007 08:13:26 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D81E17142BF for ; Sun, 4 Feb 2007 08:13:05 -0800 (PST) Message-ID: <19292881.1170605585882.JavaMail.jira@brutus> Date: Sun, 4 Feb 2007 08:13:05 -0800 (PST) From: "Yonik Seeley (JIRA)" To: solr-dev@lucene.apache.org Subject: [jira] Commented: (SOLR-139) Support updateable/modifiable documents In-Reply-To: <30063871.1170576125525.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/SOLR-139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470064 ] Yonik Seeley commented on SOLR-139: ----------------------------------- I browsed the code really quick, looking for the tricky part... It's here: + openSearcher(); + Term t = new Term( uniqueKey.getName(), uniqueKey.getType().toInternal( id.toString() ) ); + int docID = searcher.getFirstMatch( t ); When you overwrite a document, it is really just adds another instance... so the index contains multiple copies. When we "commit", deletes of the older versions are performed. So you really want the *last* doc matching a term, not the first. Also, to need to make sure that the searcher you are using can actually "see" the last document (once a searcher is opened, it sees documents that were added since the last IndexWriter close(). So a quick fix would be to do a commit() first that would close the writer, and then delete any old copies of docments. Opening and closing readers and writers is *very* expensive though. You can get slightly more sophisticated by checking the pset (set of pending documents), and skip the commit() if the doc you are updating isn't in there (so you know an older searcher will still have the freshest doc for that id). We might be able to get more efficient yet in the future by leveraging NewIndexModifier: SOLR-124 > Support updateable/modifiable documents > --------------------------------------- > > Key: SOLR-139 > URL: https://issues.apache.org/jira/browse/SOLR-139 > Project: Solr > Issue Type: Improvement > Components: update > Reporter: Ryan McKinley > Attachments: SOLR-139-IndexDocumentCommand.patch, SOLR-139-IndexDocumentCommand.patch, SOLR-139-XmlUpdater.patch > > > It would be nice to be able to update some fields on a document without having to insert the entire document. > Given the way lucene is structured, (for now) one can only modify stored fields. > While we are at it, we can support incrementing an existing value - I think this only makes sense for numbers. > for background, see: > http://www.nabble.com/loading-many-documents-by-ID-tf3145666.html#a8722293 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.