I am having a customer nearly 20380 records. I am trying to perform search action using the following code
$('body').on('keyup','.client_txtbox',function(){
var srchTerm = $(this).val();
var clientref = firebase.database().ref(client_root);
var escp = srchTerm+"\uf8ff";
clientref.orderByChild("client_firstname").startAt(srchTerm).endAt(escp).limitToFirst(5).once("value", function(snapshot) {
console.log(snapshot.val());
});
});
This above code is working.But I need to search multiple fields.My data looks like this
I need to search using child values like mobile number,lastname,email. I tried using orderByChild multiple times like this
clientref.orderByChild("client_firstname").startAt(srchTerm).endAt(escp).orderByChild("client_mobilenumber").startAt(srchTerm).endAt(escp).limitToFirst(5).once("value", function(snapshot) {
console.log(snapshot.val());
});
But this is not working. The first code is working but its really slow. Can someone please help me with this? Thanks in advance.