You need to sign in to do that
Don't have an account?

SOSL Query
Hi,
Can anyone tell me that how to write a SOSL query for the query below ?
[select Id,Name frrom Asset where Name like '%abcd%']
I need to retreive all the Asset records whose name contains 'abcd'.
Regards
Vikram
Try this :
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Hi,
Thanks for the reply. I have been trying the same query but it does not seem to be working. the SOQL query and the SOSL given by you returns the different result.
It looks like FIND '*abcd*' is not same as '%abcd%'.
Please let me know if you have any thoughts on this.
Regards
Vikram
It looks like the limit of records fetched from SOSL is 200 only. :(
Yes, you can see the difference because only 200 records are returned via SOSL.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Yups. So this is of no use for me. I need to display all the records on the VF page. Can you suggest any other workaround for this ?
I have 3 Million Assets in the Sandbox and when I run this query [select Id from Asset where name like '%abcd%' where Name != null], It gives TIME OUT to me.
Regards
Vikram
Ideally there should be very few instance where you will get records more than 50000 when you are searching with some specific criteria. Otherwise there is no use of the search criteria.
So to avoid the time out issue you can just append limit to the query of 50000
And am hoping you are using "Name != null" to avoid non-selective query errors. Try as above suggested, let me know if you still face the problem.
Thanks
Ankit Arora
Blog | Facebook | Blog Page