Here is my search query code, currently it works without
'sort_options' in query_options.

        sort_opts = search.SortOptions(expressions=[
            search.SortExpression(expression='magnitude',
            direction=search.SortExpression.DESCENDING, default_value=0)
         ],limit=1000)
        query_options = search.QueryOptions(limit=limit,
cursor=cursor, ids_only=True, sort_options=sort_opts)
        query_obj = search.Query(query_string=query_string,
options=query_options)
        results = search.Index(name=cls._INDEX_NAME).search(query=query_obj)

Here is how I build the search index from a model

        doc = search.Document(doc_id=self.key.id(),
            fields=[search.TextField(name='text', value=self.text),
                    search.TextField(name='full_name', value=self.full_name),
                    search.TextField(name='source', value=self.source),
                    search.NumberField(name='magnitude', value=self.magnitude),
                    search.DateField(name='created',
value=self.created.date())])
        search.Index(name=self._INDEX_NAME).add(doc)


Steve Qian



On Mon, May 14, 2012 at 8:54 PM, Sun Jing <kea...@gmail.com> wrote:
> I also got this error sometime if I mixed ascii char and Chinese char (in
> UTF-8 encode).
>
> On Mon, May 14, 2012 at 4:58 PM, Amy Unruh <amyu+gro...@google.com> wrote:
>>
>> Steve,
>>
>> Can you provide more info (e.g. example code) showing how you built the
>> query object that you used for the search?
>>
>>  -Amy
>>
>> On 12 May 2012 20:05, Steve Qian <steve...@gmail.com> wrote:
>>>
>>>
>>> I keep getting the following TransientError when doing a search query.
>>>
>>> Anyone experience the same error? Is there a problem with the service?
>>>>
>>>>
>>>>    results = search.Index(name=cls._INDEX_NAME).search(query=query_obj)
>>>>   File
>>>> "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/search/search.py",
>>>> line 2487, in search
>>>>     _CheckStatus(response.status())
>>>>
>>>>
>>>>
>>>>   File
>>>> "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/search/search.py",
>>>> line 443, in _CheckStatus
>>>>     raise _ERROR_MAP[status.code()](status.error_detail())
>>>> TransientError
>>>
>>>
>>>
>>> Steve
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Google App Engine" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/google-appengine/-/7Yt0VM1sBdAJ.
>>> To post to this group, send email to google-appengine@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> google-appengine+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-appengine?hl=en.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To post to this group, send email to google-appengine@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to google-appengine@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to