Skip to content

Commit

Permalink
Use prefix matching on both creator and contrib
Browse files Browse the repository at this point in the history
  • Loading branch information
nonword committed Jul 25, 2024
1 parent b7d72f1 commit 746437c
Show file tree
Hide file tree
Showing 61 changed files with 286,706 additions and 21,711 deletions.
10 changes: 5 additions & 5 deletions lib/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ const buildElasticQuery = function (params) {
term: {
nyplSource: namedQuery({
value: 'sierra-nypl',
boost: 1
boost: 10
}, 'nypl-owned')
}
})
Expand Down Expand Up @@ -1398,19 +1398,19 @@ const buildElasticQuery = function (params) {
if (['contributor'].includes(params.search_scope)) {
query.bool.should = query.bool.should.concat([
{
match_phrase: {
prefix: {
'contributorLiteralWithoutDates.keywordLowercased': namedQuery({
query: querySansQuotes,
value: querySansQuotes,
boost: 25
}, 'match_phrase contributorLiteralWithoutDates.folded')
}, 'prefix contributorLiteralWithoutDates.folded')
}
},
{
prefix: {
'creatorLiteralWithoutDates.keywordLowercased': namedQuery({
value: querySansQuotes,
boost: 100
}, 'match_phrase creatorLiteralWithoutDates.folded')
}, 'prefix creatorLiteralWithoutDates.folded')
}
}
])
Expand Down
Loading

0 comments on commit 746437c

Please sign in to comment.