java-user@lucene.apache.org
Subject: Re: how to remove the dash
Most query parsers will "parse" a leading hyphen as an operator, so it will
never get to the analyzer for any field. Whether white space is permitted
between the "-" operator and the following term is dependent on the specific
qu
t before
parsing it. Or, consider using a simple term query that does no query
"parsing", but does pass the term through the field analyzer for the desired
field type.
-- Jack Krupansky
-Original Message-
From: lis...@alphamatrix.org
Sent: Monday, June 25, 2012 4:1
More information...
If I change
System.out.println("Query: " + query.toString("contents"));
to this:
System.out.println("Query: " + query.toString());
I get this result:
"Query: contents:bebidas -contents:agua"
As I already tried many diferent Analyzers and I always get the same
result maybe it's
m: lis...@alphamatrix.org [mailto:lis...@alphamatrix.org]
> Sent: Monday, June 25, 2012 11:33 AM
> To: java-user@lucene.apache.org
> Subject: Re: how to remove the dash
>
> A Segunda, 25 de Junho de 2012 16:10:38 Ian Lea escreveu:
> > My apologies - you are right.
> >
>
[]{"drinks", "water"});
}
So I'm not seeing the same behavior as you guys - the hyphen is not part of any
emitted token.
Steve
-Original Message-
From: lis...@alphamatrix.org [mailto:lis...@alphamatrix.org]
Sent: Monday, June 25, 2012 11:33 AM
To: java-user@lu
A Segunda, 25 de Junho de 2012 16:10:38 Ian Lea escreveu:
> My apologies - you are right.
>
> With both ClassicAnalyzer and StandardAnalyzer, "drinks - water"
comes
> out as "drinks -water" whereas "drinks-water" comes out as "drinks
> water", as I'd expected.
>
> I guess this is fixable in JFle
My apologies - you are right.
With both ClassicAnalyzer and StandardAnalyzer, "drinks - water" comes
out as "drinks -water" whereas "drinks-water" comes out as "drinks
water", as I'd expected.
I guess this is fixable in JFlex, or I think there is some replace
tokenizer somewhere that can replace
As I said i've tried with StandardAnalyzer(without changes) and
others(WhitespaceAnalyzer, SimpleAnalyzer, StopAnalyzer).
Now i've tried with ClassicAnalyzer as well... same result.
Code:
ClassicAnalyzer analyzer = new ClassicAnalyzer(Version.LUCENE_36);
QueryParser parser = new QueryParser(Ver
I'm positive that StandardAnalyzer won't change "drinks - water" to
"drinks -water". So it must be something in your code. Which you
don't show us. Best guess is that the changes you've made to the Flex
file have caused the problem. If you created your tokenizer by
copying and modifying Standar