Skip to content

Commit

Permalink
Merge pull request #525 from kagemomiji/issue317-change-order-of-sear…
Browse files Browse the repository at this point in the history
…ch-result

#317 change order of search result
  • Loading branch information
kagemomiji authored Jun 28, 2024
2 parents 9314197 + 2aa81e9 commit 86b12ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,14 @@ private Query createMultiFieldWildQuery(String[] fieldNames, String queryString,
List<Query> fieldQuerys = new ArrayList<>();
while (stream.incrementToken()) {
String token = stream.getAttribute(CharTermAttribute.class).toString();
TermQuery termQuery = new TermQuery(new Term(fieldName, token));
WildcardQuery wildcardQuery = new WildcardQuery(new Term(fieldName, token.concat(ASTERISK)));
if (indexType.getBoosts().containsKey(fieldName)) {
fieldQuerys.add(new BoostQuery(termQuery, indexType.getBoosts().get(fieldName) * 0.5f));
fieldQuerys.add(new BoostQuery(wildcardQuery, indexType.getBoosts().get(fieldName)));
} else {
fieldQuerys.add(wildcardQuery);
fieldQuerys.add(new BoostQuery(termQuery, 0.5f));
}
}
fieldsQuerys.add(fieldQuerys);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<java.version>17</java.version>
<cxf.version>4.0.4</cxf.version>
<snakeyaml.version>2.2</snakeyaml.version>
<lucene.version>9.11.0</lucene.version>
<lucene.version>9.11.1</lucene.version>
<docker.container.repo>ghcr.io/kagemomiji/airsonic-advanced</docker.container.repo>
<docker.java.version>17.0.10_7</docker.java.version>
</properties>
Expand Down

0 comments on commit 86b12ee

Please sign in to comment.