mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-31 15:24:31 +03:00
Search: Added structure for search term inputs
Sets things up to allow more complex terms ready to handle negation.
This commit is contained in:
@ -25,11 +25,12 @@ class SearchResultsFormatter
|
||||
* Update the given entity model to set attributes used for previews of the item
|
||||
* primarily within search result lists.
|
||||
*/
|
||||
protected function setSearchPreview(Entity $entity, SearchOptions $options)
|
||||
protected function setSearchPreview(Entity $entity, SearchOptions $options): void
|
||||
{
|
||||
$textProperty = $entity->textField;
|
||||
$textContent = $entity->$textProperty;
|
||||
$terms = array_merge($options->exacts, $options->searches);
|
||||
$relevantSearchOptions = $options->exacts->merge($options->searches);
|
||||
$terms = $relevantSearchOptions->toValueArray();
|
||||
|
||||
$originalContentByNewAttribute = [
|
||||
'preview_name' => $entity->name,
|
||||
|
Reference in New Issue
Block a user