Re: how to remove the dash

2012-06-25 Thread listas
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

Re: how to remove the dash

2012-06-25 Thread listas
You are right... i'am not geting the hyphen inside any token... but it still used as "prohibit operator". This is my output: Test: bebidas - agua Query: bebidas -agua Tokens: 1: [bebidas:0->7:] 2: [agua:10->14:] Test is the original string. Thanks A Segunda, 25 de Junho de 2012 19:28:06 Steven

Re: how to remove the dash

2012-06-25 Thread listas
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

Re: how to remove the dash

2012-06-25 Thread listas
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

how to remove the dash

2012-06-24 Thread listas
hi I have strings like "drinks - water" and I've read in "Lucene in Action" that the StandardAnalyzer and other analyzers removes the "-" from the string but so far none of them worked... All of them change my string to something like "drinks -water" so the "-" is used as an "prohibit operator