I see that because the index is concatenated together and sorted, my date ranges are completely ignored.
Is there no way to accomplish such a simple usecase? The alternative I thought of was to invert the emit and put the dates first, but I do not want to group by dates. I merely would like to filter the date range and only group by my 2 parameters. I guess if I can specify that the grouping start at an offset to my keys, then I could accomplish what I need…
The query you have here will include years outside of 2014. For example, the key [“text1”,“foobar”,2013,01,01] would be included in this aggregate data.
Your probably going to want to emit the date only, do a range scan on the date range desired with reduce=false and then do the aggregate part in code. Otherwise there’s N1QL, which will do the same thing via a declarative query.
Also, don’t disregard RDBMS. NoSQL is NOT the best approach for every situation.
Thanks. I think it would be a great addition to couchbase if we were able to separate out indexes to some degree. I understand the additional indexing tradeoff, but if kept in balance with application demand it is a boon to developers.
i.e. something that will allow the use of more than ONE index on a view to facilitate more powerful query filtering.