Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 72776 invoked from network); 19 Dec 2001 15:14:14 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 19 Dec 2001 15:14:14 -0000 Received: (qmail 9586 invoked by uid 97); 19 Dec 2001 15:12:28 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@jakarta.apache.org Received: (qmail 9376 invoked by uid 97); 19 Dec 2001 15:12:17 -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 9123 invoked from network); 19 Dec 2001 15:12:13 -0000 Message-ID: <155901c1889e$cdc47860$0102000a@cardiweb.com> From: "Mike Baroukh" To: "Lucene Users List" References: <003b01c184a6$66c3cc70$0102000a@cardiweb.com> <10431240521.20011214174248@mail.ru> <005f01c184c4$102ff780$0102000a@cardiweb.com> <52260440.20011217094352@mail.ru> <149701c18884$4b52e930$0102000a@cardiweb.com> Subject: Re: IndexReader/IndexSearcher Date: Wed, 19 Dec 2001 16:06:58 +0100 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 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Spam-Rating: 64.125.133.20 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I reply to myself : It seem that when using IndexReader, keywords must be lower case. So, I indexed BO23, I can search BO23 with IndexSearcher, but I must use bo23 to search with IndexReader. Am I right ? Mike ----- Original Message ----- From: "Mike Baroukh" To: "Lucene Users List" Sent: Wednesday, December 19, 2001 12:57 PM Subject: IndexReader/IndexSearcher > > Hi all. > > Can somebody tell me where is my error. > There is something I don't understand. > > If I search something with > > IndexReader indexReader = IndexReader.open("/myindex"); > TermDocs docs = indexReader.termDocs(new Term("codman", "BO23")); > while ( (docs!=null) && (docs.next()) ) { > nbis++; > } > if (docs!=null) docs.close(); > indexReader.close(); > > I see that nbis = 0 so temDocs returned nothing. > > But, If I use > > SimpleAnalyzer analyzer = new SimpleAnalyzer(); > IndexSearcher indexSearcher = new IndexSearcher("/myindex"); > Query query = QueryParser.parse("BO23", "codman", analyzer); > Hits hits = indexSearcher.search(query); > nbis = hits.length(); > > It's exactly the same query, the same index but this time, it return 1 > document. > > I don't understand where this difference came from ? > I know that the firs way is not the good way of searching but what I wan't > is to delete from the index the document returned wy the search #2. > > Thanks in advance for any help. > > Mike > > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: > > -- To unsubscribe, e-mail: For additional commands, e-mail: