Skip to content

Commit

Permalink
Add matching on title.keywordNormalized
Browse files Browse the repository at this point in the history
  • Loading branch information
nonword committed May 31, 2024
1 parent ea5e9eb commit d40f54c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/qa.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Greg built self-hosted production domain:
ENCRYPTED_ELASTICSEARCH_URI=AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAHgwdgYJKoZIhvcNAQcGoGkwZwIBADBiBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDIYpOz/BbRlJZUul7gIBEIA1idumQ6fdf/j5/pzF4t96MGGH/eV1gD4WCyLUnScgNYqtRNK0ajRO6XVroswsrJtgCwUerDM=
# 2024-05-29:
ENCRYPTED_RESOURCES_INDEX=AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAHIwcAYJKoZIhvcNAQcGoGMwYQIBADBcBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDFVXv05VtUwVtXit3wIBEIAv7GbABuJ+cOEA7ZqVzPEdL6zGytekVKeQnh4z50B2RXXsUKlMUz6osvh6S4koOYY=

ENCRYPTED_SCSB_URL=AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAH8wfQYJKoZIhvcNAQcGoHAwbgIBADBpBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDBKllElmWYLxGOGopQIBEIA8JJyKde/8m8iCJGKR5D8HoTJhXHeyvw9eIDeuUNKiXLfJwoVz+PDAZSxkCQtM9O91zGhXbe3l6Bk1RlYJ
Expand Down
20 changes: 18 additions & 2 deletions lib/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -1237,22 +1237,38 @@ const buildElasticQuery = function (params) {
}
})
if (['all', 'title'].includes(params.search_scope)) {
query.bool.should.push({
match_phrase: {
'title.folded': {
query: params.q,
boost: 50
}
}
})
query.bool.should.push({
prefix: {
'title.keyword': {
'title.keywordNormalized': {
value: params.q,
boost: 100
}
}
})
query.bool.should.push({
term: {
'title.keyword': {
'title.keywordNormalized': {
value: params.q,
boost: 105
}
}
})
query.bool.should.push({
term: {
'title.keyword': {
value: params.q,
boost: 150
}
}
})
}
if (['all', 'contributor'].includes(params.search_scope)) {
query.bool.should.push({
Expand Down

0 comments on commit d40f54c

Please sign in to comment.