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(Version.LUCENE_36, "contents",
analyzer);
Query query = parser.parse(food);
System.out.println("Query: " + query.toString("contents"));
TopDocs results = searcher.search(query, 10);
Thanks
xpete
A Segunda, 25 de Junho de 2012 14:37:37 Ian Lea escreveu:
> 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 StandardTokenizer you could start again or do
a
> diff or something. Good luck.
>
>
> --
> Ian.
>
> On Mon, Jun 25, 2012 at 2:40 AM, <[email protected]> wrote:
> > 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" and this
is a
> > BIG problem for me.
> >
> > I'm using Lucene 3.6.
> > I'am also using my own Analyzer, Filters and a Tokenizer based on
> > StandardTokenizer with changes
> > on the Flex file to remove some othe stuff.
> >
> > How can i remove the "-"?
> >
> > Thanks
> > xpete
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: java-user-
[email protected]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]