Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@www.apache.org Received: (qmail 52839 invoked from network); 28 May 2004 08:47:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 28 May 2004 08:47:31 -0000 Received: (qmail 14031 invoked by uid 500); 28 May 2004 08:47:53 -0000 Delivered-To: apmail-jakarta-lucene-user-archive@jakarta.apache.org Received: (qmail 13938 invoked by uid 500); 28 May 2004 08:47:51 -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 13820 invoked by uid 98); 28 May 2004 08:47:50 -0000 Received: from karthik@controlnet.co.in by hermes.apache.org by uid 82 with qmail-scanner-1.20 (clamuko: 0.70. Clear:RC:0(203.199.26.74):. Processed in 0.704874 secs); 28 May 2004 08:47:50 -0000 X-Qmail-Scanner-Mail-From: karthik@controlnet.co.in via hermes.apache.org X-Qmail-Scanner: 1.20 (Clear:RC:0(203.199.26.74):. Processed in 0.704874 secs) Received: from unknown (HELO daakghar.controlnet.co.in) (203.199.26.74) by hermes.apache.org with SMTP; 28 May 2004 08:47:49 -0000 Received: from karthik ([192.168.4.1]) by dakiya.controlnet.co.in (Netscape Messaging Server 4.15) with ESMTP id HYF29400.UGX for ; Fri, 28 May 2004 14:28:16 +0530 From: "Karthik N S" To: "Lucene Users List" Subject: Range Query Sombody HELP please Date: Fri, 28 May 2004 14:24:41 +0530 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <200405280943.56293.ykingma@xs4all.nl> X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal 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 Hey ype Thx for the advice but still I need to get the exact situation working , 1) I have a unique Field [ called filename ] which is indexed of type Text. It accepts the name of the HTML files as the indexing parameter , Also there is another Field called "Contents" which stores all the contents of that indicated unique named html file. 2) The indexer complete indexes for about 5000 html files sucessfully . 3) When I do a search for word ,it returns a hit of 400 on various html files Now in this situation if I want to limit the hits between First 200 to 400 html Page Names only what exactly should I do to using getRange() method. Please advise on how to proceed ... with regards Karthik -----Original Message----- From: Ype Kingma [mailto:ykingma@xs4all.nl] Sent: Friday, May 28, 2004 1:14 PM To: lucene-user@jakarta.apache.org Subject: Re: Range Query Sombody HELP please Karthik, On Friday 28 May 2004 05:54, Karthik N S wrote: ... > Weh we do a search in SQL using '*' we all know that the result would be > total no of records in the table,but when we want to get limit our record > we apply range between 2 specific row records [Which we call it as > subsearch] > > > Similarly on a indexed record I would like perform the same tecnique > as above. In case you need to reuse the limitation a filter is the way to go in Lucene. However it seems to be better to get the range query working first. > In fact I was looking at the url u sent me in the last mail on using > getRange Queries > and was working on the same > > http://jakarta.apache.org/lucene/docs/queryparsersyntax.html The query I gave uses two +'s prefixed to the query parts: +search_word +(book:[100 TO 200]) Both query parts are required because of the +'s, ie. it works as the AND operator in SQL. The TO operator queries the range in the book field. > and > > http://today.java.net/pub/a/today/2003/11/07/QueryParserRules.html > > but witou results for the last 12 hrs. You have probably seen a lot of different things that will be useful later. > If u could spare a few minuts and please expalin or provide a simple [ > full ] example using and > over riding the getRange() method . The problem you'll probably run into is that Lucene does not support numbers directly, you'll have to index them as strings, eg. by prefixing zero's: As Erik indicated:�http://wiki.apache.org/jakarta-lucene/SearchNumericalFields You may have to reindex your data for this. In case you have a lot of data consider setting up a test first. Then in the getRangeQuery() method of your parser you'll need to prefix the queried numbers in the same way. The example in the article is about date fields, but the adaptation to numbers shouldn't be a problem. When you override this in your query parser: getRangeQuery(String field, Analyzer analyzer, String start, String end, boolean inclusive) it will be called for the example query with start = "100" and end = "200". (See http://today.java.net/pub/a/today/2003/11/07/QueryParserRules.html under Customizing query parser). In the overriding method you can then call the super method with the start and end prefixed with zero's as indicated in searching numerical fields referred to above. Have fun, you'll get it working, Ype > with regards > Karthik > > -----Original Message----- > From: Ype Kingma [mailto:ykingma@xs4all.nl] > Sent: Thursday, May 27, 2004 11:03 PM > To: lucene-user@jakarta.apache.org > Subject: Re: Range Query Sombody HELP please > > On Thursday 27 May 2004 09:37, Karthik N S wrote: > > Hi > > Lucene -Developer My main intention was > > > > Search for an word hit in a Unique Field between ranges say > > book100 - book 200 indexed numbers > > It's something like creating a SUBSEARCH with in the SEARCHINDEX. ... > Could you explain what you mean by subsearch? > I suppose you might want to have a look at the various filter classes > in the org.apache.lucene.search package. > > Regards, > Ype > > > --------------------------------------------------------------------- > 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 --------------------------------------------------------------------- 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