lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yousef Ourabi <your...@gmail.com>
Subject Nested Boolean Query
Date Thu, 30 Jun 2005 23:43:51 GMT
Hello:
I have two fields in my document a title, term and content. I want to
programatically create a query that will return all documents that has
both title AND content. I created a boolean query that looks like
this. The logican return I want are any documents that Must have the
alias passed to AliasQuery, and the query passed also shows up in a
field that has that alias. Basically filtering all documents of
alias=X with term = Y. Does this look right?

What I am getting are all documents by the alias (aliasQuery) orderd
by the search term, but also documents that don't have the query.

BooleanQuery termSearch = new BooleanQuery();
BooleanQuery combinedQuery = new BooleanQuery();
			
			
termSearch.add(termQuery, false, false);
termSearch.add(tittleQuery, false, false);
			
combinedQuery.add(aliasQuery, true, false);
combinedQuery.add(termSearch,false,false);


Best,
Yousef

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