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:[EMAIL PROTECTED]
Sent: Friday, May 28, 2004 1:14 PM
To: [EMAIL PROTECTED]
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:[EMAIL PROTECTED]
> Sent: Thursday, May 27, 2004 11:03 PM
> To: [EMAIL PROTECTED]
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]