pythongdatagoogle-contacts-apigdata-python-client

Does gdata-python-client allow fulltext queries with multiple terms?


I'm attempting to search for contacts via the Google Contacts API, using multiple search terms. Searching by a single term works fine and returns contact(s):

query = gdata.contacts.client.ContactsQuery()
query.text_query = '1048'
feed = gd_client.GetContacts(q=query)
for entry in feed.entry:
  # Do stuff

However, I would like to search by multiple terms:

query = gdata.contacts.client.ContactsQuery()
query.text_query = '1048 1049 1050'
feed = gd_client.GetContacts(q=query)

When I do this, no results are returned, and I've found so far that spaces are being replaced by + signs:

https://www.google.com/m8/feeds/contacts/default/full?q=3066+3068+3073+3074

I'm digging through the gdata-client-python code right now to find where it's building the query string, but wanted to toss the question out there as well.

According to the docs, both types of search are supported by the API, and I've seen some similar docs when searching through related APIs (Docs, Calendar, etc):

https://developers.google.com/google-apps/contacts/v3/reference#contacts-query-parameters-reference

Thanks!


Solution

  • Looks like I was mistaken in my understanding of the gdata query string functionality.

    https://developers.google.com/gdata/docs/2.0/reference?hl=en#Queries

    'The service returns all entries that match all of the search terms (like using AND between terms).'

    Helps to read the docs and understand them!