Skip to content

Commit 9d5d529

Browse files
committed
change autocompletOrganizations in publication search filters
1 parent 9b260cd commit 9d5d529

File tree

1 file changed

+8
-5
lines changed
  • client/src/api/organizations/autocomplete

1 file changed

+8
-5
lines changed

client/src/api/organizations/autocomplete/index.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff 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+
}

0 commit comments

Comments
 (0)