Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 10476 invoked from network); 24 Apr 2004 12:51:13 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 24 Apr 2004 12:51:13 -0000 Received: (qmail 32350 invoked by uid 500); 24 Apr 2004 12:51:06 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 32052 invoked by uid 500); 24 Apr 2004 12:51:04 -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 32019 invoked from network); 24 Apr 2004 12:51:03 -0000 Received: from unknown (HELO services.india.aalayance.com) (203.200.48.226) by daedalus.apache.org with SMTP; 24 Apr 2004 12:51:03 -0000 Received: from ajitendra (unknown [192.168.1.141]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by services.india.aalayance.com (Postfix) with ESMTP id B63DAC187C for ; Sat, 24 Apr 2004 18:21:02 +0530 (IST) Message-ID: <01fb01c429fa$5c1158a0$8d01a8c0@india.aalayance.com> From: "jitender ahuja" To: "Lucene Users List" References: <20040422170815.61876.qmail@web12706.mail.yahoo.com> <008601c42897$5ff7bae0$6204100a@INFXINC.NET> Subject: Re: Doing a join? Date: Sat, 24 Apr 2004 18:17:52 +0530 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, I feel by different files u mean two different sub directories under a common folder(i.e. directory). Now, one stores 3 fields and another one stores 2 fields. Also, the class_Id or Class_Name(file 1) and the Student_Id fields(file 2) should be indexed and stored in the index. You need to have your own code for implementing the same, that will perform the search. The code snippet below, I feel if included in ur own searcher code would provide results on the command line. Also, I have not tested it but in case of problem, pl. send me a small sample database of the two tables to be indexed( and not the index files) or something similar one. Regards, Jitender code: ======== String searchStr=null; ArrayList results = new ArrayList(); ArrayList results1 = new ArrayList(); Searcher indexSrch = new IndexSearcher("file1");//"file1" is the file that stores the 3 fields Analyzer analyzer = new StandardAnalyzer(); Query query = QueryParser.parse(searchStr, "Class_Id", analyzer); Hits hits = indexSrch.search(query); for( int i=0; i To: "Lucene Users List" Sent: Thursday, April 22, 2004 11:56 PM Subject: Doing a join? > Is it possible to do a join on two fields when searching a Lucene Index. > For example, I have an index of documents that have a "StudentName" and a > "StudentId" field and another document that has "ClassId", "ClassName" and > "StudentId". I want to do a search on "ClassId" or "ClassName" and get a > list of "StudentName". Both of these documents are in one index, but are > loaded from seperate files, so I can't join at creation time. Any help is > greatly appreciated. > > Rob > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: lucene-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: lucene-user-help@jakarta.apache.org