I want to search the data with four composite keys in such a way that each key is searched independently. for example:-
-
My view bucket Format:-
function (doc, meta) {
emit([doc.Language , doc.Nationality , doc.check_in , doc.occupancy] , [ doc.cost , doc.val ] );
} -
My search query format in java:-
query.setRangeStart(ComplexKey.of(language , nationality , getCheckIn(start_date) , new Integer( occupancy) ));
query.setRangeEnd(ComplexKey.of(language , nationality , getCheckIn(end_date) , new Integer( occupupancy) ));
Whenever i search for something if i do not have the results for particular key sequence then “it prints the result of previous keys sequence” instead of 0 . So if i have such query…
In couchbase i have 10 results for query(English , India , 2015-02-18) and I have 0 results for query(English , India , 2015-02-18, 2).
So the issue is whenever i search for query(English , India , 2015-02-18, 2) in java using above given query it gives me 10 results instead of 0 results And i want output should be 0 for those query if i do not have the result in couchbase. Please let me know if there is any other alternative? or can i do it using setKeys or not and how ??
In short :
If i do not have the result for “particular key sequence” it should print zero result instead of printing “previous key results” . I want to filter the data just as we do in sql using where clause… how to achieve that?