Jan 7, 2011

Inquery Behaviour With SOSL

Hi All,


Find something interesting and would like to share with you all.


I was firing SOSL query in my organisation to get an account (using it as keyword search) :


List<List<SObject>> lst = [Find 'test*' IN ALL FIELDS Returning Account] ;


There are more than 1000 records of account in my organisation, as SOSL query result limit I was returned with 200 records only. Record which I was expecting is not here in those 200 records. So I put a condition in INQUERY returning account :


List<List<SObject>> lst = [Find 'test*' IN ALL FIELDS Returning Account(id where id = '001A000000K1QS4')] ;


Now I was expecting the record to be returned as I put the Id in the INQUERY but still the record is not returned. Actual behaviour is first SOSL get its first 200 records then the INQUERY Id is searched from those 200 records.


Thanks

2 comments: