Hi Luís,
If it is possible, you might want to iterate over all entities of
that kind and re-put them.
Also, you might want to see, and star, issue 2481.
http://code.google.com/p/googleappengine/issues/detail?id=2481
Robert
2010/6/9 Luís Marques <[email protected]>:
> Hello,
>
> I'm changing the names a bit, for privacy reasons (if you need more
> details please say so), but I have the following models:
>
> class Event(BaseModel):
> name = db.StringProperty(required=True)
> ...
>
> class EventObservation(BaseModel):
> event = db.ReferenceProperty(Event,
> collection_name='observations')
> accuracy = db.FloatProperty(required=True)
> ...
>
> For every Event instance in the datastore I have at least one
> EventObservation. I also have the following index:
>
> - kind: EventObservation
> properties:
> - name: event
> - name: accuracy
> direction: desc
>
> The dashboard for the app says that the index is computed ("Serving").
> But in a scheduled task which goes through the EventObservation's of
> some Event's, the app got an exception because no EventObservation was
> returned for one of the Event's, even though there is one. The
> relevant code is:
>
> q = db.Query(EventObservation).filter('event =', event).order("-
> accuracy")
> obs = q.get()
> if obs.accuracy > 0.0: # assumed there always is an EventObservation
> ...
>
> Using the remote API and a local shell, I found the following two
> behaviors:
>
> # with order("-accuracy") there are no results
> my-app> q2 = db.Query(EventObservation).filter('event =',
> a_specific_event).order("-accuracy")
> my-app> q2.count()
> 0L
>
> # without the order the single observation is correctly returned
> my-app> q2 = db.Query(EventObservation).filter('event =',
> a_specific_event)
> my-app> q2.count()
> 1L
>
> # the EventObservation has good data
> my-app> obs = q2.get()
> my-app> obs
> EventObservation(**{'event': datastore_types.Key.from_path(u'Event',
> 138001L, _app=u'my-app'), 'accuracy': 89.0})
>
> My question is the following. Given that I have an index for "event /
> accuracy", and that the index is "Serving", what can be the reason
> that a particular EventObservation is not being returned, since it
> exists? Could it be that the indexing process missed it? Is it because
> there is a single EventObservation for that Event? Am I relying on a
> wrong type of consistency? Am I doing something else wrong?
>
> (BTW, the index was generated by uploading a new index.yaml. Since
> then no more Event's or EventObservations were added to the datastore,
> which makes it even stranger. I haven't tried regenerating the
> indexes, since if this happened to be an app engine bug I guess you
> might want to try ascertaining the cause?)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.