Searching object records

Have more questions? Submit a request

4 Comments

  • Mark Schäfermann
    Comment actions Permalink

    Hey,

    we uploaded our product catalog as custom object records.

    When searching for products we found that contains does not really return the results we are expecting. It seems that it only searches for substring when those substrings are enclosed by special chars. For example:

    Product Name: Visu+

    Search "Visu", returns all Products with Visu+ in their name.

    Product Name: AnalogTechnology

    Search "AnalogTechnolog", returns nothing.

    query = {"query": {"$and":[{"name": {"$contains": "cbl* "}},{"name": {"$contains": "tla"}},{"name": {"$contains": "dali"}}]}}
    -------------------------

    remove the i from daliquery = {"query": {"$and":[{"name": {"$contains": "cbl* "}},{"name": {"$contains": "tla"}},{"name": {"$contains": "dal"}}]}}

    --------
    This really screws up our workflow, as finding the right product is really hard.

     

    0
  • Sergei
    Comment actions Permalink

    Hi Mark,

    The "$contains" comparator doesn’t work as a substring matcher. In your “Visu+” example, it appears to work that way, because our search indexing is treating the ‘+’ as the beginning of a word boundary. When used on a string/text attribute, the "$contains" comparator matches against whole words within that attribute value. This also explains why “AnalogTechnolog” example cannot find a match with just one character removed.

    We will try to update this article with relevant info. Your enquiry lead to an improvement, so thank you for that.

    0
  • Mark Schäfermann
    Comment actions Permalink

    Sergei thanks for the answer. It was not the one I was hoping to get, but thanks none the less.

    Could you give me a list of those word boundary chars. It seems "-" might also be one.

    Are there any plans to make it behave like the multi select field:

    We started using a multi select field first, but had to change as the field caps at around 2000 values and we needed more.

    0
  • Sergei
    Comment actions Permalink

    Hi Mark,

    Non exhaustive list consists of the following characters: + - ; / ?
    ":" (colon) is treated as another character within the word.

    For now we do not plan to make it behave as a multi select field.

    0

Please sign in to leave a comment.

Powered by Zendesk