Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 34511 invoked from network); 20 Nov 2007 15:57:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Nov 2007 15:57:10 -0000 Received: (qmail 86321 invoked by uid 500); 20 Nov 2007 15:56:50 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 86297 invoked by uid 500); 20 Nov 2007 15:56:50 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 86286 invoked by uid 99); 20 Nov 2007 15:56:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Nov 2007 07:56:50 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of erickerickson@gmail.com designates 64.233.182.187 as permitted sender) Received: from [64.233.182.187] (HELO nf-out-0910.google.com) (64.233.182.187) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Nov 2007 15:56:50 +0000 Received: by nf-out-0910.google.com with SMTP id d3so1619139nfc for ; Tue, 20 Nov 2007 07:56:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=NMQkk+hccxYOZOPniTrPzkib9ielHIjr1gRF9TYUZMc=; b=i351jd/bnhfa5WUdxdu37M2owXtD/cFvt+8mmSZLhEauebsFqBFZ/Dk+gqaUgvsnBj2iDSt4verxrNFeMjSHhXsuZcV/UTKpmj7xj9e1P5CXmS0/Yor1Lm8Cb5SaIYs8wHmIC2+uhBUQCENJUdpJy2Vu0DR+vQFCDacw9S5kVw8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=k+2SivYePsUc1cw6OfXFKc6YOhkJft4aLc07MdpaOL4CKf/rTfv/rQdwx440LChiarr/418U6OreGAKrMkV9k5ed8STb7xNljkBtxrBneisjW8K5V7Il9Jt7LtQ9kFVZaPXH93NoWXoSA3dETtMZtC/5M3mDKzAnc5mLEPsrBCY= Received: by 10.82.183.19 with SMTP id g19mr17587613buf.1195574188843; Tue, 20 Nov 2007 07:56:28 -0800 (PST) Received: by 10.82.155.11 with HTTP; Tue, 20 Nov 2007 07:56:28 -0800 (PST) Message-ID: <359a92830711200756t7005280bx4d2888f886a30c1e@mail.gmail.com> Date: Tue, 20 Nov 2007 10:56:28 -0500 From: "Erick Erickson" To: java-user@lucene.apache.org Subject: Re: Is storing 20 fields in a lucene document desirable? In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_18886_23706984.1195574188804" References: <13855272.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_18886_23706984.1195574188804 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline How are you doing your search? When you say "lucene is the bottleneck", that encompasses a lot. You really need to pinpoint things a bit more.... 1> are you iterating over the hits object for many docs? This is bad. 2> are you using a HitCollector and reading the doc each time you get to the collect method? This is bad. 3> Is it the *search* or the fetch that's eating the time? Time *just* the search call (making sure it doesn't go through a HitCollector) to answer this. 4> How many documents are you returning? 5? 5,000? the answer may tell us a lot. 5> are you opening a new reader each time you search? this is bad. 6> Have you looked over http://wiki.apache.org/lucene-java/ImproveSearchingSpeed? Before you try and implement an solution, you *must* figure out what operation is actually taking the time. an 8G index isn't that big, so I suspect that there's something else going on. What kind of throughput are you seeing? What do you need? Can you post some sample timings? Can you post some sample search code? I can't tell you how many times I've been *sure* I knew what the problem was, but in the process of analyzing the problem discovered that my real issue was something totally different..... Best Erick On Nov 20, 2007 7:21 AM, Grant Ingersoll wrote: > > On Nov 20, 2007, at 6:29 AM, kumarlimbu wrote: > > > > > Our document contains a total of 23 fields in one document and we > > STORE all > > of them in lucene index. > > > > We have recently had some performance issues and our analysis has > > shown the > > bottleneck to be lucene search and retrieval. > > Perhaps you can share your information on java-dev along with any > detailed tests, etc. so that we can see if there is anything we can > improve. > > > > > > > We have been thinking about reducing the number of fields per > > document by > > removing unnecessary fields and by merging fields with similar > > weightings. > > Will reducing the number of fields help to optimize performance? > > Yes > > > > > > > Another issue is we are currently retrieving around 9 fields after > > we do a > > search. Some are long text of up to 1000 words. Is it a large > > overhead to > > retrieve long fields? > > Yes. Are you using FieldSelector? Also, I would only STORE those > fields that you actually need to display, not all 23. Do you display > all 9 fields right away or are some only when you choose a document? > If so, try the Lazy Loading piece of FieldSelector. > > > > > > > We are considering the option of separating the search and retrieve > > parts so > > that Lucene performs the search, MYSQL stores the data. We just > > store the > > INDEXED field and primary key in the lucene index. After searching > > we only > > return 1 field (primary key) instead of 9 fields. This field will be > > used > > for retrieving the actual information from the MySQL database. Will > > reducing > > the number of fields retrieved from lucene reduce the response time > > or will > > using MySQL database make it worse? > > Hard to say, you will likely have to try it out. > > > > > > > So our main concern is to find if retrieving fields usually takes > > longer > > than searching or not? What does lucene spend most time doing =96 > > search or > > retrieval? We are also concerned that using MySQL will have > > performance > > issues because we will be doing I/O for MySQL as well as Lucene. We > > also add > > around 100k documents each day and remove around the same number of > > documents. Will this frequent read and write have impact on > > performance? > > > > What version of Lucene are you using? Naturally, if you are updating > things that will have an effect, but that may not be a factor. I > would check out http://wiki.apache.org/lucene-java/BasicsOfPerformance > > Also, you may want to try out (not in production) the trunk version of > Lucene. > > Last, but not least, do you have some sort of cache for your > Documents? Obviously, you need to have appropriate semantics for when > the underlying docs change, but using a cache makes sense, too. > > -Grant > > > -------------------------- > Grant Ingersoll > http://lucene.grantingersoll.com > > Lucene Helpful Hints: > http://wiki.apache.org/lucene-java/BasicsOfPerformance > http://wiki.apache.org/lucene-java/LuceneFAQ > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > ------=_Part_18886_23706984.1195574188804--