Range Queries - How to build primary OR secondary index

Hello, I am using couchbase 3.0.2 with the clanguage library on x64 linux (centos 6.5x+) (along with dependent PHP and GoLang interfaces to that c-library)