Commit ea00a631 authored by Stefan Probst's avatar Stefan Probst
Browse files

fix: use wildcards in actor-search for solr

parent 22529886
Pipeline #224178 passed with stages
in 9 minutes and 58 seconds
......@@ -149,7 +149,7 @@ function ActorComboBox(props: ActorComboBoxProps): JSX.Element {
const debouncedsearchTerm = useDebouncedState(searchTerm, 150).trim()
const actors = useSearchActors(
// @ts-expect-error Search on dynamic property
{ 'd.name': debouncedsearchTerm },
{ 'd.name': '*' + debouncedsearchTerm.replace(/\s+/, '*') + '*' }, // We need wildcards for SOLR to match.
{
// enabled: debouncedsearchTerm.length > 2,
keepPreviousData: true,
......
......@@ -465,7 +465,9 @@ function sanitizeQuery(params?: ParsedUrlQuery): SearchActors.QueryParameters {
const sanitized = []
if (params.q != null && params.q.length > 0) {
sanitized.push(['d.name', params.q])
const q = ensureScalar(params.q)
// We need wildcards for SOLR to match.
sanitized.push(['d.name', '*' + q.replace(/\s+/, '*') + '*'])
}
if (params.page !== undefined) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment