21
21
22
22
import org .apache .lucene .document .Document ;
23
23
import org .apache .lucene .document .Field .Store ;
24
+ import org .apache .lucene .document .LatLonDocValuesField ;
25
+ import org .apache .lucene .document .LatLonPoint ;
24
26
import org .apache .lucene .document .NumericDocValuesField ;
25
27
import org .apache .lucene .document .SortedSetDocValuesField ;
26
28
import org .apache .lucene .document .StringField ;
@@ -121,10 +123,13 @@ private void countTestCase(boolean withDeletions) throws Exception {
121
123
if (randomBoolean ()) {
122
124
doc .add (new StringField ("foo" , "bar" , Store .NO ));
123
125
doc .add (new SortedSetDocValuesField ("foo" , new BytesRef ("bar" )));
126
+ doc .add (new SortedSetDocValuesField ("docValuesOnlyField" , new BytesRef ("bar" )));
127
+ doc .add (new LatLonDocValuesField ("latLonDVField" , 1.0 , 1.0 ));
128
+ doc .add (new LatLonPoint ("latLonDVField" , 1.0 , 1.0 ));
124
129
}
125
130
if (randomBoolean ()) {
126
- doc .add (new StringField ("foo" , "bar " , Store .NO ));
127
- doc .add (new SortedSetDocValuesField ("foo" , new BytesRef ("bar " )));
131
+ doc .add (new StringField ("foo" , "baz " , Store .NO ));
132
+ doc .add (new SortedSetDocValuesField ("foo" , new BytesRef ("baz " )));
128
133
}
129
134
if (withDeletions && (rarely () || i == 0 )) {
130
135
doc .add (new StringField ("delete" , "yes" , Store .NO ));
@@ -140,6 +145,10 @@ private void countTestCase(boolean withDeletions) throws Exception {
140
145
Query tq = new TermQuery (new Term ("foo" , "bar" ));
141
146
Query tCsq = new ConstantScoreQuery (tq );
142
147
Query dvfeq = new DocValuesFieldExistsQuery ("foo" );
148
+ Query dvfeq_points = new DocValuesFieldExistsQuery ("latLonDVField" );
149
+ Query dvfeqCsq = new ConstantScoreQuery (dvfeq );
150
+ // field with doc-values but not indexed will need to collect
151
+ Query dvOnlyfeq = new DocValuesFieldExistsQuery ("docValuesOnlyField" );
143
152
BooleanQuery bq = new BooleanQuery .Builder ()
144
153
.add (matchAll , Occur .SHOULD )
145
154
.add (tq , Occur .MUST )
@@ -150,6 +159,9 @@ private void countTestCase(boolean withDeletions) throws Exception {
150
159
countTestCase (tq , reader , withDeletions , withDeletions );
151
160
countTestCase (tCsq , reader , withDeletions , withDeletions );
152
161
countTestCase (dvfeq , reader , withDeletions , true );
162
+ countTestCase (dvfeq_points , reader , withDeletions , true );
163
+ countTestCase (dvfeqCsq , reader , withDeletions , true );
164
+ countTestCase (dvOnlyfeq , reader , true , true );
153
165
countTestCase (bq , reader , true , true );
154
166
reader .close ();
155
167
w .close ();
0 commit comments