GravityKit / GravityView

The best and easiest way to display Gravity Forms entries on your website.
https://www.gravitykit.com/products/gravityview/
245 stars 63 forks source link

The Search Everything option of Search Bar can't find dates #1267

Open rafaehlers opened 5 years ago

rafaehlers commented 5 years ago

This option:

gv-date-search-3

...doesn't help:

gv-date-search-1

... to search dates:

gv-date-search-2

Tested on GV 2.2.4

┆Issue is synchronized with this Asana task

rafaehlers commented 5 years ago

https://secure.helpscout.net/conversation/755534106/18601/

soulseekah commented 5 years ago

This is tricky. Search all doesn't do any conversion and sends the search string into the database as is. So the query looks something like:

SELECT * FROM gf_entry_meta WHERE meta_value LIKE '%09/12/2018%'. We can't really just convert it into 2018-12-09 because it will fail with searches in text areas for example, where they wrote "09/12/2018" by hand, so "2018-12-09" won't match any more.

What we could do is perhaps detect a date and add an additional query variant. So the query becomes like SELECT * FROM gf_entry_meta WHERE meta_value LIKE '%09/12/2018%' OR meta_value LIKE '%2018-12-09%'. This may yield more results than expected but may actually work.

What are your thoughts on this @zackkatz?