File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
crud/src/main/java/com/redhat/lightblue/assoc/ep Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -218,9 +218,7 @@ public void commit() {
218
218
// Try to build an index from results
219
219
MemDocIndex docIndex =null ;
220
220
if (aq .getQuery ()!=null &&numSlots >MEM_INDEX_THRESHOLD ) {
221
- // Lets see if we can build a key spec from this query
222
- GetIndexKeySpec giks =new GetIndexKeySpec (aq .getQueryFieldInfo ());
223
- KeySpec keySpec =giks .iterate (aq .getQuery ());
221
+ KeySpec keySpec =aq .getIndexKeySpec ();
224
222
LOGGER .debug ("In-memory index key spec:{}" ,keySpec );
225
223
if (keySpec !=null ) {
226
224
// There is a key spec, meaning we can index the docs
Original file line number Diff line number Diff line change 12
12
import com .redhat .lightblue .assoc .QueryFieldInfo ;
13
13
import com .redhat .lightblue .assoc .AnalyzeQuery ;
14
14
15
+ import com .redhat .lightblue .mindex .GetIndexKeySpec ;
16
+ import com .redhat .lightblue .mindex .KeySpec ;
17
+
15
18
import com .redhat .lightblue .query .QueryExpression ;
16
19
17
20
/**
@@ -25,6 +28,8 @@ public class AssociationQuery {
25
28
// If non-null, query is either always true or always false
26
29
private final Boolean always ;
27
30
private final List <QueryFieldInfo > qfi ;
31
+ // In-memory index key spec
32
+ private final KeySpec keySpec ;
28
33
29
34
public AssociationQuery (CompositeMetadata root ,
30
35
CompositeMetadata currentEntity ,
@@ -61,11 +66,18 @@ public AssociationQuery(CompositeMetadata root,
61
66
} else {
62
67
always =null ;
63
68
}
69
+ keySpec =null ;
64
70
} else {
65
71
query = Searches .and (queries );
72
+ GetIndexKeySpec giks =new GetIndexKeySpec (qfi );
73
+ keySpec =giks .iterate (query );
66
74
always =null ;
67
75
}
68
76
}
77
+
78
+ public KeySpec getIndexKeySpec () {
79
+ return keySpec ;
80
+ }
69
81
70
82
public List <QueryFieldInfo > getQueryFieldInfo () {
71
83
return qfi ;
You can’t perform that action at this time.
0 commit comments