Call -[CBLDatabase createIndexOn:…]. Indexes are persistent, but the call is a no-op if the index already exists, so there’s no harm in creating your indexes on every launch. If indexes become obsolete it’s best to delete the old ones, though.
As for what to index, it’s usually the property or properties being tested by the ‘where’ predicate.
If that looks like “cost >= $MINCOST and cost <= $MAXCOST”, you’d want to index “cost”.
If it’s “type == ‘lampshade’ && cost >= $MINCOST”, then you want an index on [type, cost].
Also, if what you’re comparing is the result of an expression on a property, you should index that expression, not just the property. So if the query is for “lowercase(name) == $NAME”, then you should index “lowercase(name)”, not “name”.