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

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -