lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Lopes <A...@alunos.ipca.pt>
Subject Re: Does QueryParser uses Analyzer ?
Date Thu, 02 Dec 2004 17:28:54 GMT
I tried luke and is great, i don't like the code but the tool is really 
good.

I found the problem, but i don't understand why.

This was the old code (doesn't work) :

--------//-----------------
IndexSearcher searcher = new IndexSearcher("data");
BrazilianAnalyzer analyzer = new BrazilianAnalyzer();

// begin of code block that doesn't  work
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Query: ");
String line = in.readLine();
// end of code that doesn't work

Query query = QueryParser.parse(line, "contents", analyzer);
Hits hits = searcher.search(query);
System.out.println(hits.length() + " total matching documents");

-------------//------------
but if i replace the above code that doesn't work by this it works fine:

String line = "text to search";

This doesn't have anything to do with lucene, but why does it work if i 
supply the code directly into the string and doesn't work usign the 
inputstream?
Does it has something to do with the encoding or something like that ? 
is it problem of the windows shell that passes the punctuation 
characters in an incorrect way?

Thanks for your help

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message