Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7950707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:21:19+00:00 2026-06-04T02:21:19+00:00

Surprisingly, after having done a lot of queries without problem. I’ve run into the

  • 0

Surprisingly, after having done a lot of queries without problem. I’ve run into the first strange GQL problem.

Following are the properties of a model called Feedback:

content  date    title   type    votes_count     written_by

and following are configured in index.yaml:

- kind: Feedback
  properties:
  - name: type
  - name: date
   direction: desc

When I queried for all Feedback data, sorted by date, it returns me all the results:

query = GqlQuery("SELECT __key__ FROM Feedback ORDER BY date DESC")

The type property is stored in type = db.IntegerProperty(default=1, required=False, indexed=True), and there are 8 rows of Feedback data with type of integer 1.

However, when I queried:

query = GqlQuery("SELECT __key__ FROM Feedback WHERE type = :1 ORDER BY date DESC", type)

It kept returning me empty results. What has gone wrong ?

Update

def get_keys_by_feedback_type(type_type):
    if type_type == FeedbackCode.ALL:
        query = GqlQuery("SELECT __key__ FROM Feedback ORDER BY date DESC")
    else:
        query = GqlQuery("SELECT __key__ FROM Feedback WHERE type = :1 ORDER BY date DESC", type_type)    
    return query

results = Feedback.get_keys_by_feedback_type(int(feedback_type_filter))
for feedback_key in results:
# iterate the query results

The index is serving:

Feedback 
type ▲ , date ▼ Serving
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T02:21:20+00:00Added an answer on June 4, 2026 at 2:21 am

    It was my bad for not describing clearly in the first place. I’m going to share the solution just in case, if somebody else faced the same problem.

    The root cause of this was due to my insufficient knowledge of App Engine indexes. Earlier, the ‘type’ property was unindexed because I didn’t plan to filter it until recent requirement changes.

    Hence, I indexed the ‘type’ property from the property definition model as shown from the question. However, the ‘type’ property was remained unindexed for the reason explained from this, Indexing Formerly Unindexed Properties:

    If you have existing records created with an unindexed property, that property continues to be unindexed for those records even after you change the entity (class) definition to make the property indexed again. Consequently, those records will not be returned by queries filtering on that property.

    So, the solution would be :

    To make a formerly unindexed property be indexed

    1. Set indexed=True in the Property constructor:

      class Person(db.Model):
          name = db.StringProperty()
          age = db.IntegerProperty(indexed=True)
      
    2. Fetch each record.

    3. Put each record. (You may need to change something in the record, such as the timestamp, prior to the put in order for the write to occur.)

    So, there was nothing wrong with my GQL everything from the question. It was all because the ‘type’ property was remained unindexed. Anyway, still great thanks to @Adam Crossland for some insights and suggestions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this strange behaviour in .NET and even after looking into CLR via
After surprisingly little hacking about, I managed to get libc++ installed on my Linux
I compiled & ran the code pasted below and surprisingly it worked without errors.
I've checked through other questions and surprisingly this question doesn't seem to have been
I am writing a junit test in order to (surprisingly) test a part of
I find it surprising that Ruby symbols can be typecasted to integers without errors.
Is it possible to modify the _fields_ definition of the ctypes.Structure after it's been
i'm having trouble with modifying the location hash in IE8 for XP. simply calling:
Surprisingly enough there's very little information on the Web about using Bouncy Castle's lightweight
I have been searching on this but it is surprisingly hard to come by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.