Searching in inriver

Was this article helpful?

Still need help? contact us

Comments

8 comments

  • Avatar
    Tobias Månsson (ICP)

    Could you clarify in the Query editor section that OR search is not possible, only from the Remoting API?

    1
  • Avatar
    Martin Svensson

    Hi Tobias,

    Thank you for the suggested improvement to the article. A clarification on the operator used by the Query Editor have now been added to the article. 

    0
  • Avatar
    Christian Christiansen

    How do you escape special characters like _ and # in the search result?

    0
  • Avatar
    Steve Vink
    business solutions architect

    Hi Christian Christiansen. I have just tested searches for _, -, ! and #. All of these work without any need to escape the characters.

    If you have a scenario where this doesn't work, please let us know.

     

    0
  • Avatar
    Zach Helbert (Ntara)

    I have a scenario where using "_" also returns results with "-" in the display name field.

    0
  • Avatar
    Christian Christiansen

    Steve Vink Searching for the characters by itself is not a problem, but trying to search for entities with the string "_nn_" does not return correct results. There is plenty of "nn" in the results but not the correct ones where the "nn" is pre- and postfixed by an underscore. This goes for all combinations of special symbols and strings.

    1
  • Avatar
    Magnus Kjellberg (ICP)

    Underscore still seems impossible to search for, trying to find a field where the value contains _ but it always returns everything. Anyone got a clue on how to escape it?

    0
  • Avatar
    Jesse Reinikka

    If you want to query by underscore, you need to escape it like so: 

    %[_]

    This is likely because inriver is using MS SQL and using its LIKE operator to perform the query in the backend. If they are passing input pattern as is, then obviously _ would not work since it stands for any character. This is documented by Microsoft at LIKE (Transact-SQL) - Arguments.

    The reason %[_] works, is that:

    1. % stands for any string of zero or more characters
    2. Inside [ ] you are able to specify which characters you want to search for, in this case the underscore.

    This should be documented here, because it is not that explicit, unless you have general understanding of databases and a hunch of how inriver has implemented certain things.

    3

Please sign in to leave a comment.