Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SSHOC
sshoc-marketplace-frontend
Commits
ea00a631
Commit
ea00a631
authored
Aug 27, 2021
by
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/components/item/ActorsFormSection/ActorsFormSection.tsx
View file @
ea00a631
...
...
@@ -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
,
...
...
src/screens/account/ActorsScreen.tsx
View file @
ea00a631
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment