Lucene 4.0: TermStats is not public in TermStats; cannot be accessed from outside package -


i have 2 questions regarding lucene 4.0: 1) change sorting in lucene, created own tfidf class , called termstats constructor

    ts[t] = new termstats( contents[t].field,contents[t].termtext, contents[t].docfreq, tfidf); 

but message

    termstats(string,bytesref,int,long) not public in termstats; cannot accessed outside package 

does know, whether not have way change it?

2) lucene, indeed, calculate tf*idf or term frequency (tf)? asking because have read term frequency contructor accepts docfreq related idf.

any appreciated. thank in advance.

1 - generally, rely on lucene pass termstatistics objects computeweight method of custom similarity implementation, rather constructing them yourself.

if need acquire them directly, accomplish calling indexsearcher.termstatistics (you'll need pass in appropriate termcontext call, created using static method termcontext.build).

2 - yes, lucene's defaultsimilarity implementation of it's tfidfsimilarity, which, implied, factor in idf scoring.


Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -