Query firebase username

I am trying to query username from firebase, its not fetching the query and i get this log does anyone know what this means?

Using an unspecified index. Consider adding “.indexOn”:
“contacts/t25ha71bw0gRIU9HRhY2ecGSAS03” at /users to your security
rules for better performance

  • getting data out of a closure that retrieves data from firebase
  • Sort array by distance near user location from firebase
  • How to cancel Firebase setValue while pending for completion (when offline)
  • How would I store a video into firebase storage from swift?
  • Edit templates Authentication Firebase
  • Retrieve multiple photos under a node from Firebase Storage
  • Rules on Firebase

    {
      "rules": {
        ".read": "(auth != null)",
        ".write": "(auth != null)",
        "location":{
          "$uid": {
            ".indexOn": ["lat","long"] 
          }
        },
        "events": {
          "$uid": {
            ".read": "(auth != null) && !data.child('deleted').exists()",
            ".write": "(auth != null)",
            ".indexOn": ["name", "owner"]
          }
        },
        "groups": {
          "$uid": {
            ".read": "(auth != null) && !data.child('deleted').exists()",
            ".indexOn": ["name", "members", "owner"]
          }
        },
        "users": {
          "$uid": {
            ".read": "(auth != null) && !data.child('deleted').exists()",
            "contacts" : {
              ".indexOn": ".value"
            },
            ".indexOn": ["username"]
          }
        }
      }
    }
    

    Search Query

       func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String)     {
        updateSearchResult(text: searchText)
        guard !searchText.isEmpty else { return }
    
        DispatchQueue.global(qos: .userInteractive).asyncAfter(deadline: DispatchTime.now() + .seconds(1)) {
            if self.contactType == .contact {
                AppFirRef.userRef.queryOrdered(byChild:"username")
                    .queryStarting(atValue: searchText)
                    .queryEnding(atValue: searchText+"\\uf8ff")
                    .observeSingleEvent(of: .value, with: { (snapshot) in
                    var contacts = Set<LAContact>()
                    for case let snap as FIRDataSnapshot in snapshot.children {
                        guard let value = snap.value as? [String : Any] else { continue }
                        let item = LAContact(value: value)
                        contacts.insert(item)
                    }
                    let filteredItems = self.filteredItems as! [LAContact]
                    let filtereSet = contacts.union(filteredItems)
                    self.filteredItems = Array(filtereSet)
                    self.tableView.reloadData()
                })
            }
        }
    }
    

    AppFirRef

    final class AppFirRef {
    static let baseRef = FIRDatabase.database().reference()
        static var currentUserRef: FIRDatabaseReference! {
            guard let user = FIRAuth.auth()?.currentUser else { return nil }
            return userRef.child(user.uid)
        }
        static var userRef = baseRef.child("users")
        static var eventRef = baseRef.child("events")
        static var groupRef = baseRef.child("groups")
        static var messageRef = baseRef.child("messages")
    }