+ Start a Discussion
someonesomeone 

SOQL vs SOSL - lag in data propagation

So I have two apex functions for searching contacts. One searches by name using SOQL, the other searches by phone number using SOSL FIND. I call these apex functions via the openCTI runApex() function. I'm experience the following scenario:
- I have two contacts, with the same first name, originally with the same phone number (e.g. 421-555-1234) 
- I manually change one of the contacts to have a different phone number (421-555-6789), then call the SOQL search function via openCTI,
- The results return correctly (two contacts return with there correct contact details - their individual phone numbers)
- If I call the SOSL find function using the original phone number (421-555-1234), I expect to get back a single record, however both contacts are returned.
- If I wait several minutes and call the same SOSL find function, then I get back a single contact.

So it seems the updated phone number takes time to propagate through the system with respect to SOSL functionality. Why is that?
PratikPratik (Salesforce Developers) 
Hi,

Will you please clear your browser cookies & history and try it once. Let us know if you are getting same issue.

Thanks,
Pratik
someonesomeone
That seems to do the trick, but also logging in and out (without clearing cookies) seems to fix it too. Obviously thats not really an ideal scenario, so is there any other way to get around this.
PratikPratik (Salesforce Developers) 
Hi,

Is it happening everytime when you login and check or it happened for once only?

Thanks,
Pratik
someonesomeone
Everytime I change a contacts phone number, there is a bit of a lag for the SOSL query to produce the correct results. Sometimes its ~15 seconds, other times a minute or two.