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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to