@@ -322,7 +322,7 @@ private SortedSet<IndexEntry> computeIndexEntries(Document document, FieldIndex
322
322
323
323
private void addIndexEntry (Document document , IndexEntry indexEntry ) {
324
324
db .execute (
325
- "INSERT INTO index_entries (index_id, uid, array_value, directional_value, document_name ) "
325
+ "INSERT INTO index_entries (index_id, uid, array_value, directional_value, document_key ) "
326
326
+ "VALUES(?, ?, ?, ?, ?)" ,
327
327
indexEntry .getIndexId (),
328
328
uid ,
@@ -334,7 +334,7 @@ private void addIndexEntry(Document document, IndexEntry indexEntry) {
334
334
private void deleteIndexEntry (Document document , IndexEntry indexEntry ) {
335
335
db .execute (
336
336
"DELETE FROM index_entries WHERE index_id = ? AND uid = ? AND array_value = ? "
337
- + "AND directional_value = ? AND document_name = ?" ,
337
+ + "AND directional_value = ? AND document_key = ?" ,
338
338
indexEntry .getIndexId (),
339
339
uid ,
340
340
indexEntry .getArrayValue (),
@@ -347,7 +347,7 @@ private SortedSet<IndexEntry> getExistingIndexEntries(
347
347
SortedSet <IndexEntry > results = new TreeSet <>();
348
348
db .query (
349
349
"SELECT array_value, directional_value FROM index_entries "
350
- + "WHERE index_id = ? AND document_name = ? AND uid = ?" )
350
+ + "WHERE index_id = ? AND document_key = ? AND uid = ?" )
351
351
.binding (fieldIndex .getIndexId (), documentKey .toString (), uid )
352
352
.forEach (
353
353
row ->
@@ -424,7 +424,7 @@ private SQLitePersistence.Query generateQuery(
424
424
// Build the statement. We always include the lower bound, and optionally include an array value
425
425
// and an upper bound.
426
426
StringBuilder statement = new StringBuilder ();
427
- statement .append ("SELECT document_name , directional_value FROM index_entries " );
427
+ statement .append ("SELECT document_key , directional_value FROM index_entries " );
428
428
statement .append ("WHERE index_id = ? AND uid = ? " );
429
429
if (arrayValues != null ) {
430
430
statement .append ("AND array_value = ? " );
@@ -439,14 +439,14 @@ private SQLitePersistence.Query generateQuery(
439
439
// Create the UNION statement by repeating the above generated statement. We can then add
440
440
// ordering and a limit clause.
441
441
StringBuilder sql = repeatSequence (statement , statementCount , " UNION " );
442
- sql .append (" ORDER BY directional_value, document_name " );
442
+ sql .append (" ORDER BY directional_value, document_key " );
443
443
if (target .getLimit () != -1 ) {
444
444
sql .append ("LIMIT " ).append (target .getLimit ()).append (" " );
445
445
}
446
446
447
447
if (notIn != null ) {
448
448
// Wrap the statement in a NOT-IN call.
449
- sql = new StringBuilder ("SELECT document_name , directional_value FROM (" ).append (sql );
449
+ sql = new StringBuilder ("SELECT document_key , directional_value FROM (" ).append (sql );
450
450
sql .append (") WHERE directional_value NOT IN (" );
451
451
sql .append (repeatSequence ("?" , notIn .length , ", " ));
452
452
sql .append (")" );
0 commit comments