Commits

Adrian Sampson committed 9864474

initial support for non-field queries

With this change, we can get slightly closer to letting plugins extend the
query syntax with queries that don't pertain to a specific field. This will
likely need some more tweaking in the future, but it should allow for
some very interesting things.

  • Participants
  • Parent commits 08efbc0

Comments (0)

Files changed (1)

         if os.sep in pattern and 'path' in all_keys:
             # This looks like a path.
             return PathQuery(pattern)
+        elif issubclass(query_class, FieldQuery):
+            # The query type matches a specific field, but none was
+            # specified. So we use a version of the query that matches
+            # any field.
+            return AnyFieldQuery(pattern, default_fields, query_class)
         else:
-            # Match any field.
-            return AnyFieldQuery(pattern, default_fields, query_class)
+            # Other query type.
+            return query_class(pattern)
 
     # A boolean field.
     elif key.lower() == 'comp':