Module Expr Str Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore Str Assign NameStore Num Assign NameStore Call NameLoad ListLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Expr Str If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIn AttributeLoad NameLoad attr NameLoad body Delete SubscriptDel NameLoad Index AttributeLoad NameLoad attr Assign NameStore Call NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If UnaryOpNot Call NameLoad NameLoad NameLoad body Assign NameStore ListLoad NameLoad If BoolOpAnd Call NameLoad SubscriptLoad NameLoad Index Num NameLoad UnaryOpNot Call NameLoad SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr body For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad If NameLoad body Assign SubscriptStore NameLoad Index AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad Call NameLoad NameLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Str keyword AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AugAssignSub NameStore AttributeLoad NameLoad attr For NameStore Call NameLoad NameLoad body If CompareLt Call NameLoad NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call NameLoad Return NameLoad decorator_list NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad Str Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareIn AttributeLoad NameLoad attr NameLoad body Raise Call AttributeLoad NameLoad attr BinOpMod Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call NameLoad NameLoad NameLoad attr keyword NameLoad If Call NameLoad NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad decorator_list
N/A N/A Full text indexing and search, implemented in pure python.

Defines a SearchableModel subclass of db.Model that supports full text
indexing and search, based on the datastore's existing indexes.

Don't expect too much. First, there's no ranking, which is a killer drawback.
There's also no exact phrase match, substring match, boolean operators,
stemming, or other common full text search features. Finally, support for stop
words (common words that are not indexed) is currently limited to English.

To be indexed, entities must be created and saved as SearchableModel
instances, e.g.:

  class Article(search.SearchableModel):
    text = db.TextProperty()
    ...

  article = Article(text=...)
  article.save()

To search the full text index, use the SearchableModel.all() method to get an
instance of SearchableModel.Query, which subclasses db.Query. Use its search()
method to provide a search query, in addition to any other filters or sort
orders, e.g.:

  query = article.all().search('a search query').filter(...).order(...)
  for result in query:
    ...

The full text index is stored in a property named __searchable_text_index. If
you want to use search() in a query with an ancestor, filters, or sort orders,
you'll need to create an index in index.yaml with the __searchable_text_index
property. For example:

  - kind: Article
    properties:
    - name: __searchable_text_index
    - name: date
      direction: desc
    ...

Note that using SearchableModel will noticeable increase the latency of save()
operations, since it writes an index row for each indexable word. This also
means that the latency of save() will increase roughly with the size of the
properties in a given entity. Caveat hacker!
 N/A re N/A string N/A sys google.appengine.api datastore google.appengine.api datastore_errors google.appengine.api datastore_types google.appengine.ext db google.appengine.datastore datastore_pb SearchableEntity N/A N/A datastore Entity N/A N/A A subclass of datastore.Entity that supports full text indexing.

  Automatically indexes all string and Text properties, using the datastore's
  built-in per-property indices. To search, use the SearchableQuery class and
  its Search() method.
   N/A _FULL_TEXT_INDEX_PROPERTY __searchable_text_index N/A _FULL_TEXT_MIN_LENGTH 3 N/A _FULL_TEXT_STOP_WORDS N/A frozenset N/A a about according accordingly affected affecting after again against all almost already also although always am among an and any anyone apparently are arise as aside at away be became because become becomes been before being between both briefly but by came can cannot certain certainly could did do does done during each either else etc ever every following for found from further gave gets give given giving gone got had hardly has have having here how however i if in into is it itself just keep kept knowledge largely like made mainly make many might more most mostly much must nearly necessarily neither next no none nor normally not noted now obtain obtained of often on only or other our out owing particularly past perhaps please poorly possible possibly potentially predominantly present previously primarily probably prompt promptly put quickly quite rather readily really recently regarding regardless relatively respectively resulted resulting results said same seem seen several shall should show showed shown shows significantly similar similarly since slightly so some sometime somewhat soon specifically state states strongly substantially successfully such sufficiently than that the their theirs them then there therefore these they this those though through throughout to too toward under unless until up upon use used usefully usefulness using usually various very was we were what when where whether which while who whose why widely will with within without would yet you N/A _PUNCTUATION_REGEX N/A N/A re compile N/A N/A [ N/A N/A re escape N/A string punctuation ] __init__ N/A N/A self kind_or_entity N/A args kwargs N/A N/A Constructor. May be called as a copy constructor.

    If kind_or_entity is a datastore.Entity, copies it into this Entity.
    datastore.Get() and Query() returns instances of datastore.Entity, so this
    is useful for converting them back to SearchableEntity so that they'll be
    indexed when they're stored back in the datastore.

    Otherwise, passes through the positional and keyword args to the
    datastore.Entity constructor.

    Args:
      kind_or_entity: string or datastore.Entity
     N/A N/A isinstance kind_or_entity N/A datastore Entity N/A N/A N/A self _Entity__key N/A kind_or_entity _Entity__key N/A N/A N/A self update kind_or_entity N/A N/A N/A N/A N/A super SearchableEntity self __init__ kind_or_entity args kwargs N/A _ToPb N/A N/A self N/A N/A N/A Rebuilds the full text index, then delegates to the superclass.

    Returns:
      entity_pb.Entity
     N/A N/A N/A SearchableEntity _FULL_TEXT_INDEX_PROPERTY self N/A N/A N/A self N/A N/A SearchableEntity _FULL_TEXT_INDEX_PROPERTY N/A index N/A set N/A N/A name values N/A N/A self items N/A N/A N/A N/A isinstance values list N/A N/A values N/A values N/A N/A N/A isinstance N/A values N/A 0 basestring N/A N/A isinstance N/A values N/A 0 N/A datastore_types Blob N/A N/A value values N/A N/A N/A N/A index update N/A N/A SearchableEntity _FullTextIndex value N/A index_list N/A list index N/A index_list N/A N/A N/A self N/A N/A SearchableEntity _FULL_TEXT_INDEX_PROPERTY index_list N/A N/A N/A N/A super SearchableEntity self _ToPb N/A _FullTextIndex N/A N/A cls text N/A N/A N/A Returns a set of keywords appropriate for full text indexing.

    See SearchableQuery.Search() for details.

    Args:
      text: string

    Returns:
      set of strings
     N/A text N/A N/A N/A N/A datastore_types ValidateString text text max_len N/A sys maxint N/A text N/A N/A N/A cls _PUNCTUATION_REGEX sub text N/A words N/A N/A N/A N/A text lower split N/A words N/A set words N/A words N/A cls _FULL_TEXT_STOP_WORDS N/A word N/A list words N/A N/A N/A N/A len word N/A cls _FULL_TEXT_MIN_LENGTH N/A N/A N/A N/A words remove word N/A N/A words N/A set N/A words N/A classmethod N/A SearchableQuery N/A N/A datastore Query N/A N/A A subclass of datastore.Query that supports full text search.

  Only searches over entities that were created and stored using the
  SearchableEntity or SearchableModel classes.
   Search N/A N/A self search_query N/A N/A N/A Add a search query. This may be combined with filters.

    Note that keywords in the search query will be silently dropped if they
    are stop words or too short, ie if they wouldn't be indexed.

    Args:
     search_query: string

    Returns:
      # this query
      SearchableQuery
     N/A N/A N/A datastore_types ValidateString search_query search query N/A N/A self _search_query search_query N/A self N/A _ToPb N/A N/A self limit N/A None N/A N/A Adds filters for the search query, then delegates to the superclass.

    Raises BadFilterError if a filter on the index property already exists.

    Args:
      # an upper bound on the number of results returned by the query.
      limit: int

    Returns:
      datastore_pb.Query
     N/A N/A N/A SearchableEntity _FULL_TEXT_INDEX_PROPERTY self N/A N/A N/A N/A datastore_errors BadFilterError N/A %s is a reserved name. N/A SearchableEntity _FULL_TEXT_INDEX_PROPERTY N/A pb N/A N/A N/A super SearchableQuery self _ToPb limit limit N/A N/A hasattr self _search_query N/A N/A keywords N/A N/A SearchableEntity _FullTextIndex N/A self _search_query N/A keyword keywords N/A N/A filter N/A N/A pb add_filter N/A N/A N/A filter set_op N/A N/A datastore_pb Query_Filter EQUAL N/A prop N/A N/A filter add_property N/A N/A N/A prop set_name N/A SearchableEntity _FULL_TEXT_INDEX_PROPERTY N/A N/A N/A N/A N/A prop mutable_value set_stringvalue keyword N/A pb N/A N/A SearchableModel N/A N/A db Model N/A N/A A subclass of db.Model that supports full text search and indexing.

  Automatically indexes all string-based properties. To search, use the all()
  method to get a SearchableModel.Query, then use its search() method.
   Query N/A N/A db Query N/A N/A A subclass of db.Query that supports full text search. N/A _search_query None search N/A N/A self search_query N/A N/A N/A Adds a full text search to this query.

      Args:
        search_query, a string containing the full text search query.

      Returns:
        self
       N/A N/A self _search_query search_query N/A self N/A _get_query N/A N/A self N/A N/A N/A Wraps db.Query._get_query() and injects SearchableQuery. N/A query N/A N/A N/A db Query _get_query self _query_class SearchableQuery N/A N/A self _search_query N/A N/A N/A N/A query Search N/A self _search_query N/A query N/A N/A _save_to_entity N/A N/A self N/A N/A N/A Wraps db.Model._save_to_entity() and injects SearchableEntity. N/A N/A N/A N/A db Model _save_to_entity self _entity_class SearchableEntity N/A all N/A N/A cls N/A N/A N/A Returns a SearchableModel.Query for this kind. N/A N/A N/A SearchableModel Query cls N/A classmethod N/A