lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yakob <jacob...@opensuse-id.org>
Subject Re: understanding lucene
Date Sun, 08 Aug 2010 09:11:07 GMT
ok I had tried to run some sample lucene application I found on the
internet such this one from

http://javatechniques.com/blog/lucene-in-memory-text-search-example/

and this is the source code, I put it in pastebin so it will be easier to edit.

http://pastebin.ca/1913109

but still when I tried to run it using --deprecated option I ran into
some errors that made me difficult to solve it. the errors is this.

C:\Users\Raden\Documents\lucene\lucenedd>javac -Xlint:deprecation InMemoryExampl
e.java
InMemoryExample.java:7: warning: [deprecation] org.apache.lucene.search.Hits in
org.apache.lucene.search has been deprecated
import org.apache.lucene.search.Hits;
                               ^
InMemoryExample.java:29: warning: [deprecation] IndexWriter(org.apache.lucene.st
ore.Directory,org.apache.lucene.analysis.Analyzer,boolean) in org.apache.lucene.
index.IndexWriter has been deprecated
                new IndexWriter(idx, new StandardAnalyzer(), true);
                ^
InMemoryExample.java:82: cannot find symbol
symbol  : method unIndexed(java.lang.String,java.lang.String)
location: class org.apache.lucene.document.Field
        doc.add(Field.UnIndexed("title", title));
                     ^
InMemoryExample.java:89: cannot find symbol
symbol  : method text(java.lang.String,java.io.StringReader)
location: class org.apache.lucene.document.Field
        doc.add(Field.Text("content", new StringReader(content)));
                     ^
InMemoryExample.java:101: parse(java.lang.String) in org.apache.lucene.queryPars
er.QueryParser cannot be applied to (java.lang.String,java.lang.String,org.apach
e.lucene.analysis.standard.StandardAnalyzer)
        Query query = QueryParser.parse(
                                 ^
InMemoryExample.java:105: warning: [deprecation] org.apache.lucene.search.Hits i
n org.apache.lucene.search has been deprecated
        Hits hits = searcher.search(query);
        ^
InMemoryExample.java:105: warning: [deprecation] search(org.apache.lucene.search
.Query) in org.apache.lucene.search.Searcher has been deprecated
        Hits hits = searcher.search(query);
                            ^
3 errors
4 warnings

I use deprecated option because there is some java class that's
already deprecated. but still there is some errors.

I was just wondering if I can get any tips of how to fix this errors
or else maybe I can get a link to other working lucene sample program.
because it's a bit hard for me to learn lucene if I don't have any
working program based on lucene.

any help would be greatly appreciated.
-- 
http://jacobian.web.id

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


Mime
View raw message