Why is search so slow, why does it not return all objects? Can I search using regex?

There are two methods to search for messages / threads, using the /search endpoint (provider, searches all messages)and the /messages endpoint(Nylas DB, only searches synced messages).


/Search Endpoint

Searches on Microsoft accounts are inherently slow, additionally we only search the Inbox of Microsoft accounts . IMAP accounts will only search for the specific string.

Our /search endpoints are passed directly to the provider, each provider has their own search algorithms. We have no control over what the provider returns.

You can improve the speed of searches by implementing a search date period in your application that for example only searches the last 3 months by default.

subject:Test (received>12/31/2021)
  • Disallow searching with less than 3 characters
  • Limit 1 search per 30 seconds
  • Ensure you apply filters by default 
    • from:
    • subject:
    • received in the last three months.

IMAP searches:

IMAP unlike Google and Microsoft searches does not  search for objects %like% , the search term must match 100% 

/Messages Endpoint

Instead of using the search endpoints you can use the /messages endpoint and have Nylas DB search for the message type, this is quicker however it only searches synced objects.



Microsoft search params

Outlook search operators

Gmail search params

IMAP search parameters



Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request



Please sign in to leave a comment.