Fuzzy search for users by email

Author Message

Marco Rogers

Wednesday 03 November 2010 10:46:35 pm

I know I can fetch a particular user by email using eZUser::fetchByEmail. But it has to match exactly. I need to do a fuzzy search and the user account field isn't supported in an attribute filter. I can get by with something really simple that is equivalent to "select * from ezuser where email like "%foo%""

But obviously something more robust that supports querying other fields as well would be ideal.

Thanks
:Marco

Ivo Lukac

Thursday 04 November 2010 1:44:41 am

eZ Find is your friend :)

If you don't have it try making an extended attribute filter where you can add 'email like "%foo%" ' part

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 03:02:44
Script start
Timing: Jan 18 2025 03:02:44
Module start 'layout'
Timing: Jan 18 2025 03:02:44
Module start 'content'
Timing: Jan 18 2025 03:02:44
Module end 'content'
Timing: Jan 18 2025 03:02:44
Script end

Main resources:

Total runtime0.0168 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 589.0313152.6250
Module start 'layout' 0.00570.0041 741.656339.4531
Module start 'content' 0.00980.0047 781.109489.3359
Module end 'content' 0.01450.0023 870.445330.2891
Script end 0.0168  900.7344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002615.6247140.0002
Check MTime0.00137.5350140.0001
Mysql Total
Database connection0.00095.061610.0009
Mysqli_queries0.003721.900430.0012
Looping result0.00000.117410.0000
Template Total0.001911.310.0019
Template load0.00105.781810.0010
Template processing0.00095.525710.0009
Override
Cache load0.00074.219610.0007
General
dbfile0.00021.466080.0000
String conversion0.00000.076440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs