Commit c1f2415 1 parent 23385d1 commit c1f2415 Copy full SHA for c1f2415
File tree 1 file changed +2
-2
lines changed
src/main/kotlin/uk/gov/justice/hmpps/probationsearch/contactsearch
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ class ContactSearchService(
100
100
query.neural {
101
101
it.field(" textEmbedding.knn" )
102
102
.queryText(request.query)
103
- .k( 10 )
103
+ .minScore( 0.01F )
104
104
}
105
105
}
106
106
}.toQuery()
@@ -255,7 +255,7 @@ private fun Sort.fieldSorts() = SortType.entries.flatMap { type ->
255
255
SortBuilders .fieldSort(type.searchField).order(it.direction.toSortOrder())
256
256
}
257
257
}
258
- }
258
+ }.ifEmpty { listOf ( SortBuilders .fieldSort( SCORE .searchField).order( SortOrder . DESC )) }
259
259
260
260
private fun SearchRequest.Builder.sorted (sorts : List <FieldSortBuilder >): SearchRequest .Builder {
261
261
sorted(sorts) { fieldSorts ->
You can’t perform that action at this time.
0 commit comments