Searching using partial words

Hello, I am currently implementing a search functionality using the Nylas API, and I’ve noticed that the search query seems to require the full word to return results. For example, when searching for “Egypt”, it works, but searching for partial words like “Egy” doesn’t return any results.

Is there any way to perform searches with partial words or any suggestions on how to achieve more flexible search behavior with the Nylas API?

Hi @hamzahyounus!

Your ability to search by partial words is limited by what the provider supports. To clarify, search_query_native is not a default substring search across all email content; rather, it is a method for you to use the email provider’s native search query syntax directly if you so choose.

If the email provider is Google, I know off the top of my head that this should behave exactly as you currently expect. But you will need to double check for other providers. Here is a link to our docs on search_query_native where you can dive into each specific provider: Searching with Nylas | Nylas Docs

Thank you for the clarification!

To confirm, I am using Google as the email provider. However, I’m noticing that the search functionality with search_query_native doesn’t behave as it does in the Gmail web app. Specifically, while the Gmail app allows partial word matches or more flexible keyword searches, using search_query_native through the Nylas API requires exact, whole-word matches to return results.

Is there a way to configure the search to behave more like the Gmail web app, or any additional parameters I might need to achieve this level of flexibility? Thank you again for your help!

Unfortunately, there is no more configuration that we can provide. We pass along your query string to the Gmail API directly, and beyond that have no control. It’s possible there are slight differences between how the Gmail API handles search and how the Gmail UI handles search, but it should be fairly similar.

If you want us to investigate further, I would strongly suggest opening a support ticket here: https://support.nylas.com/hc/en-us/requests/new.

Please include screenshots of the queries you’re trying to make in the Gmail UI, the API/SDK requests/responses you’re making to Nylas exactly, and also the relevant EML files of the messages you’re trying to locate using $search so we can reproduce in our own test Gmail mailboxes.