File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
client/src/api/organizations/autocomplete Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,11 @@ export async function autocompleteOrganizations({ query }: SearchArgs): Promise<
1515 { term : { status : "active" } } ,
1616 ] ,
1717 must : {
18- match : {
19- autocompleted : query
18+ match_phrase_prefix : {
19+ autocompletedText : {
20+ query,
21+ max_expansions : 10
22+ }
2023 }
2124 }
2225 } ,
@@ -26,7 +29,7 @@ export async function autocompleteOrganizations({ query }: SearchArgs): Promise<
2629 `${ organizationsIndex } /_search` ,
2730 { method : 'POST' , body : JSON . stringify ( body ) , headers : postHeaders } )
2831 const data = await res . json ( )
29- const orgs : ElasticResult < LightOrganization > [ ] = data ?. hits ?. hits || [ ]
30-
32+ const orgs : ElasticResult < LightOrganization > [ ] = data ?. hits ?. hits || [ ]
33+
3134 return { data : orgs }
32- }
35+ }
You can’t perform that action at this time.
0 commit comments