Satuluri, Venu_Madhav wrote:
If you want this to work, the most elegant way I've found is to
override
the getBooleanQuery(Vector) method in QueryParser and insert a
MatchAllDocsQuery into the boolean query if every clause is
prohibited.
Daniel
I tried this, but it looks like the overridden
> Query at = new TermQuery(new Term("alwaysTrueField","true));
> Query user = queryParser.parse(userInput);
> if (user instanceof BooleanQuery) {
> BooleanQuery bq = (BooleanQuery)user;
> if (! usableBooleanQuery(bq)) {
> bq.add(at, true, false); /* add 'always true' clause
Satuluri, Venu_Madhav wrote:
Hi,
The following query does not work as expected for me:
"alwaysTrueField:true (-name:john)"
neither does this:
"alwaysTrueField:true +(-name:john)"
It returns zero results, despite there being many documents without name
john. (alwaysTrueField is, needless to say,
: The following query does not work as expected for me:
: "alwaysTrueField:true (-name:john)"
: neither does this:
: "alwaysTrueField:true +(-name:john)"
: Does lucene run a sub-query for each part of the query inside
: parentheses, which is why the NOT query that is alone doesn't work? I am
Bas
Hi,
The following query does not work as expected for me:
"alwaysTrueField:true (-name:john)"
neither does this:
"alwaysTrueField:true +(-name:john)"
It returns zero results, despite there being many documents without name
john. (alwaysTrueField is, needless to say, true for all documents).
This