When an extremely complex and common query is used frequently, storing that query can provide significant performance improvements. Stored queries can be submitted as either a string query or a structured query.
Stores a query under the given name. If a query already exists with this name, an error is thrown.
Query names are allowed to be alpha numeric. All named queries can be used in structured queries, but if the name contains a colon it may also be used in string queries. The prefix before the colon must first be registered via the named query prefix management endpoint.
A user could store a named query for every zip code in the United States. Each one of these named queries could start with "zip:" and in a string query a user could search for
zip:90210 to search around Beverly Hills.
Returns the named query specified in the request.
Returns named queries that match the provided parameters. To retrieve all the named queries, don't supply any parameters.
Removes the named query.
Might be nice to be able to POST a new document and see which queries would match it, without first saving the document to the database. Same by specifying a URI too.
Might be nice to have a bulk delete, where you delete queries matching a constraint.