From 90cf62d40e1a0bf24acaeebb333f1d4684b7d535 Mon Sep 17 00:00:00 2001 From: Muhammad Asjad Date: Mon, 14 Apr 2014 17:39:23 +0500 Subject: [PATCH] update readme --- blockstack_search/search/README.md | 189 ++++++++++++++++------------- 1 file changed, 104 insertions(+), 85 deletions(-) diff --git a/blockstack_search/search/README.md b/blockstack_search/search/README.md index 4bb4d641d..a8e47eff1 100644 --- a/blockstack_search/search/README.md +++ b/blockstack_search/search/README.md @@ -1,5 +1,108 @@ # OneName Search +### Elastic Search + +Elastic Search library is not in github and resides at + +unix/lib/elastic + +the current version we're using is *0.90.2*. Download from: + +> wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.2.zip + + +### Requirements: + +requirements.txt files has been updated and contains all the project requriements. + +Notes: +before installing pylimbmc make sure libmemcache is installed: + + + brew install libmemcached + pip install pylibmc + +---------------------------------------------- + +Create Index: + python create_search_index.py --create_index + + +Note: Make sure mongodb and elastic search are running before creating index + +To test if elastic search is running: + + curl -X GET http://localhost:9200/ + +{ + "ok" : true, + "status" : 200, + "name" : "Angler", + "version" : { + "number" : "0.90.2", + "snapshot_build" : false, + "lucene_version" : "4.3.1" + }, + "tagline" : "You Know, for Search" + + + +---------------------------------------------- +API usage: +---------------------------------------------- + +1) Generate Developer key: + + +syntax: /v1/gen_developer_key/ + +Example: + + curl -i http://localhost:5003/v1/gen_developer_key/asjad + + +---------------------------------------------- +2) Search API (powered by elastic search) +---------------------------------------------- + +syntax: /v1/people-search//?keywords='' + +EXAMPLE: + +using username: + curl -i http://localhost:5003/v1/people-search/asjad/a0fe2f40415f7451c4ba2eae7da963d5?keywords=ryan + +using btc_address: + + curl -i http://localhost:5003/v1/people-search/asjad/a0fe2f40415f7451c4ba2eae7da963d5?keywords=1G6pazv8zjWKBWouXVgHHvgmRmSm7JmH3S + + + > keywords can accept username, twitter handle and btc + +* Experimental *: + + http://localhost:5003/v1/people-search/asjad/a0fe2f40415f7451c4ba2eae7da963d5?full-name = Muneeb Ali + http://localhost:5003/v1/people-search/asjad/a0fe2f40415f7451c4ba2eae7da963d5?twitter = muneeb + http://localhost:5003/v1/people-search/asjad/a0fe2f40415f7451c4ba2eae7da963d5?btc = muneeb + +---------------------------------------------- +3) Profile API (powered by mongodb) +---------------------------------------------- + +Syntax: + /v1/people/id= + +EXAMPLE: + + curl -i http://localhost:5003/v1/people/id=muneeb + + + +---------------------------------------------- +old Notes (to be deprecated): +---------------------------------------------- + + We currently have two search sub-systems to handle search queries: * Substring search on people names (just from full_name of people) @@ -32,88 +135,4 @@ Make sure that the packages listed in requirements.txt are installed before usin This will currently return upto a max of 20 results (can be less depending on the query) with data that follows structure of OneName profiles described here: -https://github.com/onenameio/onename - -## Installing on UNIX - -### Requirements - -All required packages for Python are listed in 'requirements.txt'. In addition to those, also requires Elastic Search. - -### Elastic Search - -Elastic Search library is not in github and resides at - -unix/lib/elastic - -the current version we're using is *0.90.2*. Download from: - -> wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.2.zip -> python scopesearch/create_search_index.py --create_people_index -> python scopesearch/create_search_index.py --create_company_index - -We'll simplify these steps in an upcoming release. We assume that both MongoDB and Elastic Search is running on the server. - ------------------------------------------------------------------------------------------------------ - -Notes: 14, April, 2014: - -Project dependecies: - -requirements.txt files has been updated and contains all the project requriements. - -Notes: -before installing pylimbmc make sure libmemcache is installed: - - - brew install libmemcached - pip install pylibmc - ----------------------------------------------- - -Create Index: python create_search_index.py --create_index - - -Note: Make sure mongodb and elastic search are running before creating index - - ----------------------------------------------- -API usage: ----------------------------------------------- - -1) Generate Developer key: - - -syntax: /v1/gen_developer_key/ - -Example: curl -i http://localhost:5003/v1/gen_developer_key/asjad - - ----------------------------------------------- -2) Search API ----------------------------------------------- - -syntax: /v1/people-search//?keywords='' -e.g: -http://localhost:5003/v1/people-search/asjad/a0fe2f40415f7451c4ba2eae7da963d5?keywords=ryan - - -http://localhost:5003/v1/people-search/asjad/a0fe2f40415f7451c4ba2eae7da963d5?keywords=1G6pazv8zjWKBWouXVgHHvgmRmSm7JmH3S -keywords can accept username, twitter handle and btc - -* Experimental *: -http://localhost:5003/v1/people-search/asjad/a0fe2f40415f7451c4ba2eae7da963d5?twitter = muneeb -http://localhost:5003/v1/people-search/asjad/a0fe2f40415f7451c4ba2eae7da963d5?btc = muneeb - ----------------------------------------------- -3) Profile API ----------------------------------------------- - -Syntax: /v1/people/id= -e.g -curl -i http://localhost:5003/v1/people/id=muneeb - - -//----------------------------------------------------------------------------------------------------- - - +https://github.com/onenameio/onename \ No newline at end of file