how can I implement the tf-idf and cosine similarity in Lucene?
问题 How can I implement the tf-idf and cosine similarity in Lucene? I'm using Lucene 4.2. The program that I've created does not use tf-idf and Cosine similaryty, it only uses TopScoreDocCollector. import com.mysql.jdbc.Statement; import java.io.BufferedReader; import java.io.File; import java.io.InputStreamReader; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.util.Version; import org.apache.lucene.index.IndexWriterConfig; import org.apache.lucene.index