Problem for selecting duplicate in repeater (filtered)

Here is the thing, the user has to type like “engine” in the search box. Then, the repeater1 expands and shows results, let say two options. The user can select one option and show the details by repeater2. The problem is, the repeater2 shows the different details for different IDs. It supposes to be “Company A” for ID 42f31… not the “Example”. I not sure what I’m missing but it shows the row that comes first for the duplicate name instead of the filtered ID. Everything else works fine.


Here is my code by following another tutorial:
import wixData from ‘wix-data’ ;

export function searchBar_keyPress(event) {
$w( “#repeaterResults” ).data = ;
$w( “#repeaterResults” ).collapse();

setTimeout(() => { 

if ($w( “#searchBar” ).value.length >= 2 ) {
$w( “#loadingGif” ).show();
$w( “#datasetSearch” ).setFilter(wixData.filter().startsWith( “associations” , $w( “#searchBar” ).value)
.or(wixData.filter().startsWith( “parts” , $w( “#searchBar” ).value))
)
.then(() => {
count();
})
}
else {
$w( “#repeaterSearch” ).collapse();
$w( “#loadingGif” ).hide();
$w( “#totalResultsText” ).hide();
}
}, 500 )
}

function count () {
let total = $w( “#repeaterSearch” ).data.length;
if (total > 0 ) {
$w( “#repeaterSearch” ).expand();
$w( “#totalResultsText” ).text = ${total} results found;
} else {
$w( “#repeaterSearch” ).collapse();
$w( “#totalResultsText” ).text = “0 results found” ;
}
$w( “#totalResultsText” ).show();
$w( “#loadingGif” ).hide();
}

export function repeaterSearch_itemReady_1($item, itemData, index) {
let id = itemData._id;

$item( "#parts" ).onClick(() => { 
    $w( "#loadingGif2" ).show(); 
    $w( "#repeaterResults" ).data = []; 
    $w( "#searchBar" ).value = $item( "#parts" ).text; 

    $w( "#text62" ).text = id; 
    $w( "#datasetResults" ).setFilter(wixData.filter().eq( "_id" , id)) 
    .then(() => { 
     $w( "#repeaterResults" ).expand(); 
     $w( "#repeaterSearch" ).collapse(); 
     $w( "#loadingGif2" ).hide(); 
    }) 
    $w( "#repeaterSearch" ).data = []; 
    $w( "#loadingGif2" ).hide(); 
    $w( "#totalResultsText" ).hide(); 
}) 

}