inplace index transformation

Change-Id: I56abb873a6bba91078f21f06d6f09aa63f48ea9e
Reviewed-on: http://review.couchbase.org/30942
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>