Searchable is a toolkit for Lucene that harnesses the power of
annotations to specify what properties to index and how to treat them.
A sample annotated interface:
public interface Sample extends Searchable {
public Integer getId();
@Indexed(boost=2.0F)
public String getName();
@Indexed
public String getDescription();
}
Indexing:
// ...
BeanIndexer bi = new BeanIndexer();
// add a sample Sample instance, indexing the description and name properties
bi.add( makeSample() );
bi.close();
Searching:
// ...
BeanSearcher s = new BeanSearcher();
// searches on all fields by default; can be overridden using @DefaultFields
ResultSet rs = bi.search("seth");
for (Result result : rs) {
// result is actually a stripped down instance of SampleImpl.
}
More information (and examples) here:
http://mojodna.net/searchable/
Feedback / questions / comments encouraged.
seth
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]