Forums / Extensions / Ezfind - Startswith letter

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.