CosmosDB FullTextContains on Italian names

Valeria Naldi 145 Reputation points
2025-05-30T12:48:52.45+00:00

I'm trying to use the CosmosDB Full Text Search functionality on a field containing Italian company names.

Running a query like

SELECT c.name
FROM c
WHERE FullTextContains(c.name, "COOP")

I would expect to find names with "COOPERATIVA", and it doesn't work. I read that stemming works on multi-language but Italian isn't supported right now. Is this the reason for the current behaviour? What is a possible workaround to include "COOPERATIVA" in my results?

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,909 questions
0 comments No comments
{count} votes

Accepted answer
  1. PratikLad 1,830 Reputation points Microsoft External Staff Moderator
    2025-06-04T17:18:37.12+00:00

    Hi Valeria Naldi

    I read that stemming works on multi-language but Italian isn't supported right now. Is this the reason for the current behaviour?

    Yes as per MS document Multi-language support Currently available in below languages:

    • en-US (English)
    • de-DE (German)
    • es-ES (Spanish)
    • fr-FR (French)

    What is a possible workaround to include "COOPERATIVA" in my results?

    You can now use the LIKE keyword to do text searches in Azure Cosmos DB SQL (core) API. It is a new string search options in Azure Cosmos DB.

    Here’s a simple example that uses LIKE with the % wildcard character to return all items with a description that contains “COOP”.

    Query:

    SELECT * FROM c
    WHERE c.name LIKE "%COOP%"
    

    I hope this has been helpful! Kindly consider upvoting the Answer if the information provided is helpful. This can assist other community members in resolving similar issues. Happy to help you.


1 additional answer

Sort by: Most helpful
  1. Sai Raghunadh M 4,640 Reputation points Microsoft External Staff Moderator
    2025-05-30T13:07:48.41+00:00

    Hi @ Valeria Naldi

    Thank you for your question!

    Currently, CosmosDB's Full Text Search does not support Italian stemming, which is why searching for "COOP" does not automatically match "COOPERATIVA."

    To work around this limitation, you can try the following approaches:

    Searching with "COOP*" can help capture words that begin with "COOP," including "COOPERATIVA."

    If CosmosDB allows custom synonym mapping, you can define "COOP" as a synonym for "COOPERATIVA" to improve results.

    You may need to explicitly include variations in your query, such as:

    WHERE FullTextContains(c.name, "COOP") OR FullTextContains(c.name, "COOPERATIVA")
    

    For more details, you can refer to CosmosDB's Full Text Search documentation here.

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.