function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jonathan Wolff 7Jonathan Wolff 7 

Way to find similar results in Search Component Apex

Hello, I made a Search component, which querys on my object "Mediatheken".When I enter 'Pension' I do get results but if I try something similar like ' Pensio' or 'Pens' I do not get these results. Could you tell me if there is a possibility to find answers that are near to the entered text.

My Apex code:

public class MediathekSearchController {


    
    @AuraEnabled(cacheable=true)
    public static List<List<sObject>> getSearchResult(String searchKey){
     
        List<List<sObject>> searchResult = [FIND : searchKey
                                            IN ALL FIELDS RETURNING
                                            Mediathek__c (Id, Name, Bezeichnung__c, Typ__c, Zielgruppe__c, Umfang__c, Bezeichnung_Link__c, Bezeichnung_Search__c)
                                            ];
        return searchResult;
     
    } 
}