Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Debugging search filters?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dan Frankowski  
View profile  
 More options Jan 2 2010, 5:16 pm
From: Dan Frankowski <dfran...@gmail.com>
Date: Sat, 2 Jan 2010 16:16:35 -0600
Local: Sat, Jan 2 2010 5:16 pm
Subject: Re: Debugging search filters?

To be more particular about the working filter outside of the search code:

>>> pq = models.Patient.all().filter('country =', 'Madagascar').filter('name
=', 'Raza Julio')
>>> print pq.count(1000)

1

Dan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Frankowski  
View profile  
 More options Jan 2 2010, 4:45 pm
From: Dan Frankowski <dfran...@gmail.com>
Date: Sat, 2 Jan 2010 15:45:57 -0600
Local: Sat, Jan 2 2010 4:45 pm
Subject: Debugging search filters?

I am trying

def patients_search(request):
  filters = ()
  if request.user.default_country:
    filters = ('country = ', request.user.default_country)
    logging.info('filters: %s' % str(filters))
  return show_search_results(request, models.Patient,
        'search_index', filters = filters,
        key_based_on_empty_query = True)

I get 1 hit for q='julio', who has country "Madagascar", but 0 hits for
q='julio' if request.user.default_country = 'Madagascar', as confirmed by
logging:

INFO     2010-01-02 21:36:04,015 views.py:317] filters: ('country = ',
u'Madagascar')

Note that the query itself works with unicode (using a dev console):

>>> pq = models.Patient.all().filter('country =', u'Madagascar')
>>> print pq.count(1000)

186

How do I debug what is happening?

Dan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Frankowski  
View profile  
 More options Jan 2 2010, 7:00 pm
From: Dan Frankowski <dfran...@gmail.com>
Date: Sat, 2 Jan 2010 18:00:40 -0600
Local: Sat, Jan 2 2010 7:00 pm
Subject: Re: Debugging search filters?

This works in production, but not development. It might be the re-indexing
tasks, since they don't seem to execute automatically in the dev environment
(despite what the docs say). In fact, I think that's it. Probably 'country'
never made it to the relational index. That's a little confusing. Oh well.

Dan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
twanschik@googlemail.com  
View profile  
 More options Jan 3 2010, 11:22 am
From: "twansc...@googlemail.com" <twansc...@googlemail.com>
Date: Sun, 3 Jan 2010 08:22:07 -0800 (PST)
Local: Sun, Jan 3 2010 11:22 am
Subject: Re: Debugging search filters?

On Jan 3, 1:00 am, Dan Frankowski <dfran...@gmail.com> wrote:

> This works in production, but not development. It might be the re-indexing
> tasks, since they don't seem to execute automatically in the dev environment
> (despite what the docs say). In fact, I think that's it. Probably 'country'
> never made it to the relational index. That's a little confusing. Oh well.

That's right. You have to start the background tasks manually on the
development server. To do so you can open the development console and
execute the background tasks there.

Bye,
Thomas


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »