Skip to content

Latest commit

 

History

History
71 lines (58 loc) · 1.72 KB

File metadata and controls

71 lines (58 loc) · 1.72 KB
title HTTP Search Query
description
project riak_kv
project_version 2.2.3
menu
riak_kv-2.2.3
name identifier weight parent
Search Query
http_search_query
113
apis_http
toc true
aliases
/riak/2.2.3/dev/references/http/search-query
/riak/kv/2.2.3/dev/references/http/search-query

Performs a Riak KV Search query.

Request

GET /search/query/<index_name>

Optional Query Parameters

Query parameters must be UTF-8 encoded.

  • wt --- The response writer to be used when returning the Search payload. The currently available options are json and xml. The default is xml.
  • q --- The actual Search query itself. Examples can be found in Using Search. If a query is not specified, Riak will return information about the index itself, e.g. the number of documents indexed.

Normal Response Codes

  • 200 OK

Typical Error Codes

  • 400 Bad Request --- Returned when, for example, a malformed query is supplied
  • 404 Object Not Found --- Returned if the Search index you are attempting to query does not exist
  • 503 Service Unavailable --- The request timed out internally

Response

If a 200 OK is returned, then the Search query has been successful. Below is an example JSON response from querying an index that currently has no documents associated with it:

{
  "response": {
    "docs": [],
    "maxScore": 0.0,
    "numFound": 0,
    "start": 0
  },
  "responseHeader": {
    "status": 0,
    "QTime": 10,
    "params": { /* internal info from the query */ }
  }
}