I have a SOSL search Query
String suppliedSearchText1 = 'account';
Set<String> setselectedObjects = new Set<String>{'Account','contact'};
String SearchQuery = 'FIND \'' + suppliedSearchText1 + '*, Success\' IN ALL FIELDS RETURNING MP_Map_Point__c (id,AddressKey__c,Label__c, Entity__c,Status__c WHERE Status__c = \''+Helper_MPConstants.GEOCODE_SUCCESS+'\' AND Entity__c IN : setselectedObjects order by Id ASC limit 2000) ';
List<List<SObject>> listSoslSearchResult = Search.query(searchQuery);
List<MP_Map_Point__c> lstMapPoints = listSoslSearchResult[0];
here, I am searching for one string is'Account' in custom object is Mp_Map_Point__c but got getting the correct result as in data base.
First time it is returning 2000 record after than I am using id as a offset.. like..
String SearchQuery = 'FIND \'' + suppliedSearchText1 + '*, Success\' IN ALL FIELDS RETURNING MP_Map_Point__c (id,AddressKey__c,Label__c, Entity__c,Status__c WHERE Status__c = \''+Helper_MPConstants.GEOCODE_SUCCESS+'\' AND Entity__c IN : setselectedObjects AND id > :offsetId order by Id ASC limit 2000) ';
the query will be like this
FIND {Account*, Success*} IN ALL FIELDS RETURNING MP_Map_Point__c (id,AddressKey__c,Label__c, Entity__c,Status__c,Latitude__c WHERE Entity__c IN ('Account','Contact') order by Id ASC );
here the search statement is :
find 'account' from mp_Map_Point__c where entity__c in (account,contact) and status__C = 'success' order by id.
but the result is not equal as the data in database. I don't know{str1,str2} how this works?
Or Is there any other way where I can Put the condition on search ... or multiple search ?
Thanks in advance!