Re: problem with a query

2011-09-08 Thread G.Long
OK, thank you for the explanation :) Gary. Le 07/09/2011 17:34, Ian Lea a écrit : There appears to be a mismatch between your usage of KeywordAnalyzer and PhraseQuery. As the javadoc says, KeywordAnalyzer is generally used for data like zip codes and product ids, whereas phrase queries are use

Re: problem with a query

2011-09-07 Thread Ian Lea
There appears to be a mismatch between your usage of KeywordAnalyzer and PhraseQuery. As the javadoc says, KeywordAnalyzer is generally used for data like zip codes and product ids, whereas phrase queries are used for finding phrases within longer pieces of text. Adding your whole value as one te

Re: problem with a query

2011-09-07 Thread G.Long
Hi Rick :) I found the problem but I think It needs explanations. In the code where the query was created, there was a peace of code as following : if(value.contains(" ")){ String[] words = value.split(" "); PhraseQuery param = new PhraseQuery();

Re: problem with a query

2011-09-07 Thread Erick Erickson
Nothing really jumps out, but here's an idea: Dump query.toString() and see if it's what you expect as the parsed query. And make absolutely sure that the directory you open in your Java code is the same one you open in Luke. You'd be amazed how much time I've spent tracking down mistakes like tha

problem with a query

2011-09-07 Thread G.Long
Hi :) I have a lucene index with fields analyzed with Keyword Analyzer. In my java program, I search for a document by creating a query with two boolean parameters like : +param1:"foo" +param2:"bar" The query return no result but If I run the same query with Luke, it returns the result I'm l