Searching for string in string (LIKE query)

I’m using the GO SDK to search my Couchbase database. I have this exact match query working:


But I want to do use a ‘LIKE’ query instead (using FTS). For example, find “garden” in this string “driveway, garden, shed”.

How do I do that in Go?

Hi @benrolfe,

I think that this is partially going to depend on what indexes you have.


On its own this query should search for the term “garden” in the “Features” property of a document.

There’s an example, and brief description, of different types of search query at (you’ll need the indexes from and the travel-sample bucket loaded to run these). For example if you take the simpleTextQuery from that page, the query will search all fields of documents for the term “swanky”. If you were to change that query to cbft.NewMatchQuery("swanky").Field("description") then it would search only on the description fields.