Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 2317 invoked from network); 11 May 2004 03:21:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 May 2004 03:21:20 -0000 Received: (qmail 32451 invoked by uid 500); 11 May 2004 03:22:01 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 32287 invoked by uid 500); 11 May 2004 03:22:00 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 32272 invoked by uid 98); 11 May 2004 03:21:59 -0000 Received: from paul@waite.net.nz by hermes.apache.org by uid 82 with qmail-scanner-1.20 (clamuko: 0.70. Clear:RC:0(203.79.71.204):. Processed in 0.179333 secs); 11 May 2004 03:21:59 -0000 X-Qmail-Scanner-Mail-From: paul@waite.net.nz via hermes.apache.org X-Qmail-Scanner: 1.20 (Clear:RC:0(203.79.71.204):. Processed in 0.179333 secs) Received: from unknown (HELO gandalf.lan.waite.net.nz) (203.79.71.204) by hermes.apache.org with SMTP; 11 May 2004 03:21:59 -0000 Received: from localhost ([127.0.0.1] ident=amavis) by gandalf.lan.waite.net.nz with esmtp (Exim 4.30 #1 (Debian)) id 1BNNpG-0000vK-Pm for ; Tue, 11 May 2004 15:21:02 +1200 Received: from gandalf.lan.waite.net.nz ([127.0.0.1]) by localhost (gandalf [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 03357-03 for ; Tue, 11 May 2004 15:20:57 +1200 (NZST) Received: from frodo.lan.waite.net.nz ([192.168.1.29] ident=paul) by gandalf.lan.waite.net.nz with esmtp (Exim 4.30 #1 (Debian)) id 1BNNpA-0000vE-Vi for ; Tue, 11 May 2004 15:20:56 +1200 From: Paul To: "Lucene Users List" Subject: Re: Mixing database and lucene searches Date: Tue, 11 May 2004 15:20:56 +1200 User-Agent: KMail/1.6.1 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200405111520.56888.paul@waite.net.nz> X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at waite.net.nz X-Spam-Rating: hermes.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Glen Stampoultzis wrote: > Hi... I have a query screen where most of the fields search a regular > database but one field searches for text in the body of the document. You > could say the database holds metadata about the documents. Effectively > this means I have two separate queries going on - a lucene query and a > database query. These results need to be combined. > > Anyone have any strategies for dealing with this? I'm wondering whether > it's better to replicate searchable fields in the lucene index. This means > being very careful that updates get done in two places so it is not ideal. First index your docs with all fields that are queried on, and storing the db key.For each query check the terms to see if the any non-metadata (Lucene) query data has been submitted, If so, run a Lucene query, and build a resultset of keys. If not, go straight to the database and do the same with a standard db query. The Lucene returns are then filled in with a database lookup for each doc in the returned resultset to provide metadata. Cheers, Paul. --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org