Exemple #1
0
 def _parse_index_definition(self, index_field):
     """Parse a field definition for an index, returning a Getter."""
     # Note: We may want to keep a Parser object around, and cache the
     #       Getter objects for a greater length of time. Specifically, if
     #       you create a bunch of indexes, and then insert 50k docs, you'll
     #       re-parse the indexes between puts. The time to insert the docs
     #       is still likely to dominate put_doc time, though.
     parser = query_parser.Parser()
     getter = parser.parse(index_field)
     return getter
Exemple #2
0
 def _evaluate_index(self, raw_doc, field):
     parser = query_parser.Parser()
     getter = parser.parse(field)
     return getter.get(raw_doc)
Exemple #3
0
 def __init__(self, index_name, index_definition):
     self._name = index_name
     self._definition = index_definition
     self._values = {}
     parser = query_parser.Parser()
     self._getters = parser.parse_all(self._definition)
Exemple #4
0
 def parse_all(self, specs):
     parser = query_parser.Parser()
     return parser.parse_all(specs)
Exemple #5
0
 def parse(self, spec):
     parser = query_parser.Parser()
     return parser.parse(spec)
Exemple #6
0
 def setUp(self):
     super(TestMakeTree, self).setUp()
     self.parser = query_parser.Parser()