Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#317 change order of search result #525

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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