REST API For Nozama CloudSearch

Contents:

Introduction

This documents the CloudSearch API I am implementing and how its called. I also document the Nozama specifc REST API used to check the outcomes of earlier calls.

Amazon CloudSearch

These are the REST API calls I currently implement from Amazon’s CloudSearch API. The <api version> can be any string currently, I don’t check or enforce any value here.

Reference:

POST /<api version>/documents/batch

This is used to batch load documents for later querying. This loads documents from the Amazon SDF and adds/removes from mongo accordingly.

This will return a JSON response property:

rc = dict(
    status='ok',
    adds=0+,
    deletes=0+,
    error='',
    warning='',
)
Reference:

Nozama Specific

GET /dev/documents

This will return all documents add and removed from the the system by subsequent batch uploads.

# This returns a list of ...

{
    'documents_removed': [
        {
            'lang': 'en',
            'fields': {...},
            'version': '...',
            'id': '...'
        },
        :
        etc
    ],
    'documents': [
        {
            'lang': 'en',
            'fields': {...},
            'version': '...',
            'id': '...'
        },
        :
        etc
    ]
}

DELETE /dev/documents

This will remove all documents currently stored on the system. This is useful for cleaning out before a test run.

# This returns a status dict e.g.:
{
    'status': 'ok',
    'message': 'Documents Removed OK.',
    'traceback': '',
    'error': ''
}

GET /ping

This can be used to check the service is up and running. It will return a JSON structure in the form:

{
    'status': 'ok',
    # This will contain the current version number.
    'version': 'X.Y.Z',
    'name': 'nozama-cloudsearch-service'
}

GET /docs/

The service self hosts its own documentation. This is the same

Read the Docs v: latest
Versions
latest
Downloads
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.