diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 0027f500..00f7e738 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -21,7 +21,7 @@ jobs: contents: read runs-on: ubuntu-latest needs: tests - if: github.ref == 'refs/heads/qa-node20' + if: github.ref == 'refs/heads/qa-node20-es-tuning' steps: - name: Checkout repo uses: actions/checkout@v3 diff --git a/config/qa.env b/config/qa.env index 06d7fd15..d919212d 100644 --- a/config/qa.env +++ b/config/qa.env @@ -1,6 +1,6 @@ # Greg built self-hosted production domain: ENCRYPTED_ELASTICSEARCH_URI=AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAHgwdgYJKoZIhvcNAQcGoGkwZwIBADBiBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDIYpOz/BbRlJZUul7gIBEIA1idumQ6fdf/j5/pzF4t96MGGH/eV1gD4WCyLUnScgNYqtRNK0ajRO6XVroswsrJtgCwUerDM= -ENCRYPTED_RESOURCES_INDEX=AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAHIwcAYJKoZIhvcNAQcGoGMwYQIBADBcBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDDHuuuG/vsNVvjm2BgIBEIAvNe+XrgVv1D1W1WLqvsTWrCET7oK3/LlvfcQwFWIW0W4dONlDbU9UXrlufonpJ5M= +ENCRYPTED_RESOURCES_INDEX=AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAHIwcAYJKoZIhvcNAQcGoGMwYQIBADBcBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDFVXv05VtUwVtXit3wIBEIAv7GbABuJ+cOEA7ZqVzPEdL6zGytekVKeQnh4z50B2RXXsUKlMUz6osvh6S4koOYY= ENCRYPTED_SCSB_URL=AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAH8wfQYJKoZIhvcNAQcGoHAwbgIBADBpBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDBKllElmWYLxGOGopQIBEIA8JJyKde/8m8iCJGKR5D8HoTJhXHeyvw9eIDeuUNKiXLfJwoVz+PDAZSxkCQtM9O91zGhXbe3l6Bk1RlYJ ENCRYPTED_SCSB_API_KEY=AQECAHh7ea2tyZ6phZgT4B9BDKwguhlFtRC6hgt+7HbmeFsrsgAAAGMwYQYJKoZIhvcNAQcGoFQwUgIBADBNBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDNw8KXkyN8HvtjAX0gIBEIAgX+XG2fxTj6kSchrd/dfHB05KU5pkT0LtPxUTuNCXoLc= diff --git a/lib/resources.js b/lib/resources.js index efce2583..b34a7b55 100644 --- a/lib/resources.js +++ b/lib/resources.js @@ -856,7 +856,7 @@ const buildElasticBody = function (params) { query } } - body.min_score = 0.65 + body.min_score = 1.65 body.sort = ['_score'] // just filters: no score @@ -1225,6 +1225,53 @@ const buildElasticQuery = function (params) { if (params.q) { // Merge keyword-specific ES query into the query we're building: query.bool = { must: [buildElasticQueryForKeywords(params)] } + + // Mike, Elastic consultant, additions: + query.bool.should = [] + query.bool.should.push({ + term: { + nyplSource: { + value: 'sierra-nypl', + boost: 1 + } + } + }) + if (['all', 'title'].includes(params.search_scope)) { + query.bool.should.push({ + prefix: { + 'title.keyword': { + value: params.q, + boost: 100 + } + } + }) + query.bool.should.push({ + term: { + 'title.keyword': { + value: params.q, + boost: 105 + } + } + }) + } + if (['all', 'contributor'].includes(params.search_scope)) { + query.bool.should.push({ + prefix: { + 'contributorLiteral.keyword': { + value: params.q, + boost: 100 + } + } + }) + query.bool.should.push({ + term: { + 'contributorLiteral.keyword': { + value: params.q, + boost: 105 + } + } + }) + } } const advancedParamQueries = ADVANCED_SEARCH_PARAMS