update readme

This commit is contained in:
Muhammad Asjad
2014-04-14 17:39:23 +05:00
committed by Muneeb Ali
parent 3e5a44b2ce
commit 90cf62d40e

View File

@@ -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: <machine_ip:port>/v1/gen_developer_key/<developer_id>
Example:
curl -i http://localhost:5003/v1/gen_developer_key/asjad
----------------------------------------------
2) Search API (powered by elastic search)
----------------------------------------------
syntax: <machine_ip>/v1/people-search/<developer_id>/<access_token>?keywords='<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:
<machine_ip>/v1/people/id=<onename_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: <machine_ip:port>/v1/gen_developer_key/<developer_id>
Example: curl -i http://localhost:5003/v1/gen_developer_key/asjad
----------------------------------------------
2) Search API
----------------------------------------------
syntax: <machine_ip>/v1/people-search/<developer_id>/<access_token>?keywords='<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: <machine_ip>/v1/people/id=<onename_id>
e.g
curl -i http://localhost:5003/v1/people/id=muneeb
//-----------------------------------------------------------------------------------------------------
https://github.com/onenameio/onename