Re: how to remove the dash

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

Re: how to remove the dash

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

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
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. > > >

RE: how to remove the dash

2012-06-25 Thread Steven A Rowe
cene.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. > > With both ClassicAnalyzer and StandardAnalyzer, "drinks - water" comes > out as "drinks -water" whereas "drinks-wate

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 Ian Lea
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

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

Re: how to remove the dash

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

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