public enum ComponentIndexSearchFeature {
+ EXACT_IGNORE_CASE {
+ @Override
+ public QueryBuilder getQuery(String queryText) {
+ return matchQuery(SORTABLE_ANALYZER.subField(FIELD_NAME), queryText)
+ .boost(2.5f);
+ }
+ },
PREFIX {
@Override
public QueryBuilder getQuery(String queryText) {
@Override
public QueryBuilder getQuery(String queryText) {
return matchQuery(SORTABLE_ANALYZER.subField(FIELD_KEY), queryText)
- .boost(5f);
+ .boost(50f);
}
};
"ThisIsAVeryLongNameToSearchForAndItEndsDifferently.java");
}
+ @Test
+ public void scoring_perfect_match_dispite_case_changes() {
+ assertResultOrder("sonarqube",
+ "SonarQube",
+ "SonarQube SCM Git");
+ }
+
@Test
public void do_not_match_wrong_file_extension() {
ComponentDto file1 = indexFile("MyClass.java");