Skip to content

Instantly share code, notes, and snippets.

@philippludwig
philippludwig / WeightTest.java
Last active Apr 22, 2020
Small example on how to use a CustomScoreQuery to influence lucene's ranking.
View WeightTest.java
package luceneTest;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;