You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current construction of the searchquery assumes a 1:1 field mapping and fails in case of 'match_any' search (across fields). Instead of trying to construct a full searchquery by hand it would be better to simply rely on searchcontext to resolve this.
OP\SearchController:
[...]
public functionbuildsearchquery(HTTPRequest $request)
{
$SearchedDataObject = Injector::inst()->create($request->getVar('ClassName'));
// check for a first-name last-name pattern with people's names
[...] (think this members-search could/will also be covered by scaffolded searchcontext)
// Search using searchcontext scaffolding.../** @var SearchContext $searchContext */if ($searchContext = $SearchedDataObject->getDefaultSearchContext()) {
$searchParams = [ $SearchedDataObject->getGeneralSearchFieldName() => $request->getVar('query') ];
return$searchContext->getResults($searchParams);
}
[...] (DONE - remaining code can probably be removed...)
}
The text was updated successfully, but these errors were encountered:
The current construction of the searchquery assumes a 1:1 field mapping and fails in case of 'match_any' search (across fields). Instead of trying to construct a full searchquery by hand it would be better to simply rely on searchcontext to resolve this.
OP\SearchController:
The text was updated successfully, but these errors were encountered: