Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 76634 invoked from network); 3 Nov 2006 05:32:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Nov 2006 05:32:15 -0000 Received: (qmail 1974 invoked by uid 500); 3 Nov 2006 05:32:24 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 917 invoked by uid 500); 3 Nov 2006 05:32:21 -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 896 invoked by uid 99); 3 Nov 2006 05:32:21 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Nov 2006 21:32:21 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of chris.lu@gmail.com designates 64.233.182.185 as permitted sender) Received: from [64.233.182.185] (HELO nf-out-0910.google.com) (64.233.182.185) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Nov 2006 21:32:09 -0800 Received: by nf-out-0910.google.com with SMTP id n29so41148nfc for ; Thu, 02 Nov 2006 21:31:47 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=AzXHUOhhzmR7ZZWPc454/m5cbv57rZufaK0Vy6k2BzWXkySexULUYiTefSufDkbiKaU0LPHfzhK5TIMWNTa8zv4Pwmw+wQxLU/zD5wkW49isSK7PZx5c8YxN/VwAZk07nj4B8el6o0fAfKvmKFUYYzrqy3HkbutJagq5fpzpGoQ= Received: by 10.82.153.5 with SMTP id a5mr617184bue.1162531907060; Thu, 02 Nov 2006 21:31:47 -0800 (PST) Received: by 10.82.131.8 with HTTP; Thu, 2 Nov 2006 21:31:47 -0800 (PST) Message-ID: <6e3ae6310611022131n4cd2d73dr149404944f6958ff@mail.gmail.com> Date: Thu, 2 Nov 2006 21:31:47 -0800 From: "Chris Lu" To: java-user@lucene.apache.org Subject: Re: Modelling relational data in Lucene Index? In-Reply-To: <20061103042202.96427.qmail@web52008.mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20061103042202.96427.qmail@web52008.mail.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, Rajesh, You can use space as , by use WhitespaceAnalyzer. By detached mode, I mean the search function and your java system should be kind of logically separated. From the technical side, a separated search server will be more scalable. From the business side, searching is more like an add-on rather than a must-have. And users will have new different requirements to query the content. -- Chris Lu ------------------------- Instant Full-Text Search On Any Database/Application site: http://www.dbsight.net demo: http://search.dbsight.com On 11/2/06, Rajesh parab wrote: > Thanks for feedback Chris. > > I agree with you. The data set should be flattened out to store inside Lucene index. The Folder-File was just an example. As you know, in relational database, we can have more complex relationships. I understand that this model may not work for deeper relationships. > > What I am mainly interested in is just one level deep relationship. But, I would like to search on the additional attributes of the related object. For example, in the relationship for Folder-File, I would like to use additional file attributes as search criteria along with file name while searching for folders. > > The way I see is having single filed for the related object and all its additional attributes and use some separator while capturing this data inside Lucene Field object. For example - > > new Field("file", "abc.txtimage"); > > But, I am not quite sure if this model will work. > > BTW. I did not understand what you meant by the detached approach. Can you please elaborate? > > Regards, > Rajesh > > ----- Original Message ---- > From: Chris Lu > To: java-user@lucene.apache.org > Sent: Thursday, November 2, 2006 7:57:46 PM > Subject: Re: Modelling relational data in Lucene Index? > > > For this specific question, you can create index on files, search > files that of type image, and from matched files, find the unique > directories(can be done in lucene or you can do it via java). > > Of course this does not scale to deeper relationships. Usually you do > need to flattern the database objects in order to use lucene. It's > just trading space for speed. > > I would prefer a detached approach instead of Hibernate or EJB's > approach, which is kind of too tightly coupled with any system. How to > rebuild if the index is corrupted, or you have a new Analyzer, or > schema evolves? How to make it multi-thread safe? > > -- > Chris Lu > ------------------------- > Instant Full-Text Search On Any Database/Application > site: http://www.dbsight.net > demo: http://search.dbsight.com > > On 11/2/06, Mark Miller wrote: > > Lucene is probably not the solution if you are looking for a relational > > model. You should be using a database for that. If you want to combine > > Lucene with a relational model, check out Hibernate and the new EJB > > annotations that it supports...there is a cool little Lucene add-on that > > lets you declare fields to be indexed (and how) with annotations. > > > > - Mark > > > > Rajesh parab wrote: > > > Hi, > > > > > > As I understand, Lucene has a flat structure where you can define multiple fields inside the document. There is no relationship between any field. > > > > > > I would like to enable index based search for some of the components inside relational database. For exmaple, let say "Folder" Object. The Folder object can have relationship with File object. The File object, in turn, can have attributes like is image, is text file, etc. So, the stricture is > > > > > > Folder -- > File > > > | > > > ------- > is image, is text file, ...... > > > > > > > > > I would like to enable a search to find a Folder with File of type image. How can we model such relational data inside Lucene index? > > > > > > Regards, > > > Rajesh > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > > > For additional commands, e-mail: java-user-help@lucene.apache.org > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > > For additional commands, e-mail: java-user-help@lucene.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org