lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bhavin Pandya" <bhav...@rediff.co.in>
Subject Re: ChainedFilter
Date Sat, 23 Sep 2006 09:06:57 GMT
Hi guys,

Its is solved now....
I come to know that "If you are ANDing/ORing FilteredQuery with say 
BooleanQuery then Its not giving proper result so i added that BooleanQuery 
before creating FilteredQuery"
May be i am wrong...but i changed the sequence of my queries ...and now its 
working...
- Bhavin pandya

----- Original Message ----- 
From: "Bhavin Pandya" <bhavinp@rediff.co.in>
To: <java-user@lucene.apache.org>
Sent: Saturday, September 23, 2006 12:06 PM
Subject: ChainedFilter


Hi,

I am using ChainedFilter and FilteredQuery together in order to remove 
RangeQuery from my code.
the problem is its not working..its effect is not coming...it returns me 
same number of record whether i am including range or not.
Here is the snippet.


                    BooleanQuery bqone = "coming from parent function; it 
booleanQuery of few termsQuery"
                    RangeFilter rf[] = new RangeFilter[2];
                    rf[0]=new RangeFilter("RANGEFIELD1", 20, 30 , 
true,true);
                    rf[1]=new RangeFilter("RANGEFIELD2", 20, 30 , 
true,true);
                    isChanged = true;

                    ChainedFilter cf = new 
ChainedFilter(rf,ChainedFilter.AND);
                    fq=new FilteredQuery(bqone,cf);

                    Hits hits = searcher.search(fq);


Actually data is splitted across two columns ( RANGEFIELD1 and RANGEFIELD2 ) 
on which i want to fire range. e.g give me all records which is between 20 
and 30.
so i have created two filter and passed it to chainedfilter...
but its not working ...i dont know what i m missing.... is there any better 
way to implement this...?

Thanks.
Bhavin pandya


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message