SOLR-5652: in cursor tests, don't sort on 'plain' docvalue fields (i.e., those using standard Lucene sorting for missing values) when the codec doesn't support missing docvalues.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1566741 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2014-02-10 20:55:12 +00:00
parent b872f4b5c3
commit 88f16b6069
1 changed files with 7 additions and 4 deletions

View File

@ -634,21 +634,24 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
* </p>
* <ul>
* <li><code>_version_</code> is removed</li>
* <li><code>dv_last</code> and <code>dv_first</code> fields are removed
* if the codec doesn't support them</li>
* <li>
* <code>*_dv_last</code>, <code>*_dv_first</code> and <code>*_dv</code>
* fields are removed if the codec doesn't support missing DocValues
* </li>
* </ul>
* @see #defaultCodecSupportsMissingDocValues
*/
public static List<String> pruneAndDeterministicallySort(Collection<String> raw) {
final boolean prune_dv_missing = ! defaultCodecSupportsMissingDocValues();
final boolean prune_dv = ! defaultCodecSupportsMissingDocValues();
ArrayList<String> names = new ArrayList<String>(37);
for (String f : raw) {
if (f.equals("_version_")) {
continue;
}
if (prune_dv_missing && (f.endsWith("_dv_last") || f.endsWith("_dv_first")) ) {
if (prune_dv && (f.endsWith("_dv_last") || f.endsWith("_dv_first"))
|| f.endsWith("_dv")) {
continue;
}
names.add(f);