Hi,
I'm writing a mapping mechanism between an existing search interface and Lucene
and wondered how to support a single NOT/- query.
Given the query "-attribute", then from an ealier comment by Chris Hostetter
where he says "you can't have a negative clause in isolation by itself", I
assume
Antony Bowesman wrote:
Hi,
I'm writing a mapping mechanism between an existing search interface and
Lucene and wondered how to support a single NOT/- query.
Given the query "-attribute", then from an ealier comment by Chris
Hostetter where he says "you can't have a negative clause in isolati
On Tuesday 21 November 2006 23:14, Antony Bowesman wrote:
> I
> assume that you first have to create a BooleanClause that finds
> everything and then another Clause that removes the "attribute".
>
> Is this right or is there another way to do it?
That's correct. For the "find everything" part yo
Daniel Naber wrote:
That's correct. For the "find everything" part you can use
MatchAllDocsQuery.
Thanks - I hadn't noticed that Query.
Antony
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMA
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
: 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
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,
> 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:
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