Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / July 2006

Tip: Looking for answers? Try searching our database.

Lucene ver

Thread view: 
Sam - 04 Jul 2006 10:43 GMT
Hi, I'm trying to use latest ver of Lucene (Release 2.0.0), but unable
to run its example.
When I tried to run it it throws an exception (see bellow). Hence I
need information about how to resolve this problem or should I use the
lower ver of it?

Error compiling file:
D:\projects\server\web\tomcat\work\_\localhost\rChive\Lucene\/results_jsp.java
   [javac] Compiling 1 source file

D:\projects\server\web\tomcat\work\_\localhost\rChive\Lucene\results_jsp.java:167:
parse(java.lang.String) in org.apache.lucene.queryParser.QueryParser
cannot be applied to
(java.lang.String,java.lang.String,org.apache.lucene.analysis.Analyzer)
                       query = QueryParser.parse(queryString,
"contents", analyzer);
                                          ^
Note:
D:\projects\server\web\tomcat\work\_\localhost\rChive\Lucene\results_jsp.java
uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note:
D:\projects\server\web\tomcat\work\_\localhost\rChive\Lucene\results_jsp.java
uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

Desperately need your suggestion.

ThankQ
Sam
bgunaratnam@hotmail.com - 05 Jul 2006 19:40 GMT
Sam - I have run into the exact same problem.

It looks like Lucene version 2.0 is using a single arguement for
QueryParser.parse(String query) instead of QueryParser.parse(String
query, String field, Analyzer analyzer).

If anyone knows how to implement the latter with the new version of
lucene, please provide an example.

Thanks.

> Hi, I'm trying to use latest ver of Lucene (Release 2.0.0), but unable
> to run its example.
[quoted text clipped - 27 lines]
> ThankQ
> Sam
bgunaratnam@hotmail.com - 05 Jul 2006 19:54 GMT
This should do the trick:

lucene 1.4
Query query = QueryParser.parse("someSearchQuery","someField",
analyzer);

replace with...

lucene 2.0
QueryParser qp = new QueryParser("someField", analyzer);
Query query = qp.parse("someSearchQuery");

> Sam - I have run into the exact same problem.
>
[quoted text clipped - 38 lines]
> > ThankQ
> > Sam


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.