From 8fde23ef19cb66dda02df1bcd66854fd8cd5f3cc Mon Sep 17 00:00:00 2001 From: Kishore Nallan Date: Thu, 29 Mar 2018 08:28:35 +0530 Subject: [PATCH] More README tweaks. --- README.md | 20 ++++++++++++++------ src/main/typesense_server.cpp | 6 ++++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 63abc962..0eeabc58 100644 --- a/README.md +++ b/README.md @@ -27,15 +27,23 @@ Linux (x86-64) and Mac. You can also run Typesense from our [official Docker image](https://hub.docker.com/r/typesense/typesense): +## Quick Start + +Here's a quick example showcasing how you can create a collection, index a document and search it on Typesense. + +Let's begin by starting the Typesense server via Docker: + ``` docker run -p 8108:8108 -v/tmp/data:/data typesense/typesense:0.8.0 --data-dir /data --api-key=Hu52dwsas2AdxdE ``` -## Quick Start +Install the Python client for Typesense: + +``` +pip install typesense +``` -Here's a quick example showcasing how you can create a collection, index a document and search it on Typesense. - -Let's initialize the client and create a `companies` collection: +We can now initialize the client and create a `companies` collection: ```python import typesense @@ -100,7 +108,7 @@ A detailed guide is available on [Typesense website](https://typesense.org/guide The docker build script takes care of all required dependencies, so it's the easiest way to build Typesense: ``` -$ TYPESENSE_IMG_VERSION=nightly ./docker-build.sh --build-deploy-image [--clean] [--depclean] +TYPESENSE_VERSION=nightly ./docker-build.sh --build-deploy-image --create-binary [--clean] [--depclean] ``` **Building on your machine** @@ -114,7 +122,7 @@ Typesense requires the following dependencies: * curl ``` -$ ./build.sh [--clean] [--depclean] +./build.sh --create-binary [--clean] [--depclean] ``` The first build will take some time since other third-party libraries are pulled and built as part of the build process. diff --git a/src/main/typesense_server.cpp b/src/main/typesense_server.cpp index 8a2fcfb7..08fe1b45 100644 --- a/src/main/typesense_server.cpp +++ b/src/main/typesense_server.cpp @@ -72,8 +72,10 @@ int main(int argc, char **argv) { signal(SIGTERM, catch_interrupt); cmdline::parser options; + options.set_program_name("./typesense-server"); + options.add("data-dir", 'd', "Directory where data will be stored.", true); - options.add("api-key", 'k', "API key that allows all operations.", true); + options.add("api-key", 'a', "API key that allows all operations.", true); options.add("search-only-api-key", 's', "API key that allows only searches.", false); options.add("listen-address", 'h', "Address to which Typesense server binds.", false, "0.0.0.0"); @@ -82,7 +84,7 @@ int main(int argc, char **argv) { "format to start the server as a read-only replica.", false, ""); options.add("ssl-certificate", 'c', "Path to the SSL certificate file.", false, ""); - options.add("ssl-certificate-key", 'e', "Path to the SSL certificate key file.", false, ""); + options.add("ssl-certificate-key", 'k', "Path to the SSL certificate key file.", false, ""); options.add("enable-cors", '\0', "Enable CORS requests."); options.add("log-dir", '\0', "Path to the log file.", false, "");