41
41
* the result set is equivalent across all implementations.
42
42
*
43
43
* <p>The Query engine will use indexed-based execution if a user has configured any index that can
44
- * be used to execute query (via {@link FirebaseFirestore#setIndexConfiguation }). Otherwise, the
44
+ * be used to execute query (via {@link FirebaseFirestore#setIndexConfiguration }). Otherwise, the
45
45
* engine will try to optimize the query by re-using a previously persisted query result. If that is
46
46
* not possible, the query will be executed via a full collection scan.
47
47
*
@@ -86,8 +86,7 @@ public ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingQuery(
86
86
ImmutableSortedSet <DocumentKey > remoteKeys ) {
87
87
hardAssert (initialized , "initialize() not called" );
88
88
89
- ImmutableSortedMap <DocumentKey , Document > result =
90
- performQueryUsingIndex (query , query .toTarget ());
89
+ ImmutableSortedMap <DocumentKey , Document > result = performQueryUsingIndex (query );
91
90
if (result != null ) {
92
91
return result ;
93
92
}
@@ -104,13 +103,13 @@ public ImmutableSortedMap<DocumentKey, Document> getDocumentsMatchingQuery(
104
103
* Performs an indexed query that evaluates the query based on a collection's persisted index
105
104
* values. Returns {@code null} if an index is not available.
106
105
*/
107
- private @ Nullable ImmutableSortedMap <DocumentKey , Document > performQueryUsingIndex (
108
- Query query , Target target ) {
106
+ private @ Nullable ImmutableSortedMap <DocumentKey , Document > performQueryUsingIndex (Query query ) {
109
107
if (query .matchesAllDocuments ()) {
110
108
// Don't use index queries that can be executed by scanning the collection.
111
109
return null ;
112
110
}
113
111
112
+ Target target = query .toTarget ();
114
113
IndexType indexType = indexManager .getIndexType (target );
115
114
116
115
if (indexType .equals (IndexType .NONE )) {
0 commit comments