How can we improve Azure Cosmos DB?

Implement LIKE keyword

Add support for the LIKE '%%' SQL keyword and associated functionality.

708 votes
Vote
Sign in
(thinking…)
Password icon
Signed in as (Sign out)
You have left! (?) (thinking…)
Michael Davidson shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

31 comments

Sign in
(thinking…)
Password icon
Signed in as (Sign out)
Submitting...
  • vartika commented  ·   ·  Flag as inappropriate

    how to do wildcard search within url parameters. while the data is stored in Azure cosmos DB & the url is passed through Postman. I am using the spring data cosmosDb api.
    I had tried the url :http://ip address/devices?name=device.* but it consider the asteric as string not the wildcard character. Can anyone help me on this.

    Thanks in advance.

  • Aaron commented  ·   ·  Flag as inappropriate

    Create a UDF
    --------------------
    function regexMatchUdf(input, pattern) {
    return input.match(pattern) !== null;
    };
    -------------------
    SELECT *
    FROM c
    where udf.REGEX_MATCH(c.Property, "1234.*" )

  • Basavaraj Nagarahalli commented  ·   ·  Flag as inappropriate

    Support the LIKE clause / regex expressions in the queries.
    Sample
    --SQL
    SELECT *
    FROM THINGS
    WHERE serialNumber LIKE '%A0000%'

  • Jim Brown commented  ·   ·  Flag as inappropriate

    CONTAINS results in a scan, and doesn't use the index. The LIKE %whatever% can use the index in SQL Server. Are there plans to support partial string searches in the search index?

  • Anonymous commented  ·   ·  Flag as inappropriate

    Cosmos Graph API doesn't appear to support any wildcard searching using contains etc... Will this also be included?

  • Oleg commented  ·   ·  Flag as inappropriate

    Hold on, looks like it does actually work at least when using DocumentDB through MongoDB API. Here is a query example:
    {"name" : /tom/i }
    Works as SQL equivalent %tom% and it is case insensitive.

    Is this topic just abandoned?

  • Oleg commented  ·   ·  Flag as inappropriate

    Whats the latest on this? This is a really essential feature to have.

  • Anonymous commented  ·   ·  Flag as inappropriate

    This feedback site would be awesome if features were updated with some expectations on delivery.... This seems to have been raised in 2014 and the last comment from the team was 2015 :(

    Come on guys what is the state of play?

  • sandor commented  ·   ·  Flag as inappropriate

    And change the way CONTAINS is implemented so it can take advantage of indexes....

  • Bob commented  ·   ·  Flag as inappropriate

    Azure Search starts at a ridiculous price of $250 per month. Totally unacceptable for a startup. Having a DB native "like" search would help.

  • Ryan CrawCour [MSFT] commented  ·   ·  Flag as inappropriate

    @AR did you know there is great integration between DocumentDB & Azure Search? You can setup a datasource and schedule indexing automatically. you then have the full power of Azure Search at your disposal.

  • Ryan CrawCour [MSFT] commented  ·   ·  Flag as inappropriate

    @Toys, yes UDFs could work however be aware that this wouldn't take advantage of the index so the query would resort to a scan. So this could work for small document sets OR where you have other predicates in your WHERE clause to first narrow the search results that the UDF has to iterate over.

  • AR commented  ·   ·  Flag as inappropriate

    It would be more beneficial if we can leverage full text search. So find all document that contains "issue" independent of where.

← Previous 1

Feedback and Knowledge Base