Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ContactsAPI] startsWith filter

5 views
Skip to first unread message

Ben Kelly

unread,
May 21, 2013, 11:34:18 AM5/21/13
to dev-w...@lists.mozilla.org
All,

Following up on my last message, I'd like to propose that we add a "startsWith" filter operation to ContactsAPI.

https://bugzilla.mozilla.org/show_bug.cgi?id=874462

This would be useful in a number of places:

- Type ahead name completion in many apps
- Initializing letter groups in jump lists such as used in contacts app

Also, Rick and Julien have asked for this to help support the current mms work. To that end I am going to go ahead and prototype this now.

Thoughts? Is this also something that would normally be implemented using DataStore? Looking at the API for DataStore on the wiki it appears you would have to load all contacts into to memory to do this? Is this correct?

Thanks!

Ben

Ben Kelly

unread,
May 21, 2013, 12:49:55 PM5/21/13
to dev-w...@lists.mozilla.org
So it turns out we already do "startsWith" behavior when passing the "contains" filterOp. The mms app was running into:

https://bugzilla.mozilla.org/show_bug.cgi?id=874501

So the real API question is, should we rename "contains" to "startsWith"? Or maybe alias it if we want to maintain backward compatibility?

Thanks.

Ben
> _______________________________________________
> dev-webapi mailing list
> dev-w...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-webapi

JOSE MANUEL CANTERA FONSECA

unread,
May 22, 2013, 3:59:59 AM5/22/13
to Ben Kelly, dev-w...@lists.mozilla.org
My understanding was that 'contains' search for the target string in any
position and not only at the starting position. Thus, I think we need both
'startsWith' and 'contains' filters

best

El 21/05/13 18:49, "Ben Kelly" <bke...@mozilla.com> escribió:
________________________________

Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo.
This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at:
http://www.tid.es/ES/PAGINAS/disclaimer.aspx

Ben Kelly

unread,
May 22, 2013, 8:23:21 AM5/22/13
to JOSE MANUEL CANTERA FONSECA, dev-w...@lists.mozilla.org, gwa...@mozilla.com
On May 22, 2013, at 3:59 AM, JOSE MANUEL CANTERA FONSECA <jm...@tid.es> wrote:
> My understanding was that 'contains' search for the target string in any
> position and not only at the starting position. Thus, I think we need both
> 'startsWith' and 'contains' filters

I agree and that is what you would expect from the name "contains". The wiki is non-specific:

https://developer.mozilla.org/en-US/docs/WebAPI/Contacts

Unfortunately, it currently does implement startsWith functionality and we have apps, mms for example, relying on that behavior.

From what I understand there are technical issues which make "contains" complicated to implement right now. Gregor can you speak to that?

If we want to provide both "contains" and "startsWith", what is the best path? Rename the current filterOp to "startsWith" and write a bug to fix "contains"?

Thanks.

Ben
0 new messages