java - Lucene: Create document from already preprocessed data -
in our infrastructure, have existing mechanisms document modeling want integrate lucene. currently, i'm facing problem, have existing document vector , need create lucene document (using lucene's analyzers not option). simplicity, let's assume, have map containing terms , frequencies, i'm doing this:
map<string, integer> termcounts = gettermcounts(text); (string term : termcounts.keyset()) { (int = 0; < termcounts.get(term); i++) { document.add(new field("text", term, field_type)); } }
doesn't optimal solution me. there better way, create lucene document existing map
, collection
, iterable
?
Comments
Post a Comment