@Override
public ZoieIndexable convertAndInterpret(String tweet) {
try {
final String text = tweet;
final long uid = id++;
return new AbstractZoieIndexable() {
@Override
public IndexingReq[] buildIndexingReqs() {
Document doc = new Document();
doc.add(new Field("contents", text, Store.NO, Index.ANALYZED));
return new IndexingReq[] { new IndexingReq(doc) };
}
@Override
public long getUID() {
return uid;
}
@Override
public boolean isDeleted() {
return false;
}
@Override
public boolean isSkip() {
return false;
}
};
} catch (Exception e) {
return new AbstractZoieIndexable() {
@Override
public IndexingReq[] buildIndexingReqs() {
return null;
}