@@ -24,7 +24,6 @@ import org.opensearch.search.fetch.subphase.highlight.HighlightBuilder
24
24
import org.opensearch.search.sort.FieldSortBuilder
25
25
import org.opensearch.search.sort.SortBuilders
26
26
import org.opensearch.search.sort.SortOrder
27
- import org.springframework.beans.factory.annotation.Value
28
27
import org.springframework.data.domain.PageImpl
29
28
import org.springframework.data.domain.PageRequest
30
29
import org.springframework.data.domain.Pageable
@@ -35,8 +34,7 @@ import org.springframework.data.elasticsearch.core.query.IndexQuery
35
34
import org.springframework.security.core.context.SecurityContextHolder
36
35
import org.springframework.stereotype.Service
37
36
import uk.gov.justice.hmpps.probationsearch.contactsearch.ContactSearchService.SortType
38
- import uk.gov.justice.hmpps.probationsearch.contactsearch.ContactSearchService.SortType.LAST_UPDATED_DATETIME
39
- import uk.gov.justice.hmpps.probationsearch.contactsearch.ContactSearchService.SortType.SCORE
37
+ import uk.gov.justice.hmpps.probationsearch.contactsearch.ContactSearchService.SortType.*
40
38
import uk.gov.justice.hmpps.probationsearch.services.DeliusService
41
39
import uk.gov.justice.hmpps.sqs.audit.HmppsAuditService
42
40
import java.time.Instant
@@ -50,7 +48,6 @@ class ContactSearchService(
50
48
private val objectMapper : ObjectMapper ,
51
49
private val deliusService : DeliusService ,
52
50
private val openSearchClient : OpenSearchClient ,
53
- @Value(" \$ {bedrock.model.id}" ) private val bedrockModelId : String , // Temp, remove after upgrading to OpenSearch 2.16 - workaround for https://github.com/opensearch-project/OpenSearch/issues/15034
54
51
) {
55
52
56
53
private val scope = CoroutineScope (Dispatchers .IO )
@@ -103,7 +100,6 @@ class ContactSearchService(
103
100
query.neural {
104
101
it.field(" textEmbedding.knn" )
105
102
.queryText(request.query)
106
- .modelId(bedrockModelId)
107
103
.k(10 )
108
104
}
109
105
}
0 commit comments