Secondary Index Repository
==========================

All production secondary index related components (code, design, documentation) live here.


Secondary Index Repository
==========================

All production secondary index related components (code, design, documentation) live here.

###Setup and Build Instructions

    $ mkdir -p $GOPATH/src/github.com/couchbase
    $ cd $GOPATH/src/github.com/couchbase
    $ git clone git@github.com:couchbase/indexing.git
    $ cd indexing/secondary
    $ go get -d -v ./...
    $ ./build.sh

If build is successful, indexing/secondary/bin will have the binaries for projector and indexer.

####Starting Projector

Projector can be started with below command line options:

    bin > ./projector
    Usage : ./projector [OPTIONS] <cluster-addr> 
      -adminport="localhost:9999": adminport address
      -debug=false: enable debug level logging
      -info=false: enable info level logging
      -kvaddrs="127.0.0.1:12000": comma separated list of kvaddrs
      -trace=false: enable trace level logging
      
E.g. projector can be started in trace mode against Couchbase server running with 
cluster_run mode with the command:

    ./projector -trace localhost:9000
    

Projector has a sample test program which can be run using:

    go run tools/datapath.go

####Starting Indexer

Projector can be started with below command line options:

    bin > ./indexer -h
    Usage of ./indexer:
      -log=1: Log Level - 1(Info), 2(Debug), 3(Trace)
      -projector="http://localhost:9999": Projector Admin Port Address
      -vbuckets=1024: Number of vbuckets configured in Couchbase
    
    
E,g. indexer can be started for 8 vbuckets and log level of Info with the below command:

    ./indexer -vbuckets 8 -log 1
    
Currently the only entry point for Indexer is tuqtng command line shell. 
Follow the instructions for setting up the tuqtng project:

https://github.com/couchbaselabs/tuqtng#developers

Instead of the master branch, index-preview branch needs to be built. 
Rest of the instructions remain the same. 

And on the cbq shell, creating an index of type "forestdb" will allocate a new index
in the Indexer:

    cbq> create index idx1 on default(field1) using forestdb;
    






Add Build/Setup Instructions to Readme
Add Build/Setup Instructions to Readme

Updated Readme file with Build and Setup instructions
for Projector and Indexer

Change-Id: Ia59ae732359f347c51498377c9b0098748d99d86
Reviewed-on: http://review.couchbase.org/38959
Reviewed-by: John Liang <e1e1383402f9cdee00b021b8a653005f3061b036@gmail.com>
Reviewed-by: Pratap Chakravarthy <3f7aa3c5f732447448ccfcd013fd9591a9825870@couchbase.com>
Reviewed-by: Deepkaran Salooja <94315e58ef7caa1d9829288fe30465d5fa6ccd83@gmail.com>
Tested-by: Deepkaran Salooja <94315e58ef7caa1d9829288fe30465d5fa6ccd83@gmail.com>
