Hello,
I’m very new to Couchbase, and testing some queries on it these days.
In Couchbase, it seems that we should pre-define ‘view’ before I execute query. So, every sample article explains how to define views for each condition such as 'by_country", “by_lanuage”, and “by_age”.
I can create some of pre-defined views for our service. However, our service also has a kind of search ui to let our customers make a custom search condition themselves. For example, customers can make a condition like ‘country == US AND language == English AND age >= 20 AND score >= 10’. We have more than 10 felids which can be selected in the search ui.
I see that some of view examples use ‘emit multiple keys’ and use ‘start & end keys’ for multiple column search. However, It seems that we can’t use that way. The number of selected columns is not pre-defined and their values are not always sequential.
Therefore, I’m thinking to programatically create a view on every customer’s search request. Do you guys think it is a good approach in Couchbase? I actually worry of two things below:
-
Creating a view may take a long time since it should create a index. So, the search request may take too long time.
-
I’ve found how to programatically a view with API. However it seems that this api is only for development, not production. Is there any API to publish a production view?
What do you guys think of my issue?
Thank you guys in advance!