Search¶
The search resource provides access to chef search. It supports filtering out only required fields instead of returning the entire objects from the chef server.
Supported Operations¶
API Reference¶
-
class
pastry.resources.search.
Search
[source]¶ Provides access to chef search
-
classmethod
index
()[source]¶ Fetches the available search indexes
Returns: The search indexes Return type: hash
-
classmethod
run
(index, query='*:*', rows=1000, start=0, filters=None)[source]¶ Runs the search query against the index. The default will return the a list of all of the properties of the match. Use the filters to select which fields should be returned by the query.
The filters should be a hash where the key is the name of the field in the returned hash, and the value is a space separated list of where in the index to find the value. e.g.:
{ 'name': [ 'name' ], 'ip': [ 'ipaddress' ], 'kernel_version': [ 'kernel', 'version' ] }
Parameters: - index (string) – The index to search against
- query (string) – The SOLR query to match the index against
- rows (integer) – The maximum number of rows to return
- start (integer) – The row to start at
- filters (hash) – The filters to apply to the result
Returns: The matching (and filtered) results
Return type: hash
-
classmethod