1. Do you know , why u are getting the first error. You should find it? Learn Java. The File in which the program is should be saved with the same name of public class, that is file should be saved as HelloLucene.java(not Hello.java) 2. use lucene 2.9.1
On Thu, May 19, 2011 at 12:03 AM, ravishekhar [via Lucene] < ml-node+2958052-1222437878-146...@n3.nabble.com> wrote: > Hi, > > I am getting following errors: > > ravi@ravi-desktop:~/Desktop/sw/lucene-3.0.3$ javac -Xlint -cp > lucene-core-3.0.3.jar Hello.java > Hello.java:19: class HelloLucene is public, should be declared in a file > named HelloLucene.java > public class HelloLucene { > ^ > Hello.java:23: cannot find symbol > symbol : constructor StandardAnalyzer() > location: class org.apache.lucene.analysis.standard.StandardAnalyzer > IndexWriter w = new IndexWriter(index, new StandardAnalyzer(), true, > new MaxFieldLength(250)); > ^ > Hello.java:33: cannot find symbol > symbol : constructor StandardAnalyzer() > location: class org.apache.lucene.analysis.standard.StandardAnalyzer > Query q = new QueryParser("title", new > StandardAnalyzer()).parse(querystr); > ^ > Hello.java:33: internal error; cannot instantiate > org.apache.lucene.queryParser.QueryParser.<init> at > org.apache.lucene.queryParser.QueryParser to () > Query q = new QueryParser("title", new > StandardAnalyzer()).parse(querystr); > ^ > 4 errors > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://lucene.472066.n3.nabble.com/Writing-new-peice-of-code-in-Lucene-tp2956161p2958052.html > To start a new topic under Lucene - General, email > ml-node+642108-1580214077-146...@n3.nabble.com > To unsubscribe from Lucene - General, click > here<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=642108&code=YW51cmFnLml0LmpvbGx5QGdtYWlsLmNvbXw2NDIxMDh8LTIwOTgzNDQxOTY=>. > > -- Kumar Anurag ----- Kumar Anurag -- View this message in context: http://lucene.472066.n3.nabble.com/Writing-new-peice-of-code-in-Lucene-tp2956161p2960159.html Sent from the Lucene - General mailing list archive at Nabble.com.