Ezfind - Startswith letter

Author Message

Lars Eirik Rønning

Thursday 09 June 2011 12:50:10 am

Hi.

I need to create a filter which allows me to only list people that starts with a certain letter.

Basicaly it suppose to be a alphabetical listing of all people.

Any examples of an ezfind filter which can do this? is there an ezfind operator such as startsWith ?

Certified Developer :http://auth.ez.no/certification/verify/365518

Carlos Revillo

Thursday 09 June 2011 1:09:09 am

Hi. You can use wildcards for that. something like

class/name:a*  should to the trick.

note that wildcards can only be used for start with searches, and not for end with searches.

Lars Eirik Rønning

Thursday 09 June 2011 1:50:27 am

Thanks.

This does however show results where one of the words starts with the letter.

Is there a way to restrict the query to only query items where the name starts with a.

If i search for class/name:a* it will return both john aldridge and adrian peters.

I would like only adrian peters to be returned.

Certified Developer :http://auth.ez.no/certification/verify/365518

Carlos Revillo

Thursday 09 June 2011 2:05:47 am

i would try attr_name_s:a* then. 

actually what you are doing at the end is attr_name_t:a*, ezfind converts class/name to attr_name_t and that is sent to solr. 

 

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 02:07:14
Script start
Timing: Jan 18 2025 02:07:14
Module start 'layout'
Timing: Jan 18 2025 02:07:14
Module start 'content'
Timing: Jan 18 2025 02:07:15
Module end 'content'
Timing: Jan 18 2025 02:07:15
Script end

Main resources:

Total runtime0.5150 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 587.9141152.6250
Module start 'layout' 0.00570.0029 740.539139.4531
Module start 'content' 0.00860.5048 779.9922505.0078
Module end 'content' 0.51340.0015 1,285.000012.1641
Script end 0.5149  1,297.1641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.6209160.0002
Check MTime0.00140.2705160.0001
Mysql Total
Database connection0.00080.147210.0008
Mysqli_queries0.468390.9341600.0078
Looping result0.00060.1128580.0000
Template Total0.487294.620.2436
Template load0.00190.374020.0010
Template processing0.485394.236820.2426
Template load and register function0.00020.031310.0002
states
state_id_array0.00090.179010.0009
state_identifier_array0.00070.137720.0004
Override
Cache load0.00160.3023210.0001
Sytem overhead
Fetch class attribute can translate value0.00070.141820.0004
Fetch class attribute name0.00130.255840.0003
XML
Image XML parsing0.00020.048220.0001
class_abstraction
Instantiating content class attribute0.00000.001940.0000
General
dbfile0.00210.4136100.0002
String conversion0.00000.001940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 4

Time used to render debug report: 0.0001 secs