lucene&solr全文检索_3查询索引
创建完索引之后,我们需要查询。 百度的查询接口及结果如图所示: 具体步骤已经在上个博客中写到,直接上代码:(由于是一个完整的程序,我把创建索引的代码也post上) package come.me.lucene; import static org.junit.jupiter.api.Assertions.*; import java.io.File; import org.apache.commons.io.FileUtils; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.LongField; import org.apache.lucene.document.StoredField; import org.apache.lucene.document.TextField; import