In order to set indexed props with the low level,

entity.setProperty("foo", "bar")

Unindexed properties

entity.setUnindexedProperty("foo", "baz")

I apologize about getting the API wrong in my last message.

to get values out of indexed properties, you cast:

Date d = (Date) entity.getProperty("somedate")

If it is an unindexed property, you have to parse string

String mydata = ((Text) entity.getProperty("someunindexedprop")).getValue()

On Apr 29, 2011 2:17pm, Ravi Sharma <[email protected]> wrote:
Thanks John
I wished Goole App JDO or Low level API could have done the same thing and wouldnt have to learn one more framework.....it may be easier but still i have to spend some time. By the way do you know correpsonding API(setIndexedProp()) in Datastore low level API...

If some third party frmaework can do something then i am sure Low Level datastore api must be capable of doing the same.

Thanks,
Ravi.


On Fri, Apr 29, 2011 at 9:52 PM, John Wheeler [email protected]> wrote:

Ravi,


I think you might need a MapReduce job that calls setIndexedProperty on all your affected entities. Here's mine for you to adapt, but if you don't know MapReduce, you'll have to check it out.





public class QuickBulkJob extends AppEngineMapper {

private static final Logger log = Logger.getLogger(QuickBulkJob.class.getName());



@Override

public void map(Key key, Entity e, Context context) throws IOException, InterruptedException {

setIndexedProp(e, "deactivated");

setIndexedProp(e, "feedbackReceived");


setIndexedProp(e, "email");


getAppEngineContext(context).getMutationPool().put(e);



}



private static void setIndexedProp(Entity e, String prop) {

if (e.hasProperty(prop)) {
e.setProperty(prop, e.getProperty(prop));

}
}


}



Best of luck to you.





--



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.




--
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.

Reply via email to