Author Topic: Custom Search in Filters case sensitive - arrrgh  (Read 813 times)

Offline carlseibert

  • Full Member
  • ***
  • Posts: 116
    • View Profile
Custom Search in Filters case sensitive - arrrgh
« on: February 12, 2020, 10:31:49 AM »
Hi,

I was trying to work out that Custom Search in Filters does indeed work the same way that the search tab does and I was getting crazy returns. Then I tumbled to the fact that Custom Search was case sensitive!

Nobody is going to expect that. They'll just be beefed when their searches don't come back with the expected results.

I guess the right answer here is to include a case sensitivity toggle for this search box as well as the one in the search pane, given that, if I have this right, the point of giving Filters a separate search box was that and-ing functions from one pane to another would be bad. (Agreed, BTW). So, just applying the state of the button from the main search pane wouldn't be a good option.

[insert here my standard rant about case sensitivity being the biggest self-inflicted wound in the history of special libraries]

-Carl

PS: I don't know if users are going to appreciate how radically cool the way you've done string vs whole-word searches is. But it rocks! (I was mixing the two in one query when I ran into the case sensitivity issue.)

Offline Bill Kelly

  • Software Developer
  • Camera Bits Staff
  • Member
  • *****
  • Posts: 72
    • View Profile
    • Camera Bits, Inc.
Re: Custom Search in Filters case sensitive - arrrgh
« Reply #1 on: February 12, 2020, 11:20:51 AM »
Hi Carl,

I was trying to work out that Custom Search in Filters does indeed work the same way that the search tab does and I was getting crazy returns. Then I tumbled to the fact that Custom Search was case sensitive!

Nobody is going to expect that. They'll just be beefed when their searches don't come back with the expected results.

Thanks for catching that. It was not intentional to default to case-sensitivity for the Custom Search field.

As an interim workaround, prefixing your search with (?i) should switch to case-insensitive mode.


-Bill


Offline carlseibert

  • Full Member
  • ***
  • Posts: 116
    • View Profile
Re: Custom Search in Filters case sensitive - arrrgh
« Reply #2 on: February 12, 2020, 04:54:48 PM »
Cool. Works as expected. Thanks.

 (?i) stev    returns 30 miscellaneous steves, stevens and stevies.

 (?i) stev not "stevenson"    returns the 18 who are not my lawyer.

Very nice indeed.

Not that I ever recommend anybody do it, but what will switch case sensitivity on for one search?

Somebody is collecting documentation for all this, right?

-Carl

Offline Bill Kelly

  • Software Developer
  • Camera Bits Staff
  • Member
  • *****
  • Posts: 72
    • View Profile
    • Camera Bits, Inc.
Re: Custom Search in Filters case sensitive - arrrgh
« Reply #3 on: February 12, 2020, 06:28:38 PM »
Not that I ever recommend anybody do it, but what will switch case sensitivity on for one search?

We ended up borrowing from Extended Regular Expression syntax, so as not to reinvent the wheel.

So:

  (?i)  - turn on case-insensitivity
  (?-i) - turn off case-insensitivity

Mode changes can occur as often as desired within an expression.

They also honor parenthetical nesting, such that (assuming case-sensitivity by default for these examples):

  foo(?i)BAR(?-i)baz      -- only BAR is treated as case-insensitive

Is the same as:

  foo((?i)BAR)baz      -- only BAR is treated as case-insensitive


Somebody is collecting documentation for all this, right?

Ostensibly.  :)

My intent has been to add more sections to the "search examples" window, though I've no doubt this will all also appear in the official documentation for the product.


-Bill



Offline carlseibert

  • Full Member
  • ***
  • Posts: 116
    • View Profile
Re: Custom Search in Filters case sensitive - arrrgh
« Reply #4 on: February 14, 2020, 07:22:27 AM »
Thanks.

I seriously love the search examples pop-out. Both because I'm all about learn-by-example and because a pop-out cheat sheet is just such an elegant and effective (if novel) way to go.

Documentation is hard. FWIW, Photo Mechanic's documentation is among the very best I've seen. It's still hard ;-)