From 78de7ed98abff93fe5fef94907bcfa4f76dcef07 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Sat, 27 May 2017 10:27:51 -0700 Subject: adding docs to repo --- docs/build/HTTP-APIs/Search/index.html | 983 +++++++++++++++++++++++++++++++++ 1 file changed, 983 insertions(+) create mode 100644 docs/build/HTTP-APIs/Search/index.html (limited to 'docs/build/HTTP-APIs/Search/index.html') diff --git a/docs/build/HTTP-APIs/Search/index.html b/docs/build/HTTP-APIs/Search/index.html new file mode 100644 index 0000000..45c41f2 --- /dev/null +++ b/docs/build/HTTP-APIs/Search/index.html @@ -0,0 +1,983 @@ + + + + + + + + + + + + + + + + + + Full-text Search HTTP API + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + +
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ + + +

Search

+ +

Ponzu provides a read-only HTTP API to search the contents of your system's database. +Full-text search is made possible by the use of Bleve, +which handles the indexing and querying.

+
+

Endpoints

+

Search Content

+

GET /api/search?type=<Type>&q=<Query String>

+
+

Search must be enabled individually for each Content type

+
    +
  • Search is not on by default to protect your data in case it shouldn't be indexed and published via the API.
  • +
  • SearchMapping() is implemented with default mapping (ideal for 99% of use cases).
  • +
  • To enable search, add a IndexContent() bool method to your content type and return true (default implementation returns false).
  • +
+
+
    +
  • +

    <Type> must implement db.Searchable

    +
  • +
  • +

    Search is currently limited to single <Type> per request

    +
  • +
  • +

    <Query String> documentation here: Bleve Docs - Query String

    +
  • +
  • +

    Search results are formatted exactly the same as standard Content API calls, so you don't need to change your client data model

    +
  • +
  • +

    Search handler will respect other interface implementations on your content, including:

    + +
  • +
+
Sample Response
+
{
+  "data": [
+    {
+        "uuid": "024a5797-e064-4ee0-abe3-415cb6d3ed18",
+        "id": 6,
+        "slug": "item-id-024a5797-e064-4ee0-abe3-415cb6d3ed18", // customizable
+        "timestamp": 1493926453826, // milliseconds since Unix epoch
+        "updated": 1493926453826,
+        // your content data...,
+    }
+  ]
+}
+
+ + + + + + + +
+
+
+
+ + + + +
+ + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3