Jump to content
  • 0

Multiple Keywords and Contains Comparison


RussellParker

Question

When using the "Contains" comparison type the basic behavior is useful in many cases, but it can also be problematic.  I am wondering if anyone knows of a way to prevent it from parsing what is entered in the Search Field.  Here is the issue in more detail.

Contains | Does Not Contain
Keyword is searched within a text field or a file name field. If multiple keywords are entered in the search field, AND operator is assumed between them. User can also provide a desired operator by entering it in ALL CAPS 

(reference: http://howto.caspio.com/datapages/reports/search-and-filter-comparison-types/)

The problem is in how the data entered is parsed.  Similarly to how a search would work in something like Google, the system presumes spaces are delimiters unless they are enclosed in quotes.

So if your search for:  A B it will match against A B C D and D C B A since it gets transformed logically into Contains("A") AND Contains("B"

Now if you search for:  "A B" it will match against A B C D but not D C B A since quotes force what is between them to be treated as a single literal.

Generally this behavior is likely just fine and not even noticed, but in certain cases it can matter quite a lot.

Example 1:  You want to search for animals with "ABC Farms" in their name.  Unless your Users know to add the Quotes they will get all animals which have both ABC and Farms anywhere in their name, rather than ABC Farms.  This case is not all that big a problem since it can be solved with a bit of User Education.  It would be nice however to be able to disable the functionality and make it act more like it would as just a simple Database Query,

Example 2:  This one is a bigger problem since it comes up when a Nefarious User knows too much.   What if I only wanted you to be able to look up a case you knew something about... for example the middle 8 numbers of its Case Number.  (please grant for the moment there might be some reason to do this... lol).  Say a Case Number looks like 2-6 Alpha Characters... 8 Numerals.. and 0-4 Alpha Characters.  All the User knows is the middle portion with the 8 Numerals and you only want them to be able to look up cases which contain that specific string.  No problem... they enter 12345678 and it finds anything containing that.   Enter our Nefarious User who enters 1 OR 2 OR 3 OR 4 OR 5 OR 6 OR 7 OR 8 OR 9 and gets a listing of every case in the system.  Yikes!

 

Parsing what is entered into the Search Field in Keywords in nice Functionality to have available, but we need a way to say NO to it.  It would also be nice to be able to choose if the assumed operator will be OR instead of AND.

Thanks in Advance.. Russell

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...