• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Carrot and Lucene together

 
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I'm using the carrot api...

carrot2-java-api-3.4.0-dev (exanples and jars)

and the lucene api from lucene in action (code and jars)


When I put them into separate projects in elipse, I can execute:
1. org.carrot2.examples.clustering.ClusteringDocumentList (in carrot)
2. lia.meetlucene.Indexer & Searcher (in lucene)

without any problems.


Now, when I try and combine both into 1 project, I have a kind of clash...
lucene-1.4.3.jar (in lucene) contains the org.apache.lucene packages.

And lucene-core-3.0.1 also contains the org.apache.lucene packages.


So with the project as 1 project, the error is with the lia.meetlucene.Indexer class, which says:
"The constructor IndexWriter(File, StandardAnalyzer, boolean) is undefined.

I think it might be trying to use the class from the other package of the same name.
Its so frustrating, cause I need to use both, can any one help? And remember I'm a beginner with this, so I don't know whats going on that much.

Thanks

 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In such scenarios, you should use the following strategy


Also, instead of having a blanket import statement (import java.awt.*) have specific statements like import java.awt.List;
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Colin, I think Maneesh misunderstood your question; I don't think his answer is relevant at all, so don't worry if you don't see how to apply it.

The easiest thing to do would be to simply use the same version of Lucene that Carrot uses. Why are you trying to use the (very old) Lucene 1.4.3, when Carrot already comes with the (current, modern, perfectly lovely) Lucene 3.0 ?
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. but I'm confused.

I need to use the class lia.meetlucene.Indexer and Searcher.
But these are in the lucene in action project(downloadable from their site).

So I don't think I can just use the Carrot on its own, although I know it has something to do with lucene in it.

So I'm not sure what to do, any thoughts?, thanks
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I downloaded lucene-3.0.1.zip, which has IndexFiles and SearchFiles classes, I guess the same as the Indexer and Searcher in lucene for action.

I'll try it out and get back to you. Thanks
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm. Well, "Lucene in Action" was published in 2004, and so the book's source code is based on a 6 year old version of Lucene -- apparently the API has changed during that time, which isn't a big surprise. I see that they're working on a second edition to be published very soon: Here's the link to the source code for the second edition, which I'm sure is far more up to date -- try using that!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, Lucene is one of the few projects/libraries that not just deprecates classes and methods, but actually removes them after a deprecation period (which generally is just one release long).

For example Lucene 3.0 is the same as 2.9 in functionality, minus all the deprecated stuff. The migration approach in this case would be to compile the source code against 2.9 with deprecation=true, and then address all issues reported until no more deprecation warnings are shown. Then the code will also compile against 3.0. The same was done earlier with Lucene 1.9/2.0.
 
no wonder he is so sad, he hasn't seen this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic