1

Is it possible to write a single Gql Query for retrieving the record which contains a searching string?

Data store Contains following Records:

addax
Crest
Addrest
Drest
Armrest
admix

I need to get the Records which contains the word "Rest" (Case insensitive)

agf
  • 171,228
  • 44
  • 289
  • 238
Nijin Narayanan
  • 2,269
  • 2
  • 27
  • 46

2 Answers2

2

Full-Text-Search is not supported in AE yet, it's on the roadmap so we can look forward to it.

If you are just trying to match single words in a case insensitive way, you could store all your words in a ListProperty, and ensure they are always stored in lowercase. That way you could easily query for them in a case insensitive mannor.

Chris Farmiloe
  • 13,935
  • 5
  • 48
  • 57
  • @chiris This is a running application. So i cant able to make any changes in the Datastore. And i need to add a new module for Searching a products already in the datastore. – Nijin Narayanan Aug 09 '11 at 13:07
  • You might want to look at the aetycoon examples of custom properties, specifically the [TransformProperty](https://github.com/Arachnid/aetycoon/blob/master/__init__.py#L157), which you could use to add a second property based on an existing property. You would have to re save each entity but once in place you would have a useable prop for searching against. – Chris Farmiloe Aug 09 '11 at 13:14
  • @chiris thanks for your reply. But Even i need to change the Exsisting datastore model is it ? ( Change all existing data to this property in either uppercase or lowercase ).Is it possible to do programmatic ? – Nijin Narayanan Aug 09 '11 at 13:24
  • If you just want to change all the current data, look at using the [mapper api in mapreduce](http://code.google.com/p/appengine-mapreduce/) if you need to keep the existing data you can add a Derived/Transform Property to store the lowercased versions. – Chris Farmiloe Aug 09 '11 at 13:29
  • Okey. I Added the normalized text(All lowercase) of a of all products. Then Also i need to fetch all the record and Search a word in each the records. Is it ? – Nijin Narayanan Aug 09 '11 at 15:18
0

You can get some full text search features using SearchableModel

Jayesh
  • 235
  • 1
  • 5
  • 13