Ticket #495 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

change behavior of LIKE and ILIKE filters

Reported by: elemoine Owned by: bbinet
Priority: blocker Milestone: 1.2 Release
Component: framework.server Version: SVN
Keywords: Cc:
State: Commit

Description

Currently the LIKE and ILIKE filters add %'s around the searched value. This is unflexible, the user should be able to do, for example, a LIKE search without % around the searched value. Also I suggest adding LIKE_WILDCARDED and ILIKE_WILDCARDED to keep the old behavior around.

Attachments

patch-MapFish-495-r2707-A0.diff (10.2 kB) - added by elemoine 3 years ago.
patch-MapFishSample-495-r2707-A0.diff (0.7 kB) - added by elemoine 3 years ago.
patch-MapFish-495-r2707-A1.diff (13.3 kB) - added by elemoine 3 years ago.
patch-MapFishSample-495-r2707-B0.diff (460 bytes) - added by elemoine 3 years ago.
patch-MapFish-495-r2707-A2.diff (10.6 kB) - added by elemoine 3 years ago.

Change History

Changed 3 years ago by elemoine

Changed 3 years ago by elemoine

  Changed 3 years ago by elemoine

  • state set to Review

  Changed 3 years ago by elemoine

  • owner changed from elemoine to bbinet

Changed 3 years ago by elemoine

Changed 3 years ago by elemoine

  Changed 3 years ago by elemoine

patch-MapFish-495-r2707-A1.diff adds a "wildcarded" property to mapfish.Protocol.MapFish. When "wildcarded" is true the protocol places %'s around the values read from LIKE filters. For example if a LIKE filter whose property is "foo" and whose value is "bar" is passed to protocol.read the query string will include foo__ilike=%bar% (it'd include foo__ilike=%bar% is wildcarded was false).

follow-up: ↓ 6   Changed 3 years ago by bbinet

I don't know what the section client/examples/examples.js of the patch has to do with this ticket?

follow-up: ↓ 7   Changed 3 years ago by bbinet

Looking at the patch patch-MapFish-495-r2707-A1.diff, server side new comparison filters (LIKE_WILDCARDED and ILIKE_WILDCARDED) will never be used since protocol.py does not support these filters.

I think there is no need to have custom server side "wilcarded" processing because the patch is successfully implementing the "wilcarded" mechanism on client side... It's a good thing that comparison filters LIKE and ILIKE do not automatically add the wildcard but this patch will break the api compatibility.

in reply to: ↑ 4   Changed 3 years ago by elemoine

Replying to bbinet:

I don't know what the section client/examples/examples.js of the patch has to do with this ticket?

Nothing. I'll remove it.

in reply to: ↑ 5   Changed 3 years ago by elemoine

Replying to bbinet:

Looking at the patch patch-MapFish-495-r2707-A1.diff, server side new comparison filters (LIKE_WILDCARDED and ILIKE_WILDCARDED) will never be used since protocol.py does not support these filters.

Yes, the protocol will never create "wildcarded" filters, yet developers could create "wildcarded" filters in their ccontrolers and pass them to the protocol. That being said removing the "wilcarded" filters would be ok for me.

I think there is no need to have custom server side "wilcarded" processing because the patch is successfully implementing the "wilcarded" mechanism on client side... It's a good thing that comparison filters LIKE and ILIKE do not automatically add the wildcard but this patch will break the api compatibility.

Ok, I'll provide a new patch w/o these filters.

Changed 3 years ago by elemoine

  Changed 3 years ago by elemoine

patch-MapFish-495-r2707-A2.diff addresses Bruno's comments.

  Changed 3 years ago by bbinet

  • state changed from Review to Commit

Thanks Eric, please commit.

  Changed 3 years ago by elemoine

  • status changed from new to closed
  • resolution set to fixed

(In [2729]) change behavior of LIKE and ILIKE filters, r=bbinet (closes #495)

Note: See TracTickets for help on using tickets.