How to filter when typing 'process' it and everything that is inside it?

This my HTML:
input search
<div class="input-group">
<input type="text" class="form-control filter-search" placeholder="Buscar..." autocomplete="off" id="mySearch">
<button class="btn_clear">x</button>
</div>
this side_bar
<ul class="sidebar-menu" data-widget="tree" id="myMenu">
<li class="treeview menu-open" id="mainProcessesNav">
<a class="menuhref" href="#">
<i class="fa fa-toggle-on"></i>
<span><?= $this->lang->line('application_daily_process'); ?></span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<?php if (in_array('viewTrackingOrder', $user_permission)) : ?>
<li id="semFreteNav" data-search="<?= $this->lang->line('application_daily_process'); ?>" >">
<a class="menuhref" href="<?php echo base_url('orders/semfrete') ?>"><i class="fa fa-circle-o"></i> <?= $this->lang->line('application_freight_to_wire'); ?></a>
</li>
<?php endif; ?>
</ul>
</li>
</ul>
My filter in jquery
$(document).ready(function(){
$("#mySearch").on("keyup", function() {
var value = $(this).val().toLowerCase();
$("#myMenu li a").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
});
if($("#myMenu li a:visible").length > 0){
$("#emptyMsg").hide();
}else{
$("#emptyMsg").show();
}
});
});
I thought about adding the name of the parent $(this).data("search").val() inside a data-search="name of the parent" and trying to filter by it in jQuery But it didn't work. Can someone help me please?
The idea is when typing the name of the father it stays open and lists all the children and hides all the others.