Skip to content

Commit

Permalink
fix(search2): VirtualRecords missing from results
Browse files Browse the repository at this point in the history
  • Loading branch information
olovy committed Dec 11, 2024
1 parent 4c997a9 commit ef3bb17
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion whelk-core/src/main/groovy/whelk/search2/EsBoost.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static whelk.JsonLd.SEARCH_KEY;
import static whelk.JsonLd.SUB_PROPERTY_OF;
import static whelk.JsonLd.TYPE_KEY;
import static whelk.JsonLd.VIRTUAL_RECORD_TYPE;
import static whelk.JsonLd.asList;
import static whelk.search2.QueryUtil.mustWrap;
import static whelk.search2.QueryUtil.shouldWrap;
Expand Down Expand Up @@ -358,13 +359,18 @@ private static Map<String, Object> recordsOverCacheRecordsBoost() {
"filter", Map.of("term", Map.of(recordType, RECORD_TYPE)),
"boost", 1000)
);
var virtualRecordBoost = Map.of(
"constant_score", Map.of(
"filter", Map.of("term", Map.of(recordType, VIRTUAL_RECORD_TYPE)),
"boost", 1000)
);
var cacheRecordBoost = Map.of(
"constant_score", Map.of(
"filter", Map.of("term", Map.of(recordType, CACHE_RECORD_TYPE)),
"boost", 1)
);

return shouldWrap(List.of(recordBoost, cacheRecordBoost));
return shouldWrap(List.of(recordBoost, virtualRecordBoost, cacheRecordBoost));
}

private static final List<String> CONCEPT_BOOST = List.of(
Expand Down

0 comments on commit ef3bb17

Please sign in to comment.