google-app-engine


Google Appengine Datastore filter and sort direction together


I am trying to use the below SQL query in datastore
Select *from users where catagory="A" ODER BY id.
I tried the below code
DatastoreService ds = DatastoreServiceFactory.getDatastoreService();
Filter filter=new FilterPredicate("catagory", FilterOperator.EQUAL, "A");
Query q = new Query("users");
q.setFilter(filter);
q.addSort("id", SortDirection.DESCENDING);
The setfilter() and addsort() functions are not working together. Any suggestion will be appreciated.
From Class DatastoreNeedIndexException:
DatastoreNeedIndexException is thrown when no matching index was
found for a query requiring an index. Check the Indexes page in the
Admin Console and your datastore-indexes.xml file.
In many cases the development server creates the necessary indexes automatically when your app requires them. See Creating indexes using the development server.
But in some cases the automatic index updates don't happen. In such cases you need to create/update the indexes manually. See Creating indexes manually.
Updating the indexes on GAE also happens most of the time automatically, when the app code is deployed, but occasionally they need to be updated manually. From Updating indexes:
./appengine-java-sdk/bin/appcfg.sh update_indexes myapp/war
After the GAE indexes are updated it may take a while for them to get in serving state. Until that state is reached the same error can be seen. Check the status of the app's indexes in the developer's console. Also mentioned in Updating indexes.

Related Links

appengine 1.6.3.1.jar creates Unknown Google App Engine prob
Message failure in channel api
Is there a way to know when a set of app engine task queue tasks have completed?
Best way to model my classes?
List of keys or separate model?
WTForms not working on Google App Engine 1.6.1 & Python 2.7
Google app engine and application scope data
Do composite index updates maintain same order as original updates
What is template expansion and how can we reduce it if our google app engine application?
Writing to an appengine blob asynchronously and finalizing it when all tasks complete
null pointer exception in indexwriter.close (using ramdirectory in google app engine)
Deploy to AppEngine without changing the GWT files
JDO and Google App Engine datastore: key representation in code
Using appspot.com as a partial domain cookie
Nested entity groups in HRD datastore
What is the maximum computational throughput gain on Azure?

Categories

HOME
ng-idle
c99
nvd3.js
interface
socket.io
can
permissions
polling
qpython
pattern-matching
arangodb
augeas
jquery-ui-sortable
little-proxy
watson-conversation
why3
flatpak
aws-sdk
symfony-console
nodemcu
squashfs
ember-cli
windows-server-2003
surveymonkey
slidetoggle
oculus
rpgle
errbot
twiml
event-flow
scatter3d
mockjax
classcastexception
hibernate-search
reverse
sim-toolkit
lint
unordered-map
kill
glm-math
lpsolve
file-sharing
httr
x++
flask-restful
wcftestclient
identification
corruption
singleinstance
java-bytecode-asm
modelsim
edit
headless
dt
mouseleave
cpu-cache
py2neo
bootstrap-tags-input
autosar
microstation
dup
android-dateutils
nullable
jparsec
jbase
atan2
iokit
dllimport
rewrite
binomial-theorem
cgi-bin
jdk1.7
mirror
snoop
osc
rrule
code-documentation
cross-join
psr-4
named-parameters
ss7
matrix-inverse
renderer
ice-cube
cmmi
server-administration
fb.ui
argouml
update-statement
http-daemon
dot-emacs
sifr
visualj#
entitykey

Resources

Encrypt Message