lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <otis_gospodne...@yahoo.com>
Subject Re: FilteredQuery
Date Mon, 25 Aug 2008 17:38:40 GMT
Heiko,
It's most likely because that B case has a purely negative query. Perhaps you can combine
it with MatchAllDocs query?

 
Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----
> From: Heiko <heiko.mueller@giata.de>
> To: java-user@lucene.apache.org
> Sent: Monday, August 25, 2008 11:29:22 AM
> Subject: FilteredQuery
> 
> Hi All,
> 
> i would like to use the FilteredQuery to filter my search results with
> the occurrence or absence of certain ids.
> 
> Example A:
> query -> text:"albert einstein"
> filterQuery -> doctype:letter
> 
> That's ok. I am getting the expected results. But i got no results, if
> i  filter with the absence of an id.
> 
> Example B:
> query -> text:"albert einstein"
> filterQuery -> NOT doctype:article
> 
> However following concatenation of filterQuery and query leads to the
> expected result.
> 
> Example C:
> query -> text:"albert einstein"
> filterQuery -> text:"albert einstein" NOT doctype:article
> 
> I am confused that Example B does not worked. It is bug?
> 
> I am using Lucene 2.3.2 and the following code fragement:
> 
> Query query;
> Query filterQuery;
> ...
> Filter filter = new CachingWrapperFilter(new
> QueryWrapperFilter(filterQuery));
> FilteredQuery filteredQuery = new FilteredQuery(query, filter);
> Hits hits = searcher.search(filteredQuery);
> ...
> 
> Thanks,
> Heiko Müller
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
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