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.
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 ?
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!
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.