|
Carrot2 Framework
API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.carrot2.apiexample.LuceneExample
public final class LuceneExample
This is an example of using the Carrot2 API to cluster search results aquired from a local Lucene index.
This example is a continuation of the API introduction available
in the Example class, present in this project.
This tutorial starts in the main(String[]) method.
Example| Constructor Summary | |
|---|---|
LuceneExample()
|
|
| Method Summary | |
|---|---|
static void |
main(String[] args)
Using Carrot2 and Lucene |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LuceneExample()
| Method Detail |
|---|
public static void main(String[] args)
In this example we will configure and run a few queries against an index created and searched with Java Information Retrieval library Lucene. You should be familiar with how Lucene creates indexes and how it works. Corresponding documentation is available in that project.
Further on we assume that a Lucene index is compiled and available for searches. Carrot2 uses Lucene 2.x JAR internally, so the index should be compatible. In addition to that, we will need three fields, corresponding to the information Carrot2 utilizes:
If any of the above fields are not present in your index, you can simulate
them programmatically (only the url field is obligatory, but it also
can be simulated). This is a somewhat advanced technique and we will further assume
that each of the above fields is available in your index.
Practically the only difference between the example shown in Example class
and now is how we initialize the LocalController component. We will create
an input component searching for documents in our index (LuceneLocalInputComponent)
and link it with the Lingo clustering algorithm. This is shown in initLocalController()
method.
args - Command line arguments are not used in this application.
|
Please refer to project documentation at
http://project.carrot2.org |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||