Skip to content

Instantly share code, notes, and snippets.

View JasonHao123's full-sized avatar

Jason Hao JasonHao123

View GitHub Profile
@philippludwig
philippludwig / WeightTest.java
Last active April 22, 2020 22:04
Small example on how to use a CustomScoreQuery to influence lucene's ranking.
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;