Opened 8 years ago

Closed 8 years ago

#154 closed enhancement (fixed)

provide an option to append/prepend wildcards

Reported by: bartvde Owned by: elemoine
Priority: major Milestone: 0.7
Component: GeoExt.form Version: trunk
Keywords: Cc:
State: Commit

Description

currently the user needs to explicitly provide wildcards in the form fields, but there might be cases where we want to automatically prepend / append wildcards (or even both prepend and append a wildcard) to the search string.

Not sure how to implement this though, should we add types to GeoExt.form.toFilter.FILTER_MAP e.g.

like_prepend like_append like_both

?

Attachments (3)

ticket154.patch (2.5 KB) - added by bartvde 8 years ago.
possible patch
ticket154.2.patch (3.9 KB) - added by bartvde 8 years ago.
new patch incorporating elemoine's comment and tests
ticket154.2.review.patch (622 bytes) - added by elemoine 8 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 8 years ago by bartvde

I think the approach chosen depends on whether or not we want this to be a setting which can be changed on a per field basis. In that case, the above approach might make sense, although it seems a bit clumsy. If not on a per field basis, an approach as in the attached patch could be a possibility.

Changed 8 years ago by bartvde

possible patch

comment:2 Changed 8 years ago by bartvde

  • State changed from None to Needs Discussion

comment:3 Changed 8 years ago by tschaub

  • Milestone changed from 0.6 to 0.7

Moving this to the next release. Reassign if this is ready for commit.

comment:4 Changed 8 years ago by bartvde

  • State changed from Needs Discussion to Review

comment:5 Changed 8 years ago by elemoine

  • State changed from Review to Needs Discussion

Bart, values in Comparison.LIKE filters are regexes I think, so I don't understand why you don't use ".*" as the wildcard string.

comment:6 follow-up: Changed 8 years ago by bartvde

Hi Eric, can you give an example of that? I don't see where I can influence the value of the wildcard string in OL. TIA.

comment:7 in reply to: ↑ 6 Changed 8 years ago by elemoine

Replying to bartvde:

Hi Eric, can you give an example of that? I don't see where I can influence the value of the wildcard string in OL. TIA.

OpenLayers.Filter.Comparison has a regex2value method which is called by OpenLayers.Format.Filter.v1_1_0 when creating a PropertyIsLike node. So the Filter does expect that the Comparison.LIKE value is a regex. Makes sense?

Changed 8 years ago by bartvde

new patch incorporating elemoine's comment and tests

comment:8 Changed 8 years ago by bartvde

  • State changed from Needs Discussion to Review

Tests pass in IE8 and FF3.6, thanks for any review.

Changed 8 years ago by elemoine

comment:9 Changed 8 years ago by elemoine

  • State changed from Review to Commit

Thanks for the updated patch Bart. I'd just like to sneak in a tiny (not directly related) change: since the wildcard option can come from the SearchAction options I see no reason for not applying the same logic to logicalOp. Bart, please also commit ticket154.2.review.patch if you agree with that.

comment:10 Changed 8 years ago by bartvde

Sure makes sense, I'll add that. Thanks for the review!

comment:11 Changed 8 years ago by bartvde

  • Resolution set to fixed
  • Status changed from new to closed

(In [1995]) provide an option to append/prepend wildcards in GeoExt forms, r=elemoine (closes #154)

Note: See TracTickets for help on using tickets.