I like too search in a type structure field

How can i find an team member in a strucute field.

  • \site\controllers\search.php

Blockquote
$resultsStudio = $site->index()->search($query,
‘team|team_name|team_functions|team_image’
);


How can i display the correct team member of the list if i search on team_name ( john )

Blockquote
<?php foreach ($resultsStudio as $result): ?>
<li><a href=“<?= $result->url() ?>#studio”><?= $result->title()->html() ?></a>
//dump( $result );
<?php
$team = $result->team()->toStructure();
?>
<? dump( $team ); ?>
<?= a::show($team) ?>

</li>
<?php endforeach ?>

Like this:

$member = $page->team()->toStructure()->findBy('team_name', 'name');

So easy! If i finish I will share my code. I make a search page for a almost a one pager.