You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2017/06/15 16:16:08 UTC
[1/7] lucene-solr:jira/SOLR-10834: LUCENE-7500: Remove
LeafReader.fields in lieu of LeafReader.terms. Optimized
MultiFields.getTerms.
Repository: lucene-solr
Updated Branches:
refs/heads/jira/SOLR-10834 7b95773bd -> 8f1043840
refs/heads/master abc393dbf -> f1e2be645
LUCENE-7500: Remove LeafReader.fields in lieu of LeafReader.terms.
Optimized MultiFields.getTerms.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/abc393db
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/abc393db
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/abc393db
Branch: refs/heads/jira/SOLR-10834
Commit: abc393dbfdb805361747ef651393332968851f3d
Parents: c3c8955
Author: David Smiley <ds...@apache.org>
Authored: Thu Jun 15 00:59:01 2017 -0400
Committer: David Smiley <ds...@apache.org>
Committed: Thu Jun 15 00:59:01 2017 -0400
----------------------------------------------------------------------
lucene/CHANGES.txt | 5 ++
.../org/apache/lucene/index/CodecReader.java | 11 ++--
.../lucene/index/ExitableDirectoryReader.java | 40 ++----------
.../java/org/apache/lucene/index/Fields.java | 10 ++-
.../apache/lucene/index/FilterLeafReader.java | 6 +-
.../org/apache/lucene/index/LeafReader.java | 15 +----
.../apache/lucene/index/MergeReaderWrapper.java | 7 +-
.../org/apache/lucene/index/MultiFields.java | 69 ++++++++++++++++++--
.../apache/lucene/index/ParallelLeafReader.java | 33 +++++-----
.../lucene/index/SlowCodecReaderWrapper.java | 16 +++--
.../apache/lucene/index/SortingLeafReader.java | 6 +-
.../index/TestExitableDirectoryReader.java | 16 +----
.../lucene/index/TestFilterLeafReader.java | 17 +----
.../lucene/index/TestParallelTermEnum.java | 20 ++----
.../lucene/search/TermInSetQueryTest.java | 24 +++----
.../org/apache/lucene/search/TestTermQuery.java | 43 ++++++------
.../search/highlight/TermVectorLeafReader.java | 8 +--
.../highlight/WeightedSpanTermExtractor.java | 25 ++-----
.../lucene/search/uhighlight/PhraseHelper.java | 29 +++-----
.../TermVectorFilteredLeafReader.java | 22 +------
.../apache/lucene/index/memory/MemoryIndex.java | 8 +--
.../lucene/index/AssertingLeafReader.java | 7 +-
.../index/BaseIndexFileFormatTestCase.java | 2 +-
.../index/BasePostingsFormatTestCase.java | 15 ++---
.../lucene/index/FieldFilterLeafReader.java | 9 ++-
.../org/apache/lucene/search/QueryUtils.java | 26 ++------
.../solr/index/SlowCompositeReaderWrapper.java | 4 +-
.../test/org/apache/solr/search/TestDocSet.java | 5 +-
28 files changed, 214 insertions(+), 284 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 2c49c96..96cfb3a 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -69,6 +69,11 @@ API Changes
* LUCENE-7850: Removed support for legacy numerics. (Adrien Grand)
+* LUCENE-7500: Removed abstract LeafReader.fields(); instead terms(fieldName)
+ has been made abstract, fomerly was final. Also, MultiFields.getTerms
+ was optimized to work directly instead of being implemented on getFields.
+ (David Smiley)
+
Bug Fixes
* LUCENE-7626: IndexWriter will no longer accept broken token offsets
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/core/src/java/org/apache/lucene/index/CodecReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/CodecReader.java b/lucene/core/src/java/org/apache/lucene/index/CodecReader.java
index 460a9d6..9efcf25 100644
--- a/lucene/core/src/java/org/apache/lucene/index/CodecReader.java
+++ b/lucene/core/src/java/org/apache/lucene/index/CodecReader.java
@@ -98,12 +98,15 @@ public abstract class CodecReader extends LeafReader implements Accountable {
throw new IndexOutOfBoundsException("docID must be >= 0 and < maxDoc=" + maxDoc() + " (got docID=" + docID + ")");
}
}
-
+
@Override
- public final Fields fields() {
- return getPostingsReader();
+ public final Terms terms(String field) throws IOException {
+ //ensureOpen(); no; getPostingsReader calls this
+ // We could check the FieldInfo IndexOptions but there's no point since
+ // PostingsReader will simply return null for fields that don't exist or that have no terms index.
+ return getPostingsReader().terms(field);
}
-
+
// returns the FieldInfo that corresponds to the given field and type, or
// null if the field does not exist, or not indexed as the requested
// DovDocValuesType.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java b/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java
index a9b7472..fa1f6ba 100644
--- a/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java
+++ b/lucene/core/src/java/org/apache/lucene/index/ExitableDirectoryReader.java
@@ -17,14 +17,13 @@
package org.apache.lucene.index;
-import org.apache.lucene.index.FilterLeafReader.FilterFields;
+import java.io.IOException;
+
import org.apache.lucene.index.FilterLeafReader.FilterTerms;
import org.apache.lucene.index.FilterLeafReader.FilterTermsEnum;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.automaton.CompiledAutomaton;
-import java.io.IOException;
-
/**
* The {@link ExitableDirectoryReader} wraps a real index {@link DirectoryReader} and
@@ -79,14 +78,12 @@ public class ExitableDirectoryReader extends FilterDirectoryReader {
}
@Override
- public Fields fields() throws IOException {
- Fields fields = super.fields();
- if (queryTimeout.isTimeoutEnabled()) {
- return new ExitableFields(fields, queryTimeout);
- }
- else {
- return fields; // break out of wrapper as soon as possible
+ public Terms terms(String field) throws IOException {
+ Terms terms = in.terms(field);
+ if (terms == null) {
+ return null;
}
+ return (queryTimeout.isTimeoutEnabled()) ? new ExitableTerms(terms, queryTimeout) : terms;
}
// this impl does not change deletes or data so we can delegate the
@@ -104,29 +101,6 @@ public class ExitableDirectoryReader extends FilterDirectoryReader {
}
/**
- * Wrapper class for another Fields implementation that is used by the ExitableFilterAtomicReader.
- */
- public static class ExitableFields extends FilterFields {
-
- private QueryTimeout queryTimeout;
-
- /** Constructor **/
- public ExitableFields(Fields fields, QueryTimeout queryTimeout) {
- super(fields);
- this.queryTimeout = queryTimeout;
- }
-
- @Override
- public Terms terms(String field) throws IOException {
- Terms terms = in.terms(field);
- if (terms == null) {
- return null;
- }
- return new ExitableTerms(terms, queryTimeout);
- }
- }
-
- /**
* Wrapper class for another Terms implementation that is used by ExitableFields.
*/
public static class ExitableTerms extends FilterTerms {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/core/src/java/org/apache/lucene/index/Fields.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/Fields.java b/lucene/core/src/java/org/apache/lucene/index/Fields.java
index c5794b6..d1bd902 100644
--- a/lucene/core/src/java/org/apache/lucene/index/Fields.java
+++ b/lucene/core/src/java/org/apache/lucene/index/Fields.java
@@ -20,9 +20,15 @@ package org.apache.lucene.index;
import java.io.IOException;
import java.util.Iterator;
-/** Flex API for access to fields and terms
- * @lucene.experimental */
+import org.apache.lucene.codecs.FieldsProducer;
+/**
+ * Provides a {@link Terms} index for fields that have it, and lists which fields do.
+ * This is primarily an internal/experimental API (see {@link FieldsProducer}),
+ * although it is also used to expose the set of term vectors per document.
+ *
+ * @lucene.experimental
+ */
public abstract class Fields implements Iterable<String> {
/** Sole constructor. (For invocation by subclass
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java b/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java
index f3d8112..0450038 100644
--- a/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java
+++ b/lucene/core/src/java/org/apache/lucene/index/FilterLeafReader.java
@@ -345,11 +345,11 @@ public abstract class FilterLeafReader extends LeafReader {
protected void doClose() throws IOException {
in.close();
}
-
+
@Override
- public Fields fields() throws IOException {
+ public Terms terms(String field) throws IOException {
ensureOpen();
- return in.fields();
+ return in.terms(field);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/core/src/java/org/apache/lucene/index/LeafReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/LeafReader.java b/lucene/core/src/java/org/apache/lucene/index/LeafReader.java
index c738bc5..faea32d 100644
--- a/lucene/core/src/java/org/apache/lucene/index/LeafReader.java
+++ b/lucene/core/src/java/org/apache/lucene/index/LeafReader.java
@@ -18,7 +18,6 @@ package org.apache.lucene.index;
import java.io.IOException;
-import org.apache.lucene.index.IndexReader.CacheHelper;
import org.apache.lucene.util.Bits;
/** {@code LeafReader} is an abstract class, providing an interface for accessing an
@@ -60,7 +59,7 @@ public abstract class LeafReader extends IndexReader {
}
/**
- * Optional method: Return a {@link CacheHelper} that can be used to cache
+ * Optional method: Return a {@link IndexReader.CacheHelper} that can be used to cache
* based on the content of this leaf regardless of deletions. Two readers
* that have the same data but different sets of deleted documents or doc
* values updates may be considered equal. Consider using
@@ -73,12 +72,6 @@ public abstract class LeafReader extends IndexReader {
*/
public abstract CacheHelper getCoreCacheHelper();
- /**
- * Returns {@link Fields} for this reader.
- * This method will not return null.
- */
- public abstract Fields fields() throws IOException;
-
@Override
public final int docFreq(Term term) throws IOException {
final Terms terms = terms(term.field());
@@ -139,10 +132,8 @@ public abstract class LeafReader extends IndexReader {
return terms.getSumTotalTermFreq();
}
- /** This may return null if the field does not exist.*/
- public final Terms terms(String field) throws IOException {
- return fields().terms(field);
- }
+ /** Returns the {@link Terms} index for this field, or null if it has none. */
+ public abstract Terms terms(String field) throws IOException;
/** Returns {@link PostingsEnum} for the specified term.
* This will return null if either the field or
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/core/src/java/org/apache/lucene/index/MergeReaderWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/MergeReaderWrapper.java b/lucene/core/src/java/org/apache/lucene/index/MergeReaderWrapper.java
index 3a3573a..565bdd4 100644
--- a/lucene/core/src/java/org/apache/lucene/index/MergeReaderWrapper.java
+++ b/lucene/core/src/java/org/apache/lucene/index/MergeReaderWrapper.java
@@ -70,8 +70,11 @@ class MergeReaderWrapper extends LeafReader {
}
@Override
- public Fields fields() throws IOException {
- return fields;
+ public Terms terms(String field) throws IOException {
+ ensureOpen();
+ // We could check the FieldInfo IndexOptions but there's no point since
+ // PostingsReader will simply return null for fields that don't exist or that have no terms index.
+ return fields.terms(field);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/core/src/java/org/apache/lucene/index/MultiFields.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/MultiFields.java b/lucene/core/src/java/org/apache/lucene/index/MultiFields.java
index 1736bac..1a7b15b 100644
--- a/lucene/core/src/java/org/apache/lucene/index/MultiFields.java
+++ b/lucene/core/src/java/org/apache/lucene/index/MultiFields.java
@@ -20,6 +20,7 @@ package org.apache.lucene.index;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -31,11 +32,12 @@ import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.MergedIterator;
/**
- * Exposes flex API, merged from flex API of sub-segments.
+ * Provides a single {@link Fields} term index view over an
+ * {@link IndexReader}.
* This is useful when you're interacting with an {@link
* IndexReader} implementation that consists of sequential
* sub-readers (eg {@link DirectoryReader} or {@link
- * MultiReader}).
+ * MultiReader}) and you must treat it as a {@link LeafReader}.
*
* <p><b>NOTE</b>: for composite readers, you'll get better
* performance by gathering the sub readers using
@@ -45,7 +47,6 @@ import org.apache.lucene.util.MergedIterator;
*
* @lucene.experimental
*/
-
public final class MultiFields extends Fields {
private final Fields[] subs;
private final ReaderSlice[] subSlices;
@@ -64,13 +65,13 @@ public final class MultiFields extends Fields {
switch (leaves.size()) {
case 1:
// already an atomic reader / reader with one leave
- return leaves.get(0).reader().fields();
+ return new LeafReaderFields(leaves.get(0).reader());
default:
final List<Fields> fields = new ArrayList<>(leaves.size());
final List<ReaderSlice> slices = new ArrayList<>(leaves.size());
for (final LeafReaderContext ctx : leaves) {
final LeafReader r = ctx.reader();
- final Fields f = r.fields();
+ final Fields f = new LeafReaderFields(r);
fields.add(f);
slices.add(new ReaderSlice(ctx.docBase, r.maxDoc(), fields.size()-1));
}
@@ -115,9 +116,31 @@ public final class MultiFields extends Fields {
}
}
- /** This method may return null if the field does not exist.*/
+ /** This method may return null if the field does not exist or if it has no terms. */
public static Terms getTerms(IndexReader r, String field) throws IOException {
- return getFields(r).terms(field);
+ final List<LeafReaderContext> leaves = r.leaves();
+ if (leaves.size() == 1) {
+ return leaves.get(0).reader().terms(field);
+ }
+
+ final List<Terms> termsPerLeaf = new ArrayList<>(leaves.size());
+ final List<ReaderSlice> slicePerLeaf = new ArrayList<>(leaves.size());
+
+ for (int leafIdx = 0; leafIdx < leaves.size(); leafIdx++) {
+ LeafReaderContext ctx = leaves.get(leafIdx);
+ Terms subTerms = ctx.reader().terms(field);
+ if (subTerms != null) {
+ termsPerLeaf.add(subTerms);
+ slicePerLeaf.add(new ReaderSlice(ctx.docBase, r.maxDoc(), leafIdx - 1));
+ }
+ }
+
+ if (termsPerLeaf.size() == 0) {
+ return null;
+ } else {
+ return new MultiTerms(termsPerLeaf.toArray(Terms.EMPTY_ARRAY),
+ slicePerLeaf.toArray(ReaderSlice.EMPTY_ARRAY));
+ }
}
/** Returns {@link PostingsEnum} for the specified field and
@@ -264,5 +287,37 @@ public final class MultiFields extends Fields {
}
return fields;
}
+
+ private static class LeafReaderFields extends Fields {
+
+ private final LeafReader leafReader;
+ private final List<String> indexedFields;
+
+ LeafReaderFields(LeafReader leafReader) {
+ this.leafReader = leafReader;
+ this.indexedFields = new ArrayList<>();
+ for (FieldInfo fieldInfo : leafReader.getFieldInfos()) {
+ if (fieldInfo.getIndexOptions() != IndexOptions.NONE) {
+ indexedFields.add(fieldInfo.name);
+ }
+ }
+ Collections.sort(indexedFields);
+ }
+
+ @Override
+ public Iterator<String> iterator() {
+ return Collections.unmodifiableList(indexedFields).iterator();
+ }
+
+ @Override
+ public int size() {
+ return indexedFields.size();
+ }
+
+ @Override
+ public Terms terms(String field) throws IOException {
+ return leafReader.terms(field);
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/core/src/java/org/apache/lucene/index/ParallelLeafReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/ParallelLeafReader.java b/lucene/core/src/java/org/apache/lucene/index/ParallelLeafReader.java
index 5fb28b0..74b3962 100644
--- a/lucene/core/src/java/org/apache/lucene/index/ParallelLeafReader.java
+++ b/lucene/core/src/java/org/apache/lucene/index/ParallelLeafReader.java
@@ -19,6 +19,7 @@ package org.apache.lucene.index;
import java.io.IOException;
import java.util.Collections;
+import java.util.HashMap;
import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.Map;
@@ -50,7 +51,6 @@ import org.apache.lucene.util.Version;
*/
public class ParallelLeafReader extends LeafReader {
private final FieldInfos fieldInfos;
- private final ParallelFields fields = new ParallelFields();
private final LeafReader[] parallelReaders, storedFieldsReaders;
private final Set<LeafReader> completeReaderSet =
Collections.newSetFromMap(new IdentityHashMap<LeafReader,Boolean>());
@@ -58,9 +58,10 @@ public class ParallelLeafReader extends LeafReader {
private final int maxDoc, numDocs;
private final boolean hasDeletions;
private final LeafMetaData metaData;
- private final SortedMap<String,LeafReader> fieldToReader = new TreeMap<>();
private final SortedMap<String,LeafReader> tvFieldToReader = new TreeMap<>();
-
+ private final SortedMap<String,LeafReader> fieldToReader = new TreeMap<>();//TODO needn't sort?
+ private final Map<String,LeafReader> termsFieldToReader = new HashMap<>();
+
/** Create a ParallelLeafReader based on the provided
* readers; auto-closes the given readers on {@link #close()}. */
public ParallelLeafReader(LeafReader... readers) throws IOException {
@@ -130,9 +131,15 @@ public class ParallelLeafReader extends LeafReader {
if (!fieldToReader.containsKey(fieldInfo.name)) {
builder.add(fieldInfo);
fieldToReader.put(fieldInfo.name, reader);
+ // only add these if the reader responsible for that field name is the current:
+ // TODO consider populating 1st leaf with vectors even if the field name has been seen on a previous leaf
if (fieldInfo.hasVectors()) {
tvFieldToReader.put(fieldInfo.name, reader);
}
+ // TODO consider populating 1st leaf with terms even if the field name has been seen on a previous leaf
+ if (fieldInfo.getIndexOptions() != IndexOptions.NONE) {
+ termsFieldToReader.put(fieldInfo.name, reader);
+ }
}
}
}
@@ -154,17 +161,6 @@ public class ParallelLeafReader extends LeafReader {
fieldInfos = builder.finish();
this.metaData = new LeafMetaData(createdVersionMajor, minVersion, indexSort);
-
- // build Fields instance
- for (final LeafReader reader : this.parallelReaders) {
- final Fields readerFields = reader.fields();
- for (String field : readerFields) {
- // only add if the reader responsible for that field name is the current:
- if (fieldToReader.get(field) == reader) {
- this.fields.addField(field, readerFields.terms(field));
- }
- }
- }
// do this finally so any Exceptions occurred before don't affect refcounts:
for (LeafReader reader : completeReaderSet) {
@@ -230,13 +226,14 @@ public class ParallelLeafReader extends LeafReader {
ensureOpen();
return hasDeletions ? parallelReaders[0].getLiveDocs() : null;
}
-
+
@Override
- public Fields fields() {
+ public Terms terms(String field) throws IOException {
ensureOpen();
- return fields;
+ LeafReader leafReader = termsFieldToReader.get(field);
+ return leafReader == null ? null : leafReader.terms(field);
}
-
+
@Override
public int numDocs() {
// Don't call ensureOpen() here (it could affect performance)
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/core/src/java/org/apache/lucene/index/SlowCodecReaderWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/SlowCodecReaderWrapper.java b/lucene/core/src/java/org/apache/lucene/index/SlowCodecReaderWrapper.java
index b115a85..5332557 100644
--- a/lucene/core/src/java/org/apache/lucene/index/SlowCodecReaderWrapper.java
+++ b/lucene/core/src/java/org/apache/lucene/index/SlowCodecReaderWrapper.java
@@ -18,6 +18,8 @@ package org.apache.lucene.index;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.Iterator;
import org.apache.lucene.codecs.DocValuesProducer;
@@ -284,21 +286,27 @@ public final class SlowCodecReaderWrapper {
}
private static FieldsProducer readerToFieldsProducer(final LeafReader reader) throws IOException {
- final Fields fields = reader.fields();
+ ArrayList<String> indexedFields = new ArrayList<>();
+ for (FieldInfo fieldInfo : reader.getFieldInfos()) {
+ if (fieldInfo.getIndexOptions() != IndexOptions.NONE) {
+ indexedFields.add(fieldInfo.name);
+ }
+ }
+ Collections.sort(indexedFields);
return new FieldsProducer() {
@Override
public Iterator<String> iterator() {
- return fields.iterator();
+ return indexedFields.iterator();
}
@Override
public Terms terms(String field) throws IOException {
- return fields.terms(field);
+ return reader.terms(field);
}
@Override
public int size() {
- return fields.size();
+ return indexedFields.size();
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/core/src/java/org/apache/lucene/index/SortingLeafReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/SortingLeafReader.java b/lucene/core/src/java/org/apache/lucene/index/SortingLeafReader.java
index 321b552..eb9f7ed 100644
--- a/lucene/core/src/java/org/apache/lucene/index/SortingLeafReader.java
+++ b/lucene/core/src/java/org/apache/lucene/index/SortingLeafReader.java
@@ -49,6 +49,7 @@ import static org.apache.lucene.search.DocIdSetIterator.NO_MORE_DOCS;
*/
class SortingLeafReader extends FilterLeafReader {
+ //TODO remove from here; move to FreqProxTermsWriter or FreqProxFields?
static class SortingFields extends FilterFields {
private final Sorter.DocMap docMap;
@@ -1042,8 +1043,9 @@ class SortingLeafReader extends FilterLeafReader {
}
@Override
- public Fields fields() throws IOException {
- return new SortingFields(in.fields(), in.getFieldInfos(), docMap);
+ public Terms terms(String field) throws IOException {
+ Terms terms = super.terms(field);
+ return terms==null ? null : new SortingTerms(terms, in.getFieldInfos().fieldInfo(field).getIndexOptions(), docMap);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java b/lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java
index 3f424f5..14b2002 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestExitableDirectoryReader.java
@@ -37,17 +37,6 @@ import org.junit.Ignore;
public class TestExitableDirectoryReader extends LuceneTestCase {
private static class TestReader extends FilterLeafReader {
- private static class TestFields extends FilterFields {
- TestFields(Fields in) {
- super(in);
- }
-
- @Override
- public Terms terms(String field) throws IOException {
- return new TestTerms(super.terms(field));
- }
- }
-
private static class TestTerms extends FilterTerms {
TestTerms(Terms in) {
super(in);
@@ -83,8 +72,9 @@ public class TestExitableDirectoryReader extends LuceneTestCase {
}
@Override
- public Fields fields() throws IOException {
- return new TestFields(super.fields());
+ public Terms terms(String field) throws IOException {
+ Terms terms = super.terms(field);
+ return terms==null ? null : new TestTerms(terms);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/core/src/test/org/apache/lucene/index/TestFilterLeafReader.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestFilterLeafReader.java b/lucene/core/src/test/org/apache/lucene/index/TestFilterLeafReader.java
index 79862fc..de06f90 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestFilterLeafReader.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestFilterLeafReader.java
@@ -35,18 +35,6 @@ public class TestFilterLeafReader extends LuceneTestCase {
private static class TestReader extends FilterLeafReader {
- /** Filter that only permits terms containing 'e'.*/
- private static class TestFields extends FilterFields {
- TestFields(Fields in) {
- super(in);
- }
-
- @Override
- public Terms terms(String field) throws IOException {
- return new TestTerms(super.terms(field));
- }
- }
-
private static class TestTerms extends FilterTerms {
TestTerms(Terms in) {
super(in);
@@ -103,8 +91,9 @@ public class TestFilterLeafReader extends LuceneTestCase {
}
@Override
- public Fields fields() throws IOException {
- return new TestFields(super.fields());
+ public Terms terms(String field) throws IOException {
+ Terms terms = super.terms(field);
+ return terms==null ? null : new TestTerms(terms);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/core/src/test/org/apache/lucene/index/TestParallelTermEnum.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestParallelTermEnum.java b/lucene/core/src/test/org/apache/lucene/index/TestParallelTermEnum.java
index 25d05ca..8afad2c 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestParallelTermEnum.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestParallelTermEnum.java
@@ -18,7 +18,6 @@ package org.apache.lucene.index;
import java.io.IOException;
-import java.util.Iterator;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
@@ -90,21 +89,10 @@ public class TestParallelTermEnum extends LuceneTestCase {
public void test1() throws IOException {
ParallelLeafReader pr = new ParallelLeafReader(ir1, ir2);
- Fields fields = pr.fields();
- Iterator<String> fe = fields.iterator();
+ assertEquals(3, pr.getFieldInfos().size());
- String f = fe.next();
- assertEquals("field1", f);
- checkTerms(fields.terms(f), "brown", "fox", "jumps", "quick", "the");
-
- f = fe.next();
- assertEquals("field2", f);
- checkTerms(fields.terms(f), "brown", "fox", "jumps", "quick", "the");
-
- f = fe.next();
- assertEquals("field3", f);
- checkTerms(fields.terms(f), "dog", "fox", "jumps", "lazy", "over", "the");
-
- assertFalse(fe.hasNext());
+ checkTerms(pr.terms("field1"), "brown", "fox", "jumps", "quick", "the");
+ checkTerms(pr.terms("field2"), "brown", "fox", "jumps", "quick", "the");
+ checkTerms(pr.terms("field3"), "dog", "fox", "jumps", "lazy", "over", "the");
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/core/src/test/org/apache/lucene/search/TermInSetQueryTest.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TermInSetQueryTest.java b/lucene/core/src/test/org/apache/lucene/search/TermInSetQueryTest.java
index 9b8a285..e0154ab 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TermInSetQueryTest.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TermInSetQueryTest.java
@@ -29,7 +29,6 @@ import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.StringField;
import org.apache.lucene.index.DirectoryReader;
-import org.apache.lucene.index.Fields;
import org.apache.lucene.index.FilterDirectoryReader;
import org.apache.lucene.index.FilterLeafReader;
import org.apache.lucene.index.IndexReader;
@@ -219,21 +218,16 @@ public class TermInSetQueryTest extends LuceneTestCase {
}
@Override
- public Fields fields() throws IOException {
- return new FilterFields(in.fields()) {
+ public Terms terms(String field) throws IOException {
+ Terms terms = super.terms(field);
+ if (terms == null) {
+ return null;
+ }
+ return new FilterTerms(terms) {
@Override
- public Terms terms(String field) throws IOException {
- final Terms in = this.in.terms(field);
- if (in == null) {
- return null;
- }
- return new FilterTerms(in) {
- @Override
- public TermsEnum iterator() throws IOException {
- counter.incrementAndGet();
- return super.iterator();
- }
- };
+ public TermsEnum iterator() throws IOException {
+ counter.incrementAndGet();
+ return super.iterator();
}
};
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/core/src/test/org/apache/lucene/search/TestTermQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTermQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestTermQuery.java
index 41d82d5..02c1228 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestTermQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestTermQuery.java
@@ -22,7 +22,6 @@ import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.StringField;
import org.apache.lucene.index.DirectoryReader;
-import org.apache.lucene.index.Fields;
import org.apache.lucene.index.FilterDirectoryReader;
import org.apache.lucene.index.FilterLeafReader;
import org.apache.lucene.index.LeafReader;
@@ -123,31 +122,27 @@ public class TestTermQuery extends LuceneTestCase {
}
@Override
- public Fields fields() throws IOException {
- return new FilterFields(super.fields()) {
+ public Terms terms(String field) throws IOException {
+ Terms terms = super.terms(field);
+ return terms==null ? null : new FilterTerms(terms) {
@Override
- public Terms terms(String field) throws IOException {
- return new FilterTerms(super.terms(field)) {
+ public TermsEnum iterator() throws IOException {
+ return new FilterTermsEnum(super.iterator()) {
@Override
- public TermsEnum iterator() throws IOException {
- return new FilterTermsEnum(super.iterator()) {
- @Override
- public SeekStatus seekCeil(BytesRef text) throws IOException {
- throw new AssertionError("no seek");
- }
- @Override
- public void seekExact(BytesRef term, TermState state) throws IOException {
- throw new AssertionError("no seek");
- }
- @Override
- public boolean seekExact(BytesRef text) throws IOException {
- throw new AssertionError("no seek");
- }
- @Override
- public void seekExact(long ord) throws IOException {
- throw new AssertionError("no seek");
- }
- };
+ public SeekStatus seekCeil(BytesRef text) throws IOException {
+ throw new AssertionError("no seek");
+ }
+ @Override
+ public void seekExact(BytesRef term, TermState state) throws IOException {
+ throw new AssertionError("no seek");
+ }
+ @Override
+ public boolean seekExact(BytesRef text) throws IOException {
+ throw new AssertionError("no seek");
+ }
+ @Override
+ public void seekExact(long ord) throws IOException {
+ throw new AssertionError("no seek");
}
};
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TermVectorLeafReader.java
----------------------------------------------------------------------
diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TermVectorLeafReader.java b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TermVectorLeafReader.java
index 3a723cf..144209d 100644
--- a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TermVectorLeafReader.java
+++ b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TermVectorLeafReader.java
@@ -25,8 +25,8 @@ import org.apache.lucene.index.DocValuesType;
import org.apache.lucene.index.FieldInfo;
import org.apache.lucene.index.FieldInfos;
import org.apache.lucene.index.Fields;
-import org.apache.lucene.index.LeafMetaData;
import org.apache.lucene.index.IndexOptions;
+import org.apache.lucene.index.LeafMetaData;
import org.apache.lucene.index.LeafReader;
import org.apache.lucene.index.NumericDocValues;
import org.apache.lucene.index.PointValues;
@@ -90,8 +90,8 @@ public class TermVectorLeafReader extends LeafReader {
}
@Override
- public Fields fields() throws IOException {
- return fields;
+ public Terms terms(String field) throws IOException {
+ return fields.terms(field);
}
@Override
@@ -148,7 +148,7 @@ public class TermVectorLeafReader extends LeafReader {
if (docID != 0) {
return null;
}
- return fields();
+ return fields;
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java
----------------------------------------------------------------------
diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java
index a898854..9fbc121 100644
--- a/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java
+++ b/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java
@@ -18,7 +18,6 @@ package org.apache.lucene.search.highlight;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -30,7 +29,6 @@ import org.apache.lucene.analysis.CachingTokenFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.index.BinaryDocValues;
import org.apache.lucene.index.FieldInfos;
-import org.apache.lucene.index.Fields;
import org.apache.lucene.index.FilterLeafReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.LeafReader;
@@ -429,30 +427,15 @@ public class WeightedSpanTermExtractor {
DelegatingLeafReader(LeafReader in) {
super(in);
}
-
+
@Override
public FieldInfos getFieldInfos() {
- throw new UnsupportedOperationException();
+ throw new UnsupportedOperationException();//TODO merge them
}
@Override
- public Fields fields() throws IOException {
- return new FilterFields(super.fields()) {
- @Override
- public Terms terms(String field) throws IOException {
- return super.terms(DelegatingLeafReader.FIELD_NAME);
- }
-
- @Override
- public Iterator<String> iterator() {
- return Collections.singletonList(DelegatingLeafReader.FIELD_NAME).iterator();
- }
-
- @Override
- public int size() {
- return 1;
- }
- };
+ public Terms terms(String field) throws IOException {
+ return super.terms(DelegatingLeafReader.FIELD_NAME);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/PhraseHelper.java
----------------------------------------------------------------------
diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/PhraseHelper.java b/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/PhraseHelper.java
index ebc5d37..0195abb 100644
--- a/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/PhraseHelper.java
+++ b/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/PhraseHelper.java
@@ -24,7 +24,6 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@@ -36,7 +35,6 @@ import java.util.function.Predicate;
import org.apache.lucene.index.BinaryDocValues;
import org.apache.lucene.index.FieldInfos;
-import org.apache.lucene.index.Fields;
import org.apache.lucene.index.FilterLeafReader;
import org.apache.lucene.index.LeafReader;
import org.apache.lucene.index.LeafReaderContext;
@@ -529,12 +527,16 @@ public class PhraseHelper {
}
}
+ //TODO move up; it's currently inbetween other inner classes that are related
/**
+ * Needed to support the ability to highlight a query irrespective of the field a query refers to
+ * (aka requireFieldMatch=false).
* This reader will just delegate every call to a single field in the wrapped
* LeafReader. This way we ensure that all queries going through this reader target the same field.
- */
+ */
static final class SingleFieldFilterLeafReader extends FilterLeafReader {
final String fieldName;
+
SingleFieldFilterLeafReader(LeafReader in, String fieldName) {
super(in);
this.fieldName = fieldName;
@@ -542,27 +544,12 @@ public class PhraseHelper {
@Override
public FieldInfos getFieldInfos() {
- throw new UnsupportedOperationException();
+ throw new UnsupportedOperationException();//TODO merge them
}
@Override
- public Fields fields() throws IOException {
- return new FilterFields(super.fields()) {
- @Override
- public Terms terms(String field) throws IOException {
- return super.terms(fieldName);
- }
-
- @Override
- public Iterator<String> iterator() {
- return Collections.singletonList(fieldName).iterator();
- }
-
- @Override
- public int size() {
- return 1;
- }
- };
+ public Terms terms(String field) throws IOException {
+ return super.terms(fieldName);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/TermVectorFilteredLeafReader.java
----------------------------------------------------------------------
diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/TermVectorFilteredLeafReader.java b/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/TermVectorFilteredLeafReader.java
index 8555cbd..4165af4 100644
--- a/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/TermVectorFilteredLeafReader.java
+++ b/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/TermVectorFilteredLeafReader.java
@@ -18,7 +18,6 @@ package org.apache.lucene.search.uhighlight;
import java.io.IOException;
-import org.apache.lucene.index.Fields;
import org.apache.lucene.index.FilterLeafReader;
import org.apache.lucene.index.LeafReader;
import org.apache.lucene.index.PostingsEnum;
@@ -52,24 +51,9 @@ final class TermVectorFilteredLeafReader extends FilterLeafReader {
}
@Override
- public Fields fields() throws IOException {
- return new TermVectorFilteredFields(in.fields(), filterTerms);
- }
-
- private static final class TermVectorFilteredFields extends FilterLeafReader.FilterFields {
- // NOTE: super ("in") is baseFields
-
- private final Terms filterTerms;
-
- TermVectorFilteredFields(Fields baseFields, Terms filterTerms) {
- super(baseFields);
- this.filterTerms = filterTerms;
- }
-
- @Override
- public Terms terms(String field) throws IOException {
- return new TermsFilteredTerms(in.terms(field), filterTerms);
- }
+ public Terms terms(String field) throws IOException {
+ Terms terms = in.terms(field);
+ return terms==null ? null : new TermsFilteredTerms(terms, filterTerms);
}
private static final class TermsFilteredTerms extends FilterLeafReader.FilterTerms {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
----------------------------------------------------------------------
diff --git a/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java b/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
index 92b9359..9812a39 100644
--- a/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
+++ b/lucene/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
@@ -1134,7 +1134,7 @@ public class MemoryIndex {
*/
private final class MemoryIndexReader extends LeafReader {
- private Fields memoryFields = new MemoryFields(fields);
+ private final MemoryFields memoryFields = new MemoryFields(fields);
private MemoryIndexReader() {
super(); // avoid as much superclass baggage as possible
@@ -1236,8 +1236,8 @@ public class MemoryIndex {
}
@Override
- public Fields fields() {
- return memoryFields;
+ public Terms terms(String field) throws IOException {
+ return memoryFields.terms(field);
}
private class MemoryFields extends Fields {
@@ -1589,7 +1589,7 @@ public class MemoryIndex {
@Override
public Fields getTermVectors(int docID) {
if (docID == 0) {
- return fields();
+ return memoryFields;
} else {
return null;
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/test-framework/src/java/org/apache/lucene/index/AssertingLeafReader.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/AssertingLeafReader.java b/lucene/test-framework/src/java/org/apache/lucene/index/AssertingLeafReader.java
index a587653..7c1b672 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/AssertingLeafReader.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/AssertingLeafReader.java
@@ -71,10 +71,11 @@ public class AssertingLeafReader extends FilterLeafReader {
}
@Override
- public Fields fields() throws IOException {
- return new AssertingFields(super.fields());
+ public Terms terms(String field) throws IOException {
+ Terms terms = super.terms(field);
+ return terms == null ? null : new AssertingTerms(terms);
}
-
+
@Override
public Fields getTermVectors(int docID) throws IOException {
Fields fields = super.getTermVectors(docID);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java
index e450114..959466a 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java
@@ -335,7 +335,7 @@ abstract class BaseIndexFileFormatTestCase extends LuceneTestCase {
// PostingsFormat
try (FieldsConsumer consumer = codec.postingsFormat().fieldsConsumer(writeState)) {
- consumer.write(oneDocReader.fields());
+ consumer.write(MultiFields.getFields(oneDocReader));
IOUtils.close(consumer);
IOUtils.close(consumer);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
index 1155a73..f69ca55 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java
@@ -193,10 +193,7 @@ public abstract class BasePostingsFormatTestCase extends BaseIndexFileFormatTest
iw.addDocument(doc);
DirectoryReader ir = iw.getReader();
LeafReader ar = getOnlyLeafReader(ir);
- Fields fields = ar.fields();
- int fieldCount = fields.size();
- // -1 is allowed, if the codec doesn't implement fields.size():
- assertTrue(fieldCount == 1 || fieldCount == -1);
+ assertEquals(1, ar.getFieldInfos().size());
Terms terms = ar.terms("");
assertNotNull(terms);
TermsEnum termsEnum = terms.iterator();
@@ -218,10 +215,7 @@ public abstract class BasePostingsFormatTestCase extends BaseIndexFileFormatTest
iw.addDocument(doc);
DirectoryReader ir = iw.getReader();
LeafReader ar = getOnlyLeafReader(ir);
- Fields fields = ar.fields();
- int fieldCount = fields.size();
- // -1 is allowed, if the codec doesn't implement fields.size():
- assertTrue(fieldCount == 1 || fieldCount == -1);
+ assertEquals(1, ar.getFieldInfos().size());
Terms terms = ar.terms("");
assertNotNull(terms);
TermsEnum termsEnum = terms.iterator();
@@ -296,11 +290,10 @@ public abstract class BasePostingsFormatTestCase extends BaseIndexFileFormatTest
iw.forceMerge(1);
DirectoryReader ir = iw.getReader();
LeafReader ar = getOnlyLeafReader(ir);
- Fields fields = ar.fields();
// Ghost busting terms dict impls will have
// fields.size() == 0; all others must be == 1:
- assertTrue(fields.size() <= 1);
- Terms terms = fields.terms("ghostField");
+ assertTrue(ar.getFieldInfos().size() <= 1);
+ Terms terms = ar.terms("ghostField");
if (terms != null) {
TermsEnum termsEnum = terms.iterator();
BytesRef term = termsEnum.next();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/test-framework/src/java/org/apache/lucene/index/FieldFilterLeafReader.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/FieldFilterLeafReader.java b/lucene/test-framework/src/java/org/apache/lucene/index/FieldFilterLeafReader.java
index 751833f..38a3b7a 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/FieldFilterLeafReader.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/FieldFilterLeafReader.java
@@ -108,11 +108,10 @@ public final class FieldFilterLeafReader extends FilterLeafReader {
}
@Override
- public Fields fields() throws IOException {
- final Fields f = super.fields();
- return (f == null) ? null : new FieldFilterFields(f);
+ public Terms terms(String field) throws IOException {
+ return hasField(field) ? super.terms(field) : null;
}
-
+
@Override
public BinaryDocValues getBinaryDocValues(String field) throws IOException {
return hasField(field) ? super.getBinaryDocValues(field) : null;
@@ -145,7 +144,7 @@ public final class FieldFilterLeafReader extends FilterLeafReader {
if (negate) sb.append('!');
return sb.append(fields).append(')').toString();
}
-
+
private class FieldFilterFields extends FilterFields {
public FieldFilterFields(Fields in) {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java b/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java
index bd23fd2..cb2c984 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/search/QueryUtils.java
@@ -17,17 +17,16 @@
package org.apache.lucene.search;
import java.io.IOException;
-import java.util.Collections;
-import java.util.Iterator;
import java.util.List;
import java.util.Random;
+import junit.framework.Assert;
import org.apache.lucene.index.BinaryDocValues;
import org.apache.lucene.index.FieldInfo;
import org.apache.lucene.index.FieldInfos;
import org.apache.lucene.index.Fields;
-import org.apache.lucene.index.LeafMetaData;
import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.LeafMetaData;
import org.apache.lucene.index.LeafReader;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.MultiReader;
@@ -42,8 +41,6 @@ import org.apache.lucene.util.Bits;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.Version;
-import junit.framework.Assert;
-
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
@@ -172,23 +169,8 @@ public class QueryUtils {
return new LeafReader() {
@Override
- public Fields fields() throws IOException {
- return new Fields() {
- @Override
- public Iterator<String> iterator() {
- return Collections.<String>emptyList().iterator();
- }
-
- @Override
- public Terms terms(String field) throws IOException {
- return null;
- }
-
- @Override
- public int size() {
- return 0;
- }
- };
+ public Terms terms(String field) throws IOException {
+ return null;
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/solr/core/src/java/org/apache/solr/index/SlowCompositeReaderWrapper.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/index/SlowCompositeReaderWrapper.java b/solr/core/src/java/org/apache/solr/index/SlowCompositeReaderWrapper.java
index ab7313f..ad1e81f 100644
--- a/solr/core/src/java/org/apache/solr/index/SlowCompositeReaderWrapper.java
+++ b/solr/core/src/java/org/apache/solr/index/SlowCompositeReaderWrapper.java
@@ -98,9 +98,9 @@ public final class SlowCompositeReaderWrapper extends LeafReader {
}
@Override
- public Fields fields() {
+ public Terms terms(String field) throws IOException {
ensureOpen();
- return fields;
+ return fields.terms(field);
}
@Override
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abc393db/solr/core/src/test/org/apache/solr/search/TestDocSet.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestDocSet.java b/solr/core/src/test/org/apache/solr/search/TestDocSet.java
index e5cc6eb..b592317 100644
--- a/solr/core/src/test/org/apache/solr/search/TestDocSet.java
+++ b/solr/core/src/test/org/apache/solr/search/TestDocSet.java
@@ -25,9 +25,9 @@ import org.apache.lucene.index.BinaryDocValues;
import org.apache.lucene.index.FieldInfo;
import org.apache.lucene.index.FieldInfos;
import org.apache.lucene.index.Fields;
-import org.apache.lucene.index.LeafMetaData;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexReaderContext;
+import org.apache.lucene.index.LeafMetaData;
import org.apache.lucene.index.LeafReader;
import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.MultiReader;
@@ -37,6 +37,7 @@ import org.apache.lucene.index.SortedDocValues;
import org.apache.lucene.index.SortedNumericDocValues;
import org.apache.lucene.index.SortedSetDocValues;
import org.apache.lucene.index.StoredFieldVisitor;
+import org.apache.lucene.index.Terms;
import org.apache.lucene.search.DocIdSet;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.util.BitSetIterator;
@@ -399,7 +400,7 @@ public class TestDocSet extends LuceneTestCase {
}
@Override
- public Fields fields() {
+ public Terms terms(String field) throws IOException {
return null;
}
[2/7] lucene-solr:jira/SOLR-10834: Merge branch 'master' into
jira/SOLR-10834
Posted by ho...@apache.org.
Merge branch 'master' into jira/SOLR-10834
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/8f104384
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/8f104384
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/8f104384
Branch: refs/heads/jira/SOLR-10834
Commit: 8f1043840f38533864b2c713daf066b6c3509147
Parents: 7b95773 abc393d
Author: Chris Hostetter <ho...@apache.org>
Authored: Thu Jun 15 09:02:00 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Thu Jun 15 09:02:00 2017 -0700
----------------------------------------------------------------------
lucene/CHANGES.txt | 5 ++
.../org/apache/lucene/index/CodecReader.java | 11 ++--
.../lucene/index/ExitableDirectoryReader.java | 40 ++----------
.../java/org/apache/lucene/index/Fields.java | 10 ++-
.../apache/lucene/index/FilterLeafReader.java | 6 +-
.../org/apache/lucene/index/LeafReader.java | 15 +----
.../apache/lucene/index/MergeReaderWrapper.java | 7 +-
.../org/apache/lucene/index/MultiFields.java | 69 ++++++++++++++++++--
.../apache/lucene/index/ParallelLeafReader.java | 33 +++++-----
.../lucene/index/SlowCodecReaderWrapper.java | 16 +++--
.../apache/lucene/index/SortingLeafReader.java | 6 +-
.../index/TestExitableDirectoryReader.java | 16 +----
.../lucene/index/TestFilterLeafReader.java | 17 +----
.../lucene/index/TestParallelTermEnum.java | 20 ++----
.../lucene/search/TermInSetQueryTest.java | 24 +++----
.../org/apache/lucene/search/TestTermQuery.java | 43 ++++++------
.../search/highlight/TermVectorLeafReader.java | 8 +--
.../highlight/WeightedSpanTermExtractor.java | 25 ++-----
.../lucene/search/uhighlight/PhraseHelper.java | 29 +++-----
.../TermVectorFilteredLeafReader.java | 22 +------
.../apache/lucene/index/memory/MemoryIndex.java | 8 +--
.../lucene/index/AssertingLeafReader.java | 7 +-
.../index/BaseIndexFileFormatTestCase.java | 2 +-
.../index/BasePostingsFormatTestCase.java | 15 ++---
.../lucene/index/FieldFilterLeafReader.java | 9 ++-
.../org/apache/lucene/search/QueryUtils.java | 26 ++------
.../solr/index/SlowCompositeReaderWrapper.java | 4 +-
.../test/org/apache/solr/search/TestDocSet.java | 5 +-
28 files changed, 214 insertions(+), 284 deletions(-)
----------------------------------------------------------------------
[5/7] lucene-solr:master: SOLR-10834: Fixed tests and test configs to
stop using numeric uniqueKey fields
Posted by ho...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentCustomSortTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentCustomSortTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentCustomSortTest.java
index 4b3e92a..7efde0c 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentCustomSortTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentCustomSortTest.java
@@ -64,44 +64,44 @@ public class DistributedQueryComponentCustomSortTest extends BaseDistributedSear
QueryResponse rsp;
rsp = query("q", "*:*", "fl", "id", "sort", "payload asc", "rows", "20");
- assertFieldValues(rsp.getResults(), id, 7, 1, 6, 4, 2, 10, 12, 3, 5, 9, 8, 13, 11);
+ assertFieldValues(rsp.getResults(), id, "7", "1", "6", "4", "2", "10", "12", "3", "5", "9", "8", "13", "11");
rsp = query("q", "*:*", "fl", "id", "sort", "payload desc", "rows", "20");
- assertFieldValues(rsp.getResults(), id, 11, 13, 8, 9, 5, 3, 12, 10, 2, 4, 6, 1, 7);
+ assertFieldValues(rsp.getResults(), id, "11", "13", "8", "9", "5", "3", "12", "10", "2", "4", "6", "1", "7");
// SOLR-6744
rsp = query("q", "*:*", "fl", "key:id", "sort", "payload asc", "rows", "20");
- assertFieldValues(rsp.getResults(), "key", 7, 1, 6, 4, 2, 10, 12, 3, 5, 9, 8, 13, 11);
+ assertFieldValues(rsp.getResults(), "key", "7", "1", "6", "4", "2", "10", "12", "3", "5", "9", "8", "13", "11");
rsp = query("q", "*:*", "fl", "key:id,id:text", "sort", "payload asc", "rows", "20");
- assertFieldValues(rsp.getResults(), "key", 7, 1, 6, 4, 2, 10, 12, 3, 5, 9, 8, 13, 11);
+ assertFieldValues(rsp.getResults(), "key", "7", "1", "6", "4", "2", "10", "12", "3", "5", "9", "8", "13", "11");
rsp = query("q", "text:a", "fl", "id", "sort", "payload asc", "rows", "20");
- assertFieldValues(rsp.getResults(), id, 1, 3, 5, 9);
+ assertFieldValues(rsp.getResults(), id, "1", "3", "5", "9");
rsp = query("q", "text:a", "fl", "id", "sort", "payload desc", "rows", "20");
- assertFieldValues(rsp.getResults(), id, 9, 5, 3, 1);
+ assertFieldValues(rsp.getResults(), id, "9", "5", "3", "1");
rsp = query("q", "text:b", "fl", "id", "sort", "payload asc", "rows", "20");
- assertFieldValues(rsp.getResults(), id, 4, 2, 10);
+ assertFieldValues(rsp.getResults(), id, "4", "2", "10");
rsp = query("q", "text:b", "fl", "id", "sort", "payload desc", "rows", "20");
- assertFieldValues(rsp.getResults(), id, 10, 2, 4);
+ assertFieldValues(rsp.getResults(), id, "10", "2", "4");
// SOLR-6744
rsp = query("q", "text:b", "fl", "key:id", "sort", "payload asc", "rows", "20");
assertFieldValues(rsp.getResults(), id, null, null, null);
rsp = query("q", "text:c", "fl", "id", "sort", "payload asc", "rows", "20");
- assertFieldValues(rsp.getResults(), id, 7, 6, 8);
+ assertFieldValues(rsp.getResults(), id, "7", "6", "8");
rsp = query("q", "text:c", "fl", "id", "sort", "payload desc", "rows", "20");
- assertFieldValues(rsp.getResults(), id, 8, 6, 7);
+ assertFieldValues(rsp.getResults(), id, "8", "6", "7");
rsp = query("q", "text:d", "fl", "id", "sort", "payload asc", "rows", "20");
- assertFieldValues(rsp.getResults(), id, 12, 13, 11);
+ assertFieldValues(rsp.getResults(), id, "12", "13", "11");
rsp = query("q", "text:d", "fl", "id", "sort", "payload desc", "rows", "20");
- assertFieldValues(rsp.getResults(), id, 11, 13, 12);
+ assertFieldValues(rsp.getResults(), id, "11", "13", "12");
// sanity check function sorting
- rsp = query("q", "id:[1 TO 10]", "fl", "id", "rows", "20",
- "sort", "abs(sub(5,id)) asc, id desc");
- assertFieldValues(rsp.getResults(), id, 5 , 6,4 , 7,3 , 8,2 , 9,1 , 10 );
+ rsp = query("q", "id_i:[1 TO 10]", "fl", "id", "rows", "20",
+ "sort", "abs(sub(5,id_i)) asc, id desc");
+ assertFieldValues(rsp.getResults(), id, "5", "6","4", "7","3" , "8","2" , "9","1" , "10" );
// Add two more docs with same payload as in doc #4
index(id, "14", "text", "b", "payload", ByteBuffer.wrap(new byte[] { 0x25, 0x21, 0x15 }));
@@ -114,9 +114,9 @@ public class DistributedQueryComponentCustomSortTest extends BaseDistributedSear
commit();
- rsp = query("q", "*:*", "fl", "id", "sort", "payload asc, id desc", "rows", "20");
- assertFieldValues(rsp.getResults(), id, 7, 1, 6, 15,14,4, 2, 18,17,16,10, 12, 3, 5, 9, 8, 13, 11);
- rsp = query("q", "*:*", "fl", "id", "sort", "payload desc, id asc", "rows", "20");
- assertFieldValues(rsp.getResults(), id, 11, 13, 8, 9, 5, 3, 12, 10,16,17,18, 2, 4,14,15, 6, 1, 7);
+ rsp = query("q", "*:*", "fl", "id", "sort", "payload asc, id_i desc", "rows", "20");
+ assertFieldValues(rsp.getResults(), id, "7", "1", "6", "15","14","4", "2", "18","17","16","10", "12", "3", "5", "9", "8", "13", "11");
+ rsp = query("q", "*:*", "fl", "id", "sort", "payload desc, id_i asc", "rows", "20");
+ assertFieldValues(rsp.getResults(), id, "11", "13", "8", "9", "5", "3", "12", "10","16","17","18", "2", "4","14","15", "6", "1", "7");
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java
index fb90e83..c211548 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryElevationComponentTest.java
@@ -105,7 +105,7 @@ public class DistributedQueryElevationComponentTest extends BaseDistributedSearc
assertTrue(response.getResults().getNumFound() > 0);
SolrDocument document = response.getResults().get(0);
- assertEquals(6.0f, document.getFieldValue("id"));
+ assertEquals("6", document.getFieldValue("id"));
assertEquals(true, document.getFieldValue("[elevated]"));
// Force javabin format
@@ -121,7 +121,7 @@ public class DistributedQueryElevationComponentTest extends BaseDistributedSearc
assertTrue(response.getResults().getNumFound() > 0);
document = response.getResults().get(0);
- assertEquals(6.0f, document.getFieldValue("id"));
+ assertEquals("6", document.getFieldValue("id"));
assertEquals(true, document.getFieldValue("[elevated]"));
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
index f439e87..829c585 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/QueryElevationComponentTest.java
@@ -96,9 +96,9 @@ public class QueryElevationComponentTest extends SolrTestCaseJ4 {
assertQ("", req(CommonParams.Q, "AAAA", CommonParams.QT, "/elevate",
CommonParams.FL, "id, score, [elevated]")
, "//*[@numFound='3']"
- , "//result/doc[1]/float[@name='id'][.='7.0']"
- , "//result/doc[2]/float[@name='id'][.='9.0']"
- , "//result/doc[3]/float[@name='id'][.='8.0']",
+ , "//result/doc[1]/str[@name='id'][.='7']"
+ , "//result/doc[2]/str[@name='id'][.='9']"
+ , "//result/doc[3]/str[@name='id'][.='8']",
"//result/doc[1]/bool[@name='[elevated]'][.='true']",
"//result/doc[2]/bool[@name='[elevated]'][.='false']",
"//result/doc[3]/bool[@name='[elevated]'][.='false']"
@@ -144,19 +144,19 @@ public class QueryElevationComponentTest extends SolrTestCaseJ4 {
, "//*[@name='ngroups'][.='3']"
, "//*[@name='matches'][.='6']"
- , groups +"/lst[1]//doc[1]/float[@name='id'][.='6.0']"
+ , groups +"/lst[1]//doc[1]/str[@name='id'][.='6']"
, groups +"/lst[1]//doc[1]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[1]//doc[2]/float[@name='id'][.='66.0']"
+ , groups +"/lst[1]//doc[2]/str[@name='id'][.='66']"
, groups +"/lst[1]//doc[2]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[2]//doc[1]/float[@name='id'][.='7.0']"
+ , groups +"/lst[2]//doc[1]/str[@name='id'][.='7']"
, groups +"/lst[2]//doc[1]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[2]//doc[2]/float[@name='id'][.='77.0']"
+ , groups +"/lst[2]//doc[2]/str[@name='id'][.='77']"
, groups +"/lst[2]//doc[2]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[3]//doc[1]/float[@name='id'][.='2.0']"
+ , groups +"/lst[3]//doc[1]/str[@name='id'][.='2']"
, groups +"/lst[3]//doc[1]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[3]//doc[2]/float[@name='id'][.='22.0']"
+ , groups +"/lst[3]//doc[2]/str[@name='id'][.='22']"
, groups +"/lst[3]//doc[2]/bool[@name='[elevated]'][.='false']"
);
@@ -171,19 +171,19 @@ public class QueryElevationComponentTest extends SolrTestCaseJ4 {
, "//*[@name='ngroups'][.='3']"
, "//*[@name='matches'][.='6']"
- , groups +"/lst[1]//doc[1]/float[@name='id'][.='7.0']"
+ , groups +"/lst[1]//doc[1]/str[@name='id'][.='7']"
, groups +"/lst[1]//doc[1]/bool[@name='[elevated]'][.='true']"
- , groups +"/lst[1]//doc[2]/float[@name='id'][.='77.0']"
+ , groups +"/lst[1]//doc[2]/str[@name='id'][.='77']"
, groups +"/lst[1]//doc[2]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[2]//doc[1]/float[@name='id'][.='6.0']"
+ , groups +"/lst[2]//doc[1]/str[@name='id'][.='6']"
, groups +"/lst[2]//doc[1]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[2]//doc[2]/float[@name='id'][.='66.0']"
+ , groups +"/lst[2]//doc[2]/str[@name='id'][.='66']"
, groups +"/lst[2]//doc[2]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[3]//doc[1]/float[@name='id'][.='2.0']"
+ , groups +"/lst[3]//doc[1]/str[@name='id'][.='2']"
, groups +"/lst[3]//doc[1]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[3]//doc[2]/float[@name='id'][.='22.0']"
+ , groups +"/lst[3]//doc[2]/str[@name='id'][.='22']"
, groups +"/lst[3]//doc[2]/bool[@name='[elevated]'][.='false']"
);
@@ -199,19 +199,19 @@ public class QueryElevationComponentTest extends SolrTestCaseJ4 {
, "//*[@name='ngroups'][.='3']"
, "//*[@name='matches'][.='6']"
- , groups +"/lst[1]//doc[1]/float[@name='id'][.='2.0']"
+ , groups +"/lst[1]//doc[1]/str[@name='id'][.='2']"
, groups +"/lst[1]//doc[1]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[1]//doc[2]/float[@name='id'][.='22.0']"
+ , groups +"/lst[1]//doc[2]/str[@name='id'][.='22']"
, groups +"/lst[1]//doc[2]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[2]//doc[1]/float[@name='id'][.='6.0']"
+ , groups +"/lst[2]//doc[1]/str[@name='id'][.='6']"
, groups +"/lst[2]//doc[1]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[2]//doc[2]/float[@name='id'][.='66.0']"
+ , groups +"/lst[2]//doc[2]/str[@name='id'][.='66']"
, groups +"/lst[2]//doc[2]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[3]//doc[1]/float[@name='id'][.='7.0']"
+ , groups +"/lst[3]//doc[1]/str[@name='id'][.='7']"
, groups +"/lst[3]//doc[1]/bool[@name='[elevated]'][.='true']"
- , groups +"/lst[3]//doc[2]/float[@name='id'][.='77.0']"
+ , groups +"/lst[3]//doc[2]/str[@name='id'][.='77']"
, groups +"/lst[3]//doc[2]/bool[@name='[elevated]'][.='false']"
);
@@ -228,19 +228,19 @@ public class QueryElevationComponentTest extends SolrTestCaseJ4 {
, "//*[@name='ngroups'][.='3']"
, "//*[@name='matches'][.='6']"
- , groups +"/lst[1]//doc[1]/float[@name='id'][.='7.0']"
+ , groups +"/lst[1]//doc[1]/str[@name='id'][.='7']"
, groups +"/lst[1]//doc[1]/bool[@name='[elevated]'][.='true']"
- , groups +"/lst[1]//doc[2]/float[@name='id'][.='77.0']"
+ , groups +"/lst[1]//doc[2]/str[@name='id'][.='77']"
, groups +"/lst[1]//doc[2]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[2]//doc[1]/float[@name='id'][.='2.0']"
+ , groups +"/lst[2]//doc[1]/str[@name='id'][.='2']"
, groups +"/lst[2]//doc[1]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[2]//doc[2]/float[@name='id'][.='22.0']"
+ , groups +"/lst[2]//doc[2]/str[@name='id'][.='22']"
, groups +"/lst[2]//doc[2]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[3]//doc[1]/float[@name='id'][.='6.0']"
+ , groups +"/lst[3]//doc[1]/str[@name='id'][.='6']"
, groups +"/lst[3]//doc[1]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[3]//doc[2]/float[@name='id'][.='66.0']"
+ , groups +"/lst[3]//doc[2]/str[@name='id'][.='66']"
, groups +"/lst[3]//doc[2]/bool[@name='[elevated]'][.='false']"
);
@@ -258,19 +258,19 @@ public class QueryElevationComponentTest extends SolrTestCaseJ4 {
, "//*[@name='ngroups'][.='3']"
, "//*[@name='matches'][.='6']"
- , groups +"/lst[1]//doc[1]/float[@name='id'][.='22.0']"
+ , groups +"/lst[1]//doc[1]/str[@name='id'][.='22']"
, groups +"/lst[1]//doc[1]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[1]//doc[2]/float[@name='id'][.='2.0']"
+ , groups +"/lst[1]//doc[2]/str[@name='id'][.='2']"
, groups +"/lst[1]//doc[2]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[2]//doc[1]/float[@name='id'][.='66.0']"
+ , groups +"/lst[2]//doc[1]/str[@name='id'][.='66']"
, groups +"/lst[2]//doc[1]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[2]//doc[2]/float[@name='id'][.='6.0']"
+ , groups +"/lst[2]//doc[2]/str[@name='id'][.='6']"
, groups +"/lst[2]//doc[2]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[3]//doc[1]/float[@name='id'][.='77.0']"
+ , groups +"/lst[3]//doc[1]/str[@name='id'][.='77']"
, groups +"/lst[3]//doc[1]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[3]//doc[2]/float[@name='id'][.='7.0']"
+ , groups +"/lst[3]//doc[2]/str[@name='id'][.='7']"
, groups +"/lst[3]//doc[2]/bool[@name='[elevated]'][.='true']"
);
@@ -289,19 +289,19 @@ public class QueryElevationComponentTest extends SolrTestCaseJ4 {
, "//*[@name='ngroups'][.='3']"
, "//*[@name='matches'][.='6']"
- , groups +"/lst[1]//doc[1]/float[@name='id'][.='7.0']"
+ , groups +"/lst[1]//doc[1]/str[@name='id'][.='7']"
, groups +"/lst[1]//doc[1]/bool[@name='[elevated]'][.='true']"
- , groups +"/lst[1]//doc[2]/float[@name='id'][.='77.0']"
+ , groups +"/lst[1]//doc[2]/str[@name='id'][.='77']"
, groups +"/lst[1]//doc[2]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[2]//doc[1]/float[@name='id'][.='22.0']"
+ , groups +"/lst[2]//doc[1]/str[@name='id'][.='22']"
, groups +"/lst[2]//doc[1]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[2]//doc[2]/float[@name='id'][.='2.0']"
+ , groups +"/lst[2]//doc[2]/str[@name='id'][.='2']"
, groups +"/lst[2]//doc[2]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[3]//doc[1]/float[@name='id'][.='66.0']"
+ , groups +"/lst[3]//doc[1]/str[@name='id'][.='66']"
, groups +"/lst[3]//doc[1]/bool[@name='[elevated]'][.='false']"
- , groups +"/lst[3]//doc[2]/float[@name='id'][.='6.0']"
+ , groups +"/lst[3]//doc[2]/str[@name='id'][.='6']"
, groups +"/lst[3]//doc[2]/bool[@name='[elevated]'][.='false']"
);
@@ -331,9 +331,9 @@ public class QueryElevationComponentTest extends SolrTestCaseJ4 {
assertQ("", req(CommonParams.Q, "AAAA", CommonParams.QT, "/elevate",
CommonParams.FL, "id, score, [elevated]")
,"//*[@numFound='3']"
- ,"//result/doc[1]/int[@name='id'][.='7']"
- ,"//result/doc[2]/int[@name='id'][.='8']"
- ,"//result/doc[3]/int[@name='id'][.='9']",
+ ,"//result/doc[1]/str[@name='id'][.='7']"
+ ,"//result/doc[2]/str[@name='id'][.='8']"
+ ,"//result/doc[3]/str[@name='id'][.='9']",
"//result/doc[1]/bool[@name='[elevated]'][.='true']",
"//result/doc[2]/bool[@name='[elevated]'][.='false']",
"//result/doc[3]/bool[@name='[elevated]'][.='false']"
@@ -750,19 +750,19 @@ public class QueryElevationComponentTest extends SolrTestCaseJ4 {
assertQ("", req(CommonParams.Q, "AAAA", CommonParams.QT, "/elevate",
CommonParams.FL, "id, score, [elevated]")
, "//*[@numFound='1']"
- , "//result/doc[1]/float[@name='id'][.='7.0']"
+ , "//result/doc[1]/str[@name='id'][.='7']"
, "//result/doc[1]/bool[@name='[elevated]'][.='true']"
);
assertQ("", req(CommonParams.Q, "{!q.op=AND}AAAA", CommonParams.QT, "/elevate",
CommonParams.FL, "id, score, [elevated]")
, "//*[@numFound='1']"
- , "//result/doc[1]/float[@name='id'][.='7.0']"
+ , "//result/doc[1]/str[@name='id'][.='7']"
, "//result/doc[1]/bool[@name='[elevated]'][.='true']"
);
assertQ("", req(CommonParams.Q, "{!q.op=AND v='AAAA'}", CommonParams.QT, "/elevate",
CommonParams.FL, "id, score, [elevated]")
, "//*[@numFound='1']"
- , "//result/doc[1]/float[@name='id'][.='7.0']"
+ , "//result/doc[1]/str[@name='id'][.='7']"
, "//result/doc[1]/bool[@name='[elevated]'][.='true']"
);
} finally {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java
index 1798ae5..568676c 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/StatsComponentTest.java
@@ -94,8 +94,8 @@ public class StatsComponentTest extends AbstractSolrTestCase {
// NOTE: doTestFieldStatisticsResult needs the full list of possible tags to exclude
params("stats.field", f, "stats", "true"),
params("stats.field", "{!ex=fq1,fq2}"+f, "stats", "true",
- "fq", "{!tag=fq1}-id:[0 TO 2]",
- "fq", "{!tag=fq2}-id:[2 TO 1000]"),
+ "fq", "{!tag=fq1}-id_i:[0 TO 2]",
+ "fq", "{!tag=fq2}-id_i:[2 TO 1000]"),
params("stats.field", "{!ex=fq1}"+f, "stats", "true",
"fq", "{!tag=fq1}id:1")
};
@@ -299,8 +299,8 @@ public class StatsComponentTest extends AbstractSolrTestCase {
params("stats.field", "{!ex=fq1}"+f, "stats", "true",
"fq", "{!tag=fq1}id:1"),
params("stats.field", "{!ex=fq1,fq2}"+f, "stats", "true",
- "fq", "{!tag=fq1}-id:[0 TO 2]",
- "fq", "{!tag=fq2}-id:[2 TO 1000]") }) {
+ "fq", "{!tag=fq1}-id_i:[0 TO 2]",
+ "fq", "{!tag=fq2}-id_i:[2 TO 1000]") }) {
assertQ("test statistics values",
@@ -878,19 +878,19 @@ public class StatsComponentTest extends AbstractSolrTestCase {
Map<String, String> args = new HashMap<String, String>();
args.put(CommonParams.Q, "*:*");
args.put(StatsParams.STATS, "true");
- args.put(StatsParams.STATS_FIELD, "{!ex=id}id");
- args.put("fq", "{!tag=id}id:[2 TO 3]");
+ args.put(StatsParams.STATS_FIELD, "{!ex=id}id_i");
+ args.put("fq", "{!tag=id}id_i:[2 TO 3]");
SolrQueryRequest req = new LocalSolrQueryRequest(core, new MapSolrParams(args));
assertQ("test exluding filter query", req
- , "//lst[@name='id']/double[@name='min'][.='1.0']"
- , "//lst[@name='id']/double[@name='max'][.='4.0']");
+ , "//lst[@name='id_i']/double[@name='min'][.='1.0']"
+ , "//lst[@name='id_i']/double[@name='max'][.='4.0']");
args = new HashMap<String, String>();
args.put(CommonParams.Q, "*:*");
args.put(StatsParams.STATS, "true");
- args.put(StatsParams.STATS_FIELD, "{!key=id2}id");
- args.put("fq", "{!tag=id}id:[2 TO 3]");
+ args.put(StatsParams.STATS_FIELD, "{!key=id2}id_i");
+ args.put("fq", "{!tag=id}id_i:[2 TO 3]");
req = new LocalSolrQueryRequest(core, new MapSolrParams(args));
assertQ("test rename field", req
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java b/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java
index c703683..dca45dc 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/TestDistributedStatsComponentCardinality.java
@@ -244,7 +244,7 @@ public class TestDistributedStatsComponentCardinality extends BaseDistributedSea
final int highId,
final int log2m,
final int regwidth) {
- ModifiableSolrParams p = params("q", "id:["+lowId+" TO "+highId+"]",
+ ModifiableSolrParams p = params("q", "id_i1:["+lowId+" TO "+highId+"]",
"rows", "0", "stats", "true");
final String prefix = "{!cardinality=true hllLog2m="+log2m+" hllRegwidth="+regwidth;
for (String f : STAT_FIELDS) {
@@ -267,7 +267,7 @@ public class TestDistributedStatsComponentCardinality extends BaseDistributedSea
final int highId,
final double lowAccuracy,
final double highAccuracy) {
- ModifiableSolrParams p = params("q", "id:["+lowId+" TO "+highId+"]",
+ ModifiableSolrParams p = params("q", "id_i1:["+lowId+" TO "+highId+"]",
"rows", "0", "stats", "true");
final String[] prefixes = new String[] {
"{!cardinality=" + lowAccuracy + " key=low_",
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java b/solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java
index 332e346..9c976d8 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/TestExpandComponent.java
@@ -119,12 +119,12 @@ public class TestExpandComponent extends SolrTestCaseJ4 {
params.add("expand", "true");
assertQ(req(params), "*[count(/response/result/doc)=2]",
"*[count(/response/lst[@name='expanded']/result)=2]",
- "/response/result/doc[1]/float[@name='id'][.='2.0']",
- "/response/result/doc[2]/float[@name='id'][.='6.0']",
- "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/float[@name='id'][.='1.0']",
- "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[2]/float[@name='id'][.='7.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/float[@name='id'][.='5.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/float[@name='id'][.='8.0']"
+ "/response/result/doc[1]/str[@name='id'][.='2']",
+ "/response/result/doc[2]/str[@name='id'][.='6']",
+ "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/str[@name='id'][.='1']",
+ "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[2]/str[@name='id'][.='7']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/str[@name='id'][.='5']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/str[@name='id'][.='8']"
);
//Basic test case page 2
@@ -139,9 +139,9 @@ public class TestExpandComponent extends SolrTestCaseJ4 {
params.add("start", "1");
assertQ(req(params), "*[count(/response/result/doc)=1]",
"*[count(/response/lst[@name='expanded']/result)=1]",
- "/response/result/doc[1]/float[@name='id'][.='6.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/float[@name='id'][.='5.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/float[@name='id'][.='8.0']"
+ "/response/result/doc[1]/str[@name='id'][.='6']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/str[@name='id'][.='5']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/str[@name='id'][.='8']"
);
//Test expand.sort
@@ -154,12 +154,12 @@ public class TestExpandComponent extends SolrTestCaseJ4 {
params.add("expand.sort", "test_l desc, sub(1,1) asc");//the "sub()" just testing function queries
assertQ(req(params), "*[count(/response/result/doc)=2]",
"*[count(/response/lst[@name='expanded']/result)=2]",
- "/response/result/doc[1]/float[@name='id'][.='2.0']",
- "/response/result/doc[2]/float[@name='id'][.='6.0']",
- "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/float[@name='id'][.='7.0']",
- "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[2]/float[@name='id'][.='1.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/float[@name='id'][.='8.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/float[@name='id'][.='5.0']"
+ "/response/result/doc[1]/str[@name='id'][.='2']",
+ "/response/result/doc[2]/str[@name='id'][.='6']",
+ "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/str[@name='id'][.='7']",
+ "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[2]/str[@name='id'][.='1']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/str[@name='id'][.='8']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/str[@name='id'][.='5']"
);
//Test with nullPolicy, ExpandComponent should ignore docs with null values in the collapse fields.
@@ -173,13 +173,13 @@ public class TestExpandComponent extends SolrTestCaseJ4 {
params.add("expand.sort", "test_l desc");
assertQ(req(params), "*[count(/response/result/doc)=3]",
"*[count(/response/lst[@name='expanded']/result)=2]",
- "/response/result/doc[1]/float[@name='id'][.='3.0']",
- "/response/result/doc[2]/float[@name='id'][.='2.0']",
- "/response/result/doc[3]/float[@name='id'][.='6.0']",
- "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/float[@name='id'][.='7.0']",
- "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[2]/float[@name='id'][.='1.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/float[@name='id'][.='8.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/float[@name='id'][.='5.0']"
+ "/response/result/doc[1]/str[@name='id'][.='3']",
+ "/response/result/doc[2]/str[@name='id'][.='2']",
+ "/response/result/doc[3]/str[@name='id'][.='6']",
+ "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/str[@name='id'][.='7']",
+ "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[2]/str[@name='id'][.='1']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/str[@name='id'][.='8']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/str[@name='id'][.='5']"
);
@@ -195,12 +195,12 @@ public class TestExpandComponent extends SolrTestCaseJ4 {
params.add("expand.sort", "test_l desc");
assertQ(req(params), "*[count(/response/result/doc)=2]",
"*[count(/response/lst[@name='expanded']/result)=2]",
- "/response/result/doc[1]/float[@name='id'][.='1.0']",
- "/response/result/doc[2]/float[@name='id'][.='5.0']",
- "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/float[@name='id'][.='7.0']",
- "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[2]/float[@name='id'][.='2.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/float[@name='id'][.='8.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/float[@name='id'][.='6.0']"
+ "/response/result/doc[1]/str[@name='id'][.='1']",
+ "/response/result/doc[2]/str[@name='id'][.='5']",
+ "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/str[@name='id'][.='7']",
+ "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[2]/str[@name='id'][.='2']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/str[@name='id'][.='8']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/str[@name='id'][.='6']"
);
@@ -217,12 +217,12 @@ public class TestExpandComponent extends SolrTestCaseJ4 {
params.add("expand.sort", "test_l desc");
assertQ(req(params), "*[count(/response/result/doc)=2]",
"*[count(/response/lst[@name='expanded']/result)=2]",
- "/response/result/doc[1]/float[@name='id'][.='1.0']",
- "/response/result/doc[2]/float[@name='id'][.='5.0']",
- "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/float[@name='id'][.='7.0']",
- "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[2]/float[@name='id'][.='2.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/float[@name='id'][.='8.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/float[@name='id'][.='6.0']"
+ "/response/result/doc[1]/str[@name='id'][.='1']",
+ "/response/result/doc[2]/str[@name='id'][.='5']",
+ "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/str[@name='id'][.='7']",
+ "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[2]/str[@name='id'][.='2']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/str[@name='id'][.='8']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/str[@name='id'][.='6']"
);
//Test overide expand.fq and expand.q
@@ -239,12 +239,12 @@ public class TestExpandComponent extends SolrTestCaseJ4 {
params.add("expand.sort", "test_l desc");
assertQ(req(params), "*[count(/response/result/doc)=2]",
"*[count(/response/lst[@name='expanded']/result)=2]",
- "/response/result/doc[1]/float[@name='id'][.='1.0']",
- "/response/result/doc[2]/float[@name='id'][.='5.0']",
- "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/float[@name='id'][.='7.0']",
- "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[2]/float[@name='id'][.='2.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/float[@name='id'][.='8.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/float[@name='id'][.='6.0']"
+ "/response/result/doc[1]/str[@name='id'][.='1']",
+ "/response/result/doc[2]/str[@name='id'][.='5']",
+ "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/str[@name='id'][.='7']",
+ "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[2]/str[@name='id'][.='2']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/str[@name='id'][.='8']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/str[@name='id'][.='6']"
);
//Test expand.rows
@@ -261,10 +261,10 @@ public class TestExpandComponent extends SolrTestCaseJ4 {
"*[count(/response/lst[@name='expanded']/result)=2]",
"*[count(/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc)=1]",
"*[count(/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc)=1]",
- "/response/result/doc[1]/float[@name='id'][.='2.0']",
- "/response/result/doc[2]/float[@name='id'][.='6.0']",
- "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/float[@name='id'][.='7.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/float[@name='id'][.='8.0']"
+ "/response/result/doc[1]/str[@name='id'][.='2']",
+ "/response/result/doc[2]/str[@name='id'][.='6']",
+ "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/str[@name='id'][.='7']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/str[@name='id'][.='8']"
);
@@ -307,12 +307,12 @@ public class TestExpandComponent extends SolrTestCaseJ4 {
params.add("fl", "id");
assertQ(req(params), "*[count(/response/result/doc)=2]",
"*[count(/response/lst[@name='expanded']/result)=2]",
- "/response/result/doc[1]/float[@name='id'][.='2.0']",
- "/response/result/doc[2]/float[@name='id'][.='6.0']",
- "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/float[@name='id'][.='1.0']",
- "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[2]/float[@name='id'][.='7.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/float[@name='id'][.='5.0']",
- "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/float[@name='id'][.='8.0']"
+ "/response/result/doc[1]/str[@name='id'][.='2']",
+ "/response/result/doc[2]/str[@name='id'][.='6']",
+ "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[1]/str[@name='id'][.='1']",
+ "/response/lst[@name='expanded']/result[@name='1"+floatAppend+"']/doc[2]/str[@name='id'][.='7']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[1]/str[@name='id'][.='5']",
+ "/response/lst[@name='expanded']/result[@name='2"+floatAppend+"']/doc[2]/str[@name='id'][.='8']"
);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/request/SimpleFacetsTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/request/SimpleFacetsTest.java b/solr/core/src/test/org/apache/solr/request/SimpleFacetsTest.java
index fd8d6ec..8f4a24d 100644
--- a/solr/core/src/test/org/apache/solr/request/SimpleFacetsTest.java
+++ b/solr/core/src/test/org/apache/solr/request/SimpleFacetsTest.java
@@ -236,7 +236,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
@Test
public void testCachingBigTerms() throws Exception {
- assertQ( req("indent","true", "q", "id:[42 TO 47]",
+ assertQ( req("indent","true", "q", "id_i1:[42 TO 47]",
"facet", "true",
"facet.field", "foo_s" // big terms should cause foo_s:A to be cached
),
@@ -270,7 +270,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
assertQ(
req(
"q", "*:*",
- "fq", "id:[2000 TO 2004]",
+ "fq", "id_i1:[2000 TO 2004]",
"group", "true",
"group.facet", "true",
"group.field", "hotel_s1",
@@ -284,7 +284,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
assertQ(
req(
"q", "*:*",
- "fq", "id:[2000 TO 2004]",
+ "fq", "id_i1:[2000 TO 2004]",
"fq", "{!tag=dus}airport_s1:dus",
"group", "true",
"group.facet", "true",
@@ -298,7 +298,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
assertQ(
req(
"q", "*:*",
- "fq", "id:[2000 TO 2004]",
+ "fq", "id_i1:[2000 TO 2004]",
"group", "true",
"group.facet", "true",
"group.field", "hotel_s1",
@@ -320,7 +320,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
assertQ(
req(
"q", "*:*",
- "fq", "id:[2000 TO 2004]",
+ "fq", "id_i1:[2000 TO 2004]",
"fq", "{!tag=dus}airport_s1:dus",
"group", "true",
"group.facet", "true",
@@ -344,7 +344,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
assertQ(
req(
"q", "*:*",
- "fq", "id:[2000 TO 2004]",
+ "fq", "id_i1:[2000 TO 2004]",
"fq", "{!tag=dus}airport_s1:dus",
"group", "true",
"group.facet", "true",
@@ -380,14 +380,14 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
private void testSimpleGroupedFacets(String facetLimit) throws Exception {
assertQ(
"Return 5 docs with id range 1937 till 1940",
- req("id:[2000 TO 2004]"),
+ req("id_i1:[2000 TO 2004]"),
"*[count(//doc)=5]"
);
assertQ(
"Return two facet counts for field airport_a and duration_i1",
req(
"q", "*:*",
- "fq", "id:[2000 TO 2004]",
+ "fq", "id_i1:[2000 TO 2004]",
"group", "true",
"group.facet", "true",
"group.field", "hotel_s1",
@@ -410,7 +410,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
"Return one facet count for field airport_a using facet.offset",
req(
"q", "*:*",
- "fq", "id:[2000 TO 2004]",
+ "fq", "id_i1:[2000 TO 2004]",
"group", "true",
"group.facet", "true",
"group.field", "hotel_s1",
@@ -427,7 +427,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
"Return two facet counts for field airport_a with fq",
req(
"q", "*:*",
- "fq", "id:[2000 TO 2004]",
+ "fq", "id_i1:[2000 TO 2004]",
"fq", "duration_i1:5",
"group", "true",
"group.facet", "true",
@@ -445,7 +445,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
"Return one facet count for field airport_s1 with prefix a",
req(
"q", "*:*",
- "fq", "id:[2000 TO 2004]",
+ "fq", "id_i1:[2000 TO 2004]",
"group", "true",
"group.facet", "true",
"group.field", "hotel_s1",
@@ -463,7 +463,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
h.query(
req(
"q", "*:*",
- "fq", "id:[2000 TO 2004]",
+ "fq", "id_i1:[2000 TO 2004]",
"group.facet", "true",
"facet", "true",
"facet.field", "airport_s1",
@@ -541,26 +541,26 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
public void testSimpleFacetCounts() {
assertQ("standard request handler returns all matches",
- req("id:[42 TO 47]"),
+ req("id_i1:[42 TO 47]"),
"*[count(//doc)=6]"
);
assertQ("filter results using fq",
- req("q","id:[42 TO 46]",
- "fq", "id:[43 TO 47]"),
+ req("q","id_i1:[42 TO 46]",
+ "fq", "id_i1:[43 TO 47]"),
"*[count(//doc)=4]"
);
assertQ("don't filter results using blank fq",
- req("q","id:[42 TO 46]",
+ req("q","id_i1:[42 TO 46]",
"fq", " "),
"*[count(//doc)=5]"
);
assertQ("filter results using multiple fq params",
- req("q","id:[42 TO 46]",
+ req("q","id_i1:[42 TO 46]",
"fq", "trait_s:Obnoxious",
- "fq", "id:[43 TO 47]"),
+ "fq", "id_i1:[43 TO 47]"),
"*[count(//doc)=1]"
);
@@ -570,19 +570,19 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
for(String[] methodParam : new String[][]{ none, uifSwitch}){
assertQ("check counts for facet queries",
req(methodParam
- ,"q", "id:[42 TO 47]"
+ ,"q", "id_i1:[42 TO 47]"
,"facet", "true"
,"facet.query", "trait_s:Obnoxious"
- ,"facet.query", "id:[42 TO 45]"
- ,"facet.query", "id:[43 TO 47]"
+ ,"facet.query", "id_i1:[42 TO 45]"
+ ,"facet.query", "id_i1:[43 TO 47]"
,"facet.field", "trait_s"
)
,"*[count(//doc)=6]"
,"//lst[@name='facet_counts']/lst[@name='facet_queries']"
,"//lst[@name='facet_queries']/int[@name='trait_s:Obnoxious'][.='2']"
- ,"//lst[@name='facet_queries']/int[@name='id:[42 TO 45]'][.='4']"
- ,"//lst[@name='facet_queries']/int[@name='id:[43 TO 47]'][.='5']"
+ ,"//lst[@name='facet_queries']/int[@name='id_i1:[42 TO 45]'][.='4']"
+ ,"//lst[@name='facet_queries']/int[@name='id_i1:[43 TO 47]'][.='5']"
,"//lst[@name='facet_counts']/lst[@name='facet_fields']"
,"//lst[@name='facet_fields']/lst[@name='trait_s']"
@@ -593,11 +593,11 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
);
assertQ("check multi-select facets with naming",
- req(methodParam, "q", "id:[42 TO 47]"
+ req(methodParam, "q", "id_i1:[42 TO 47]"
,"facet", "true"
,"facet.query", "{!ex=1}trait_s:Obnoxious"
- ,"facet.query", "{!ex=2 key=foo}id:[42 TO 45]" // tag=2 same as 1
- ,"facet.query", "{!ex=3,4 key=bar}id:[43 TO 47]" // tag=3,4 don't exist
+ ,"facet.query", "{!ex=2 key=foo}id_i1:[42 TO 45]" // tag=2 same as 1
+ ,"facet.query", "{!ex=3,4 key=bar}id_i1:[43 TO 47]" // tag=3,4 don't exist
,"facet.field", "{!ex=3,1}trait_s" // 3,1 same as 1
,"fq", "{!tag=1,2}id:47" // tagged as 1 and 2
)
@@ -629,17 +629,17 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
for(String[] methodParam : new String[][]{ none, uifSwitch}){
assertQ("check counts for applied facet queries using filtering (fq)",
req(methodParam
- ,"q", "id:[42 TO 47]"
+ ,"q", "id_i1:[42 TO 47]"
,"facet", "true"
- ,"fq", "id:[42 TO 45]"
+ ,"fq", "id_i1:[42 TO 45]"
,"facet.field", "trait_s"
- ,"facet.query", "id:[42 TO 45]"
- ,"facet.query", "id:[43 TO 47]"
+ ,"facet.query", "id_i1:[42 TO 45]"
+ ,"facet.query", "id_i1:[43 TO 47]"
)
,"*[count(//doc)=4]"
,"//lst[@name='facet_counts']/lst[@name='facet_queries']"
- ,"//lst[@name='facet_queries']/int[@name='id:[42 TO 45]'][.='4']"
- ,"//lst[@name='facet_queries']/int[@name='id:[43 TO 47]'][.='3']"
+ ,"//lst[@name='facet_queries']/int[@name='id_i1:[42 TO 45]'][.='4']"
+ ,"//lst[@name='facet_queries']/int[@name='id_i1:[43 TO 47]'][.='3']"
,"*[count(//lst[@name='trait_s']/int)=4]"
,"//lst[@name='trait_s']/int[@name='Tool'][.='2']"
,"//lst[@name='trait_s']/int[@name='Obnoxious'][.='1']"
@@ -649,11 +649,11 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
assertQ("check counts with facet.zero=false&facet.missing=true using fq",
req(methodParam
- ,"q", "id:[42 TO 47]"
+ ,"q", "id_i1:[42 TO 47]"
,"facet", "true"
,"facet.zeros", "false"
,"f.trait_s.facet.missing", "true"
- ,"fq", "id:[42 TO 45]"
+ ,"fq", "id_i1:[42 TO 45]"
,"facet.field", "trait_s"
)
,"*[count(//doc)=4]"
@@ -666,11 +666,11 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
assertQ("check counts with facet.mincount=1&facet.missing=true using fq",
req(methodParam
- ,"q", "id:[42 TO 47]"
+ ,"q", "id_i1:[42 TO 47]"
,"facet", "true"
,"facet.mincount", "1"
,"f.trait_s.facet.missing", "true"
- ,"fq", "id:[42 TO 45]"
+ ,"fq", "id_i1:[42 TO 45]"
,"facet.field", "trait_s"
)
,"*[count(//doc)=4]"
@@ -683,11 +683,11 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
assertQ("check counts with facet.mincount=2&facet.missing=true using fq",
req(methodParam
- ,"q", "id:[42 TO 47]"
+ ,"q", "id_i1:[42 TO 47]"
,"facet", "true"
,"facet.mincount", "2"
,"f.trait_s.facet.missing", "true"
- ,"fq", "id:[42 TO 45]"
+ ,"fq", "id_i1:[42 TO 45]"
,"facet.field", "trait_s"
)
,"*[count(//doc)=4]"
@@ -698,9 +698,9 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
assertQ("check sorted paging",
req(methodParam
- ,"q", "id:[42 TO 47]"
+ ,"q", "id_i1:[42 TO 47]"
,"facet", "true"
- ,"fq", "id:[42 TO 45]"
+ ,"fq", "id_i1:[42 TO 45]"
,"facet.field", "trait_s"
,"facet.mincount","0"
,"facet.offset","0"
@@ -715,9 +715,9 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
// check that the default sort is by count
assertQ("check sorted paging",
- req(methodParam, "q", "id:[42 TO 47]"
+ req(methodParam, "q", "id_i1:[42 TO 47]"
,"facet", "true"
- ,"fq", "id:[42 TO 45]"
+ ,"fq", "id_i1:[42 TO 45]"
,"facet.field", "trait_s"
,"facet.mincount","0"
,"facet.offset","0"
@@ -732,9 +732,9 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
//
// check that legacy facet.sort=true/false works
//
- assertQ(req(methodParam, "q", "id:[42 TO 47]"
+ assertQ(req(methodParam, "q", "id_i1:[42 TO 47]"
,"facet", "true"
- ,"fq", "id:[42 TO 45]"
+ ,"fq", "id_i1:[42 TO 45]"
,"facet.field", "trait_s"
,"facet.mincount","0"
,"facet.offset","0"
@@ -747,9 +747,9 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
,"//int[3][@name='Obnoxious'][.='1']"
);
- assertQ(req(methodParam, "q", "id:[42 TO 47]"
+ assertQ(req(methodParam, "q", "id_i1:[42 TO 47]"
,"facet", "true"
- ,"fq", "id:[42 TO 45]"
+ ,"fq", "id_i1:[42 TO 45]"
,"facet.field", "trait_s"
,"facet.mincount","1"
,"facet.offset","0"
@@ -764,9 +764,9 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
}
for(String method : new String[]{ "fc","uif"}){
- assertQ(req("q", "id:[42 TO 47]"
+ assertQ(req("q", "id_i1:[42 TO 47]"
,"facet", "true"
- ,"fq", "id:[42 TO 45]"
+ ,"fq", "id_i1:[42 TO 45]"
,"facet.field", "zerolen_s"
,(random().nextBoolean() ? "":"f.zerolen_s.")+"facet.method", method
)
@@ -1475,7 +1475,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
String mid = (new Double( ((double)Float.MAX_VALUE) * 2D )).toString();
assertQ(f+": checking counts for lower",
- req( "q", "id:[30 TO 60]"
+ req( "q", "id_i1:[30 TO 60]"
,"rows", "0"
,"facet", "true"
,"facet.range", f
@@ -1714,7 +1714,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
@Test
public void testNumericRangeFacetsTrieInt() {
- helpTestWholeNumberRangeFacets("id");
+ helpTestWholeNumberRangeFacets("id_i1");
}
@Test
public void testNumericRangeFacetsTrieLong() {
@@ -1723,7 +1723,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
@Test
public void testNumericRangeFacetsTrieIntDocValues() {
- helpTestWholeNumberRangeFacets("id", FacetRangeMethod.DV);
+ helpTestWholeNumberRangeFacets("id_i1", FacetRangeMethod.DV);
}
@Test
@@ -1752,7 +1752,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
String mid = (new Long( ((long)Integer.MAX_VALUE) * 2L )).toString();
assertQ(f+": checking counts for lower",
- req( "q", "id:[30 TO 60]"
+ req( "q", "id_i1:[30 TO 60]"
,"rows", "0"
,"facet", "true"
,"facet.range", f
@@ -1788,7 +1788,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
final String meta = pre + "/../";
assertQ(f+": checking counts for lower",
- req( "q", "id:[30 TO 60]"
+ req( "q", "id_i1:[30 TO 60]"
,"rows", "0"
,"facet", "true"
,"facet.range", f
@@ -1810,7 +1810,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
);
assertQ(f + ":checking counts for upper",
- req( "q", "id:[30 TO 60]"
+ req( "q", "id_i1:[30 TO 60]"
,"rows", "0"
,"facet", "true"
,"facet.range", f
@@ -2847,7 +2847,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
private void doTestRangeQueryHardEndParam(String field, FacetRangeMethod method) {
assertQ("Test facet.range.hardend",
- req("q", "id:[42 TO 47]"
+ req("q", "id_i1:[42 TO 47]"
,"facet","true"
,"fl","id," + field
,"facet.range", field
@@ -2868,7 +2868,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
);
assertQ("Test facet.range.hardend",
- req("q", "id:[42 TO 47]"
+ req("q", "id_i1:[42 TO 47]"
,"facet","true"
,"fl","id," + field
,"facet.range", field
@@ -2901,7 +2901,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
private void doTestRangeQueryOtherParam(String field, FacetRangeMethod method) {
assertQ("Test facet.range.other",
- req("q", "id:[42 TO 47]"
+ req("q", "id_i1:[42 TO 47]"
,"facet","true"
,"fl","id," + field
,"facet.range", field
@@ -2921,7 +2921,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
);
assertQ("Test facet.range.other",
- req("q", "id:[42 TO 47]"
+ req("q", "id_i1:[42 TO 47]"
,"facet","true"
,"fl","id," + field
,"facet.range", field
@@ -2941,7 +2941,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
);
assertQ("Test facet.range.other",
- req("q", "id:[42 TO 47]"
+ req("q", "id_i1:[42 TO 47]"
,"facet","true"
,"fl","id," + field
,"facet.range", field
@@ -2961,7 +2961,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
);
assertQ("Test facet.range.other",
- req("q", "id:[42 TO 47]"
+ req("q", "id_i1:[42 TO 47]"
,"facet","true"
,"fl","id," + field
,"facet.range", field
@@ -2982,7 +2982,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
// these should have equivilent behavior (multivalued 'other' param: top level vs local)
for (SolrQueryRequest req : new SolrQueryRequest[] {
- req("q", "id:[42 TO 47]"
+ req("q", "id_i1:[42 TO 47]"
,"facet","true"
,"fl","id," + field
,"facet.range", field
@@ -2992,7 +2992,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
,"facet.range.gap","1"
,"facet.range.other",FacetRangeOther.BEFORE.toString()
,"facet.range.other",FacetRangeOther.AFTER.toString()),
- req("q", "id:[42 TO 47]"
+ req("q", "id_i1:[42 TO 47]"
,"facet","true"
,"fl","id," + field
,"facet.range", "{!facet.range.other=before facet.range.other=after}" + field
@@ -3013,7 +3013,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
}
assertQ("Test facet.range.other",
- req("q", "id:[42 TO 47]"
+ req("q", "id_i1:[42 TO 47]"
,"facet","true"
,"fl","id," + field
,"facet.range", field
@@ -3035,7 +3035,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
);
assertQ("Test facet.range.other",
- req("q", "id:[42 TO 47]"
+ req("q", "id_i1:[42 TO 47]"
,"facet","true"
,"fl","id," + field
,"facet.range", field
@@ -3056,7 +3056,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
);
assertQ("Test facet.range.other",
- req("q", "id:[42 TO 47]"
+ req("q", "id_i1:[42 TO 47]"
,"facet","true"
,"fl","id," + field
,"facet.range", field
@@ -3077,7 +3077,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
);
assertQ("Test facet.range.other",
- req("q", "id:[42 TO 47]"
+ req("q", "id_i1:[42 TO 47]"
,"facet","true"
,"fl","id," + field
,"facet.range", field
@@ -3098,7 +3098,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
);
assertQ("Test facet.range.other",
- req("q", "id:[42 TO 47]"
+ req("q", "id_i1:[42 TO 47]"
,"facet","true"
,"fl","id," + field
,"facet.range", field
@@ -3119,7 +3119,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
);
assertQ("Test facet.range.other",
- req("q", "id:[12345 TO 12345]"
+ req("q", "id_i1:[12345 TO 12345]"
,"facet","true"
,"fl","id," + field
,"facet.range", field
@@ -3138,7 +3138,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
);
assertQ("Test facet.range.other",
- req("q", "id:[42 TO 47]"
+ req("q", "id_i1:[42 TO 47]"
,"facet","true"
,"fl","id," + field
,"facet.range", field
@@ -3332,7 +3332,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
public void testFacetPrefixWithFacetThreads() throws Exception {
assertQ("Test facet.prefix with facet.thread",
- req("q", "id:[101 TO 102]"
+ req("q", "id_i1:[101 TO 102]"
,"facet","true"
,"facet.field", "{!key=key1 facet.prefix=foo}myfield_s"
,"facet.field", "{!key=key2 facet.prefix=bar}myfield_s"
@@ -3352,7 +3352,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
values[0] = random().nextInt(3000);
values[1] = random().nextInt(3000);
Arrays.sort(values);
- return String.format(Locale.ROOT, "id: [%d TO %d]", values[0], values[1]);
+ return String.format(Locale.ROOT, "id_i1:[%d TO %d]", values[0], values[1]);
}
@@ -3375,7 +3375,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 {
}
private ModifiableSolrParams getRandomParamsInt() {
- String field = new String[]{"range_facet_l_dv", "range_facet_i_dv", "range_facet_l", "duration_i1", "id"}[random().nextInt(5)];
+ String field = new String[]{"range_facet_l_dv", "range_facet_i_dv", "range_facet_l", "duration_i1", "id_i1"}[random().nextInt(5)];
ModifiableSolrParams params = new ModifiableSolrParams();
Integer[] values = new Integer[2];
do {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/request/TestFaceting.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/request/TestFaceting.java b/solr/core/src/test/org/apache/solr/request/TestFaceting.java
index a80669a..8933c19 100644
--- a/solr/core/src/test/org/apache/solr/request/TestFaceting.java
+++ b/solr/core/src/test/org/apache/solr/request/TestFaceting.java
@@ -64,7 +64,7 @@ public class TestFaceting extends SolrTestCaseJ4 {
void createIndex(int nTerms) {
assertU(delQ("*:*"));
for (int i=0; i<nTerms; i++) {
- assertU(adoc("id", Float.toString(i), proto.field(), t(i) ));
+ assertU(adoc("id", Integer.toString(i), proto.field(), t(i) ));
}
assertU(optimize()); // squeeze out any possible deleted docs
}
@@ -297,9 +297,9 @@ public class TestFaceting extends SolrTestCaseJ4 {
@Test
public void testFacetSortWithMinCount() {
- assertU(adoc("id", "1.0", "f_td", "-420.126"));
- assertU(adoc("id", "2.0", "f_td", "-285.672"));
- assertU(adoc("id", "3.0", "f_td", "-1.218"));
+ assertU(adoc("id", "1", "f_td", "-420.126"));
+ assertU(adoc("id", "2", "f_td", "-285.672"));
+ assertU(adoc("id", "3", "f_td", "-1.218"));
assertU(commit());
assertQ(req("q", "*:*", FacetParams.FACET, "true", FacetParams.FACET_FIELD, "f_td", "f.f_td.facet.sort", FacetParams.FACET_SORT_INDEX),
@@ -329,9 +329,9 @@ public class TestFaceting extends SolrTestCaseJ4 {
@Test
public void testFacetSortWithMinCount0() {
- assertU(adoc("id", "1.0", "f_td", "-420.126"));
- assertU(adoc("id", "2.0", "f_td", "-285.672"));
- assertU(adoc("id", "3.0", "f_td", "-1.218"));
+ assertU(adoc("id", "1", "f_td", "-420.126"));
+ assertU(adoc("id", "2", "f_td", "-285.672"));
+ assertU(adoc("id", "3", "f_td", "-1.218"));
assertU(commit());
assertQ(req("q", "id:1.0", FacetParams.FACET, "true", FacetParams.FACET_FIELD, "f_td", "f.f_td.facet.sort", FacetParams.FACET_SORT_INDEX, FacetParams.FACET_MINCOUNT, "0", FacetParams.FACET_METHOD, FacetParams.FACET_METHOD_fc),
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformer.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformer.java b/solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformer.java
index b80fe95..2e68d78 100644
--- a/solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformer.java
+++ b/solr/core/src/test/org/apache/solr/response/transform/TestChildDocTransformer.java
@@ -64,23 +64,23 @@ public class TestChildDocTransformer extends SolrTestCaseJ4 {
private void testChildDoctransformerXML() {
String test1[] = new String[] {
"//*[@numFound='1']",
- "/response/result/doc[1]/doc[1]/int[@name='id']='2'" ,
- "/response/result/doc[1]/doc[2]/int[@name='id']='3'" ,
- "/response/result/doc[1]/doc[3]/int[@name='id']='4'" ,
- "/response/result/doc[1]/doc[4]/int[@name='id']='5'" ,
- "/response/result/doc[1]/doc[5]/int[@name='id']='6'" ,
- "/response/result/doc[1]/doc[6]/int[@name='id']='7'"};
+ "/response/result/doc[1]/doc[1]/str[@name='id']='2'" ,
+ "/response/result/doc[1]/doc[2]/str[@name='id']='3'" ,
+ "/response/result/doc[1]/doc[3]/str[@name='id']='4'" ,
+ "/response/result/doc[1]/doc[4]/str[@name='id']='5'" ,
+ "/response/result/doc[1]/doc[5]/str[@name='id']='6'" ,
+ "/response/result/doc[1]/doc[6]/str[@name='id']='7'"};
String test2[] = new String[] {
"//*[@numFound='1']",
- "/response/result/doc[1]/doc[1]/int[@name='id']='2'" ,
- "/response/result/doc[1]/doc[2]/int[@name='id']='4'" ,
- "/response/result/doc[1]/doc[3]/int[@name='id']='6'" };
+ "/response/result/doc[1]/doc[1]/str[@name='id']='2'" ,
+ "/response/result/doc[1]/doc[2]/str[@name='id']='4'" ,
+ "/response/result/doc[1]/doc[3]/str[@name='id']='6'" };
String test3[] = new String[] {
"//*[@numFound='1']",
- "/response/result/doc[1]/doc[1]/int[@name='id']='3'" ,
- "/response/result/doc[1]/doc[2]/int[@name='id']='5'" };
+ "/response/result/doc[1]/doc[1]/str[@name='id']='3'" ,
+ "/response/result/doc[1]/doc[2]/str[@name='id']='5'" };
@@ -100,12 +100,12 @@ public class TestChildDocTransformer extends SolrTestCaseJ4 {
final String subqueryPath = "/result[@name='children'][@numFound='6']";
test1 = new String[] {
"//*[@numFound='1']",
- "/response/result/doc[1]" + subqueryPath + "/doc[1]/int[@name='id']='2'" ,
- "/response/result/doc[1]" + subqueryPath + "/doc[2]/int[@name='id']='3'" ,
- "/response/result/doc[1]" + subqueryPath + "/doc[3]/int[@name='id']='4'" ,
- "/response/result/doc[1]" + subqueryPath + "/doc[4]/int[@name='id']='5'" ,
- "/response/result/doc[1]" + subqueryPath + "/doc[5]/int[@name='id']='6'" ,
- "/response/result/doc[1]" + subqueryPath + "/doc[6]/int[@name='id']='7'"};
+ "/response/result/doc[1]" + subqueryPath + "/doc[1]/str[@name='id']='2'" ,
+ "/response/result/doc[1]" + subqueryPath + "/doc[2]/str[@name='id']='3'" ,
+ "/response/result/doc[1]" + subqueryPath + "/doc[3]/str[@name='id']='4'" ,
+ "/response/result/doc[1]" + subqueryPath + "/doc[4]/str[@name='id']='5'" ,
+ "/response/result/doc[1]" + subqueryPath + "/doc[5]/str[@name='id']='6'" ,
+ "/response/result/doc[1]" + subqueryPath + "/doc[6]/str[@name='id']='7'"};
}
assertQ(req("q", "*:*", "fq", "subject:\"parentDocument\" ",
@@ -116,9 +116,9 @@ public class TestChildDocTransformer extends SolrTestCaseJ4 {
String test2[] = new String[] {
"//*[@numFound='1']",
- "/response/result/doc[1]/result[@name='children'][@numFound='3']/doc[1]/int[@name='id']='2'" ,
- "/response/result/doc[1]/result[@name='children'][@numFound='3']/doc[2]/int[@name='id']='4'" ,
- "/response/result/doc[1]/result[@name='children'][@numFound='3']/doc[3]/int[@name='id']='6'" };
+ "/response/result/doc[1]/result[@name='children'][@numFound='3']/doc[1]/str[@name='id']='2'" ,
+ "/response/result/doc[1]/result[@name='children'][@numFound='3']/doc[2]/str[@name='id']='4'" ,
+ "/response/result/doc[1]/result[@name='children'][@numFound='3']/doc[3]/str[@name='id']='6'" };
assertQ(req("q", "*:*", "fq", "subject:\"parentDocument\" ",
"fl", "*,children:[subquery]",
@@ -130,8 +130,8 @@ public class TestChildDocTransformer extends SolrTestCaseJ4 {
String test3[] = new String[] {
"//*[@numFound='1']",
- "/response/result/doc[1]/result[@name='children'][@numFound='3']/doc[1]/int[@name='id']='3'" ,
- "/response/result/doc[1]/result[@name='children'][@numFound='3']/doc[2]/int[@name='id']='5'" };
+ "/response/result/doc[1]/result[@name='children'][@numFound='3']/doc[1]/str[@name='id']='3'" ,
+ "/response/result/doc[1]/result[@name='children'][@numFound='3']/doc[2]/str[@name='id']='5'" };
assertQ(req("q", "*:*", "fq", "subject:\"parentDocument\" ",
@@ -145,23 +145,23 @@ public class TestChildDocTransformer extends SolrTestCaseJ4 {
private void testSubQueryJSON() throws Exception {
String[] test1 = new String[] {
- "/response/docs/[0]/children/docs/[0]/id==2",
- "/response/docs/[0]/children/docs/[1]/id==3",
- "/response/docs/[0]/children/docs/[2]/id==4",
- "/response/docs/[0]/children/docs/[3]/id==5",
- "/response/docs/[0]/children/docs/[4]/id==6",
- "/response/docs/[0]/children/docs/[5]/id==7"
+ "/response/docs/[0]/children/docs/[0]/id=='2'",
+ "/response/docs/[0]/children/docs/[1]/id=='3'",
+ "/response/docs/[0]/children/docs/[2]/id=='4'",
+ "/response/docs/[0]/children/docs/[3]/id=='5'",
+ "/response/docs/[0]/children/docs/[4]/id=='6'",
+ "/response/docs/[0]/children/docs/[5]/id=='7'"
};
String[] test2 = new String[] {
- "/response/docs/[0]/children/docs/[0]/id==2",
- "/response/docs/[0]/children/docs/[1]/id==4",
- "/response/docs/[0]/children/docs/[2]/id==6"
+ "/response/docs/[0]/children/docs/[0]/id=='2'",
+ "/response/docs/[0]/children/docs/[1]/id=='4'",
+ "/response/docs/[0]/children/docs/[2]/id=='6'"
};
String[] test3 = new String[] {
- "/response/docs/[0]/children/docs/[0]/id==3",
- "/response/docs/[0]/children/docs/[1]/id==5"
+ "/response/docs/[0]/children/docs/[0]/id=='3'",
+ "/response/docs/[0]/children/docs/[1]/id=='5'"
};
@@ -186,23 +186,23 @@ public class TestChildDocTransformer extends SolrTestCaseJ4 {
private void testChildDoctransformerJSON() throws Exception {
String[] test1 = new String[] {
- "/response/docs/[0]/_childDocuments_/[0]/id==2",
- "/response/docs/[0]/_childDocuments_/[1]/id==3",
- "/response/docs/[0]/_childDocuments_/[2]/id==4",
- "/response/docs/[0]/_childDocuments_/[3]/id==5",
- "/response/docs/[0]/_childDocuments_/[4]/id==6",
- "/response/docs/[0]/_childDocuments_/[5]/id==7"
+ "/response/docs/[0]/_childDocuments_/[0]/id=='2'",
+ "/response/docs/[0]/_childDocuments_/[1]/id=='3'",
+ "/response/docs/[0]/_childDocuments_/[2]/id=='4'",
+ "/response/docs/[0]/_childDocuments_/[3]/id=='5'",
+ "/response/docs/[0]/_childDocuments_/[4]/id=='6'",
+ "/response/docs/[0]/_childDocuments_/[5]/id=='7'"
};
String[] test2 = new String[] {
- "/response/docs/[0]/_childDocuments_/[0]/id==2",
- "/response/docs/[0]/_childDocuments_/[1]/id==4",
- "/response/docs/[0]/_childDocuments_/[2]/id==6"
+ "/response/docs/[0]/_childDocuments_/[0]/id=='2'",
+ "/response/docs/[0]/_childDocuments_/[1]/id=='4'",
+ "/response/docs/[0]/_childDocuments_/[2]/id=='6'"
};
String[] test3 = new String[] {
- "/response/docs/[0]/_childDocuments_/[0]/id==3",
- "/response/docs/[0]/_childDocuments_/[1]/id==5"
+ "/response/docs/[0]/_childDocuments_/[0]/id=='3'",
+ "/response/docs/[0]/_childDocuments_/[1]/id=='5'"
};
@@ -285,12 +285,12 @@ public class TestChildDocTransformer extends SolrTestCaseJ4 {
private void testParentFilterJSON() throws Exception {
String[] tests = new String[] {
- "/response/docs/[0]/id==1",
- "/response/docs/[0]/_childDocuments_/[0]/id==2",
+ "/response/docs/[0]/id=='1'",
+ "/response/docs/[0]/_childDocuments_/[0]/id=='2'",
"/response/docs/[0]/_childDocuments_/[0]/cat/[0]/=='childDocument'",
"/response/docs/[0]/_childDocuments_/[0]/title/[0]/=='" + titleVals[0] + "'",
- "/response/docs/[1]/id==4",
- "/response/docs/[1]/_childDocuments_/[0]/id==5",
+ "/response/docs/[1]/id=='4'",
+ "/response/docs/[1]/_childDocuments_/[0]/id=='5'",
"/response/docs/[1]/_childDocuments_/[0]/cat/[0]/=='childDocument'",
"/response/docs/[1]/_childDocuments_/[0]/title/[0]/=='" + titleVals[1] + "'"
};
@@ -313,12 +313,12 @@ public class TestChildDocTransformer extends SolrTestCaseJ4 {
private void testSubQueryParentFilterJSON() throws Exception {
String[] tests = new String[] {
- "/response/docs/[0]/id==1",
- "/response/docs/[0]/children/docs/[0]/id==2",
+ "/response/docs/[0]/id=='1'",
+ "/response/docs/[0]/children/docs/[0]/id=='2'",
"/response/docs/[0]/children/docs/[0]/cat/[0]/=='childDocument'",
"/response/docs/[0]/children/docs/[0]/title/[0]/=='" + titleVals[0] + "'",
- "/response/docs/[1]/id==4",
- "/response/docs/[1]/children/docs/[0]/id==5",
+ "/response/docs/[1]/id=='4'",
+ "/response/docs/[1]/children/docs/[0]/id=='5'",
"/response/docs/[1]/children/docs/[0]/cat/[0]/=='childDocument'",
"/response/docs/[1]/children/docs/[0]/title/[0]/=='" + titleVals[1] + "'"
};
@@ -346,12 +346,12 @@ public class TestChildDocTransformer extends SolrTestCaseJ4 {
String tests[] = new String[] {
"//*[@numFound='2']",
- "/response/result/doc[1]/int[@name='id']='1'" ,
- "/response/result/doc[1]/doc[1]/int[@name='id']='2'" ,
+ "/response/result/doc[1]/str[@name='id']='1'" ,
+ "/response/result/doc[1]/doc[1]/str[@name='id']='2'" ,
"/response/result/doc[1]/doc[1]/arr[@name='cat']/str[1]='childDocument'" ,
"/response/result/doc[1]/doc[1]/arr[@name='title']/str[1]='" + titleVals[0] + "'" ,
- "/response/result/doc[2]/int[@name='id']='4'" ,
- "/response/result/doc[2]/doc[1]/int[@name='id']='5'",
+ "/response/result/doc[2]/str[@name='id']='4'" ,
+ "/response/result/doc[2]/doc[1]/str[@name='id']='5'",
"/response/result/doc[2]/doc[1]/arr[@name='cat']/str[1]='childDocument'",
"/response/result/doc[2]/doc[1]/arr[@name='title']/str[1]='" + titleVals[1] + "'"};
@@ -372,12 +372,12 @@ public class TestChildDocTransformer extends SolrTestCaseJ4 {
String tests[] = new String[] {
"//*[@numFound='2']",
- "/response/result/doc[1]/int[@name='id']='1'" ,
- "/response/result/doc[1]/result[@name='children'][@numFound=1]/doc[1]/int[@name='id']='2'" ,
+ "/response/result/doc[1]/str[@name='id']='1'" ,
+ "/response/result/doc[1]/result[@name='children'][@numFound=1]/doc[1]/str[@name='id']='2'" ,
"/response/result/doc[1]/result[@name='children'][@numFound=1]/doc[1]/arr[@name='cat']/str[1]='childDocument'" ,
"/response/result/doc[1]/result[@name='children'][@numFound=1]/doc[1]/arr[@name='title']/str[1]='" + titleVals[0] + "'" ,
- "/response/result/doc[2]/int[@name='id']='4'" ,
- "/response/result/doc[2]/result[@name='children'][@numFound=1]/doc[1]/int[@name='id']='5'",
+ "/response/result/doc[2]/str[@name='id']='4'" ,
+ "/response/result/doc[2]/result[@name='children'][@numFound=1]/doc[1]/str[@name='id']='5'",
"/response/result/doc[2]/result[@name='children'][@numFound=1]/doc[1]/arr[@name='cat']/str[1]='childDocument'",
"/response/result/doc[2]/result[@name='children'][@numFound=1]/doc[1]/arr[@name='title']/str[1]='" + titleVals[1] + "'"};
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/rest/TestRestManager.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/rest/TestRestManager.java b/solr/core/src/test/org/apache/solr/rest/TestRestManager.java
index a39e774..31e7f28 100644
--- a/solr/core/src/test/org/apache/solr/rest/TestRestManager.java
+++ b/solr/core/src/test/org/apache/solr/rest/TestRestManager.java
@@ -277,4 +277,4 @@ public class TestRestManager extends SolrRestletTestBase {
String resourceId = RestManager.ManagedEndpoint.resolveResourceId(testRequest);
assertEquals(resourceId, "/schema/analysis/synonyms/de/Ändern");
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/schema/AbstractCurrencyFieldTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/AbstractCurrencyFieldTest.java b/solr/core/src/test/org/apache/solr/schema/AbstractCurrencyFieldTest.java
index a195794..be719db 100644
--- a/solr/core/src/test/org/apache/solr/schema/AbstractCurrencyFieldTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/AbstractCurrencyFieldTest.java
@@ -230,11 +230,11 @@ public abstract class AbstractCurrencyFieldTest extends SolrTestCaseJ4 {
assertU(adoc("id", "" + 1, field(), "10.00,USD"));
assertU(adoc("id", "" + 2, field(), "15.00,MXN"));
assertU(commit());
- assertQ(req("fl", "*,score", "q", field()+":10.00,USD"), "//int[@name='id']='1'");
+ assertQ(req("fl", "*,score", "q", field()+":10.00,USD"), "//str[@name='id']='1'");
assertQ(req("fl", "*,score", "q", field()+":9.99,USD"), "//*[@numFound='0']");
assertQ(req("fl", "*,score", "q", field()+":10.01,USD"), "//*[@numFound='0']");
- assertQ(req("fl", "*,score", "q", field()+":15.00,MXN"), "//int[@name='id']='2'");
- assertQ(req("fl", "*,score", "q", field()+":7.50,USD"), "//int[@name='id']='2'");
+ assertQ(req("fl", "*,score", "q", field()+":15.00,MXN"), "//str[@name='id']='2'");
+ assertQ(req("fl", "*,score", "q", field()+":7.50,USD"), "//str[@name='id']='2'");
assertQ(req("fl", "*,score", "q", field()+":7.49,USD"), "//*[@numFound='0']");
assertQ(req("fl", "*,score", "q", field()+":7.51,USD"), "//*[@numFound='0']");
}
@@ -293,8 +293,8 @@ public abstract class AbstractCurrencyFieldTest extends SolrTestCaseJ4 {
assertU(adoc("id", "" + 5, field(), "2.00,GBP"));
assertU(commit());
- assertQ(req("fl", "*,score", "q", "*:*", "sort", field()+" desc", "limit", "1"), "//int[@name='id']='4'");
- assertQ(req("fl", "*,score", "q", "*:*", "sort", field()+" asc", "limit", "1"), "//int[@name='id']='3'");
+ assertQ(req("fl", "*,score", "q", "*:*", "sort", field()+" desc", "limit", "1"), "//str[@name='id']='4'");
+ assertQ(req("fl", "*,score", "q", "*:*", "sort", field()+" asc", "limit", "1"), "//str[@name='id']='3'");
}
public void testFunctionUsage() throws Exception {
@@ -324,21 +324,21 @@ public abstract class AbstractCurrencyFieldTest extends SolrTestCaseJ4 {
assertQ(req("fl", "id,score,"+field(),
"q", "{!frange u=500}"+field())
,"//*[@numFound='5']"
- ,"//int[@name='id']='1'"
- ,"//int[@name='id']='2'"
- ,"//int[@name='id']='3'"
- ,"//int[@name='id']='4'"
- ,"//int[@name='id']='5'"
+ ,"//str[@name='id']='1'"
+ ,"//str[@name='id']='2'"
+ ,"//str[@name='id']='3'"
+ ,"//str[@name='id']='4'"
+ ,"//str[@name='id']='5'"
);
assertQ(req("fl", "id,score,"+field(),
"q", "{!frange l=500 u=1000}"+field())
,"//*[@numFound='6']"
- ,"//int[@name='id']='5'"
- ,"//int[@name='id']='6'"
- ,"//int[@name='id']='7'"
- ,"//int[@name='id']='8'"
- ,"//int[@name='id']='9'"
- ,"//int[@name='id']='10'"
+ ,"//str[@name='id']='5'"
+ ,"//str[@name='id']='6'"
+ ,"//str[@name='id']='7'"
+ ,"//str[@name='id']='8'"
+ ,"//str[@name='id']='9'"
+ ,"//str[@name='id']='10'"
);
// use the currency function to convert to default (USD)
@@ -356,22 +356,22 @@ public abstract class AbstractCurrencyFieldTest extends SolrTestCaseJ4 {
"f", field(),
"q", "{!frange u=5}currency($f)")
,"//*[@numFound='5']"
- ,"//int[@name='id']='1'"
- ,"//int[@name='id']='2'"
- ,"//int[@name='id']='3'"
- ,"//int[@name='id']='4'"
- ,"//int[@name='id']='5'"
+ ,"//str[@name='id']='1'"
+ ,"//str[@name='id']='2'"
+ ,"//str[@name='id']='3'"
+ ,"//str[@name='id']='4'"
+ ,"//str[@name='id']='5'"
);
assertQ(req("fl", "id,score"+field(),
"f", field(),
"q", "{!frange l=5 u=10}currency($f)")
,"//*[@numFound='6']"
- ,"//int[@name='id']='5'"
- ,"//int[@name='id']='6'"
- ,"//int[@name='id']='7'"
- ,"//int[@name='id']='8'"
- ,"//int[@name='id']='9'"
- ,"//int[@name='id']='10'"
+ ,"//str[@name='id']='5'"
+ ,"//str[@name='id']='6'"
+ ,"//str[@name='id']='7'"
+ ,"//str[@name='id']='8'"
+ ,"//str[@name='id']='9'"
+ ,"//str[@name='id']='10'"
);
// use the currency function to convert to MXN
@@ -389,22 +389,22 @@ public abstract class AbstractCurrencyFieldTest extends SolrTestCaseJ4 {
"f", field(),
"q", "{!frange u=10}currency($f,MXN)")
,"//*[@numFound='5']"
- ,"//int[@name='id']='1'"
- ,"//int[@name='id']='2'"
- ,"//int[@name='id']='3'"
- ,"//int[@name='id']='4'"
- ,"//int[@name='id']='5'"
+ ,"//str[@name='id']='1'"
+ ,"//str[@name='id']='2'"
+ ,"//str[@name='id']='3'"
+ ,"//str[@name='id']='4'"
+ ,"//str[@name='id']='5'"
);
assertQ(req("fl", "*,score,"+field(),
"f", field(),
"q", "{!frange l=10 u=20}currency($f,MXN)")
,"//*[@numFound='6']"
- ,"//int[@name='id']='5'"
- ,"//int[@name='id']='6'"
- ,"//int[@name='id']='7'"
- ,"//int[@name='id']='8'"
- ,"//int[@name='id']='9'"
- ,"//int[@name='id']='10'"
+ ,"//str[@name='id']='5'"
+ ,"//str[@name='id']='6'"
+ ,"//str[@name='id']='7'"
+ ,"//str[@name='id']='8'"
+ ,"//str[@name='id']='9'"
+ ,"//str[@name='id']='10'"
);
}
@@ -418,9 +418,9 @@ public abstract class AbstractCurrencyFieldTest extends SolrTestCaseJ4 {
assertU(adoc("id", "3", "mock_amount", "1.00,NOK"));
assertU(commit());
- assertQ(req("fl", "*,score", "q", "mock_amount:5.0,NOK"), "//*[@numFound='1']", "//int[@name='id']='1'");
- assertQ(req("fl", "*,score", "q", "mock_amount:1.2,USD"), "//*[@numFound='1']", "//int[@name='id']='2'");
- assertQ(req("fl", "*,score", "q", "mock_amount:0.2,USD"), "//*[@numFound='1']", "//int[@name='id']='3'");
+ assertQ(req("fl", "*,score", "q", "mock_amount:5.0,NOK"), "//*[@numFound='1']", "//str[@name='id']='1'");
+ assertQ(req("fl", "*,score", "q", "mock_amount:1.2,USD"), "//*[@numFound='1']", "//str[@name='id']='2'");
+ assertQ(req("fl", "*,score", "q", "mock_amount:0.2,USD"), "//*[@numFound='1']", "//str[@name='id']='3'");
assertQ(req("fl", "*,score", "q", "mock_amount:99,USD"), "//*[@numFound='0']");
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/schema/CopyFieldTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/CopyFieldTest.java b/solr/core/src/test/org/apache/solr/schema/CopyFieldTest.java
index d95f144..86a8aca 100644
--- a/solr/core/src/test/org/apache/solr/schema/CopyFieldTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/CopyFieldTest.java
@@ -134,7 +134,7 @@ public class CopyFieldTest extends SolrTestCaseJ4 {
assertQ("Make sure they got in", req
,"//*[@numFound='1']"
- ,"//result/doc[1]/int[@name='id'][.='5']"
+ ,"//result/doc[1]/str[@name='id'][.='5']"
);
args = new HashMap<>();
@@ -143,7 +143,7 @@ public class CopyFieldTest extends SolrTestCaseJ4 {
req = new LocalSolrQueryRequest( core, new MapSolrParams( args) );
assertQ("dynamic source", req
,"//*[@numFound='1']"
- ,"//result/doc[1]/int[@name='id'][.='5']"
+ ,"//result/doc[1]/str[@name='id'][.='5']"
,"//result/doc[1]/arr[@name='highlight']/str[.='this is a simple test of ']"
);
@@ -194,7 +194,7 @@ public class CopyFieldTest extends SolrTestCaseJ4 {
SolrQueryRequest req = new LocalSolrQueryRequest( core, new MapSolrParams( args) );
assertQ("sku2 copied to text", req
,"//*[@numFound='1']"
- ,"//result/doc[1]/int[@name='id'][.='5']"
+ ,"//result/doc[1]/str[@name='id'][.='5']"
);
args = new HashMap<>();
@@ -203,7 +203,7 @@ public class CopyFieldTest extends SolrTestCaseJ4 {
req = new LocalSolrQueryRequest( core, new MapSolrParams( args) );
assertQ("sku1 copied to dynamic dest *_s", req
,"//*[@numFound='1']"
- ,"//result/doc[1]/int[@name='id'][.='5']"
+ ,"//result/doc[1]/str[@name='id'][.='5']"
,"//result/doc[1]/arr[@name='sku1']/str[.='10-1839ACX-93']"
);
@@ -242,7 +242,7 @@ public class CopyFieldTest extends SolrTestCaseJ4 {
SolrQueryRequest req = new LocalSolrQueryRequest( core, new MapSolrParams( args) );
assertQ("sku2 copied to text", req
,"//*[@numFound='1']"
- ,"//result/doc[1]/int[@name='id'][.='5']"
+ ,"//result/doc[1]/str[@name='id'][.='5']"
);
}
@@ -257,7 +257,7 @@ public class CopyFieldTest extends SolrTestCaseJ4 {
for (String q : new String[] {"5", "10-1839ACX-93", "AAM46" }) {
assertQ(req("q","catchall_t:" + q)
,"//*[@numFound='1']"
- ,"//result/doc[1]/int[@name='id'][.='5']");
+ ,"//result/doc[1]/str[@name='id'][.='5']");
}
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/schema/CurrencyFieldXmlFileTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/CurrencyFieldXmlFileTest.java b/solr/core/src/test/org/apache/solr/schema/CurrencyFieldXmlFileTest.java
index f3872d0..e8bffe7 100644
--- a/solr/core/src/test/org/apache/solr/schema/CurrencyFieldXmlFileTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/CurrencyFieldXmlFileTest.java
@@ -33,8 +33,8 @@ public class CurrencyFieldXmlFileTest extends AbstractCurrencyFieldTest {
assertU(adoc("id", "" + 2, field(), "15.00,EUR"));
assertU(commit());
- assertQ(req("fl", "*,score", "q", field()+":15.00,EUR"), "//int[@name='id']='2'");
- assertQ(req("fl", "*,score", "q", field()+":7.50,USD"), "//int[@name='id']='2'");
+ assertQ(req("fl", "*,score", "q", field()+":15.00,EUR"), "//str[@name='id']='2'");
+ assertQ(req("fl", "*,score", "q", field()+":7.50,USD"), "//str[@name='id']='2'");
assertQ(req("fl", "*,score", "q", field()+":7.49,USD"), "//*[@numFound='0']");
assertQ(req("fl", "*,score", "q", field()+":7.51,USD"), "//*[@numFound='0']");
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/schema/DateRangeFieldTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/DateRangeFieldTest.java b/solr/core/src/test/org/apache/solr/schema/DateRangeFieldTest.java
index e76f821..edd25b0 100644
--- a/solr/core/src/test/org/apache/solr/schema/DateRangeFieldTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/DateRangeFieldTest.java
@@ -119,7 +119,7 @@ public class DateRangeFieldTest extends SolrTestCaseJ4 {
if (docIds != null && docIds.length > 0) {
int i = 1;
for (int docId : docIds) {
- tests[i++] = "//result/doc/int[@name='id'][.='" + docId + "']";
+ tests[i++] = "//result/doc/str[@name='id'][.='" + docId + "']";
}
}
return tests;
[7/7] lucene-solr:master: SOLR-10834: Fixed tests and test configs to
stop using numeric uniqueKey fields
Posted by ho...@apache.org.
SOLR-10834: Fixed tests and test configs to stop using numeric uniqueKey fields
Squashed commit of the following (from jira/SOLR-10834 branch):
commit 8f1043840f38533864b2c713daf066b6c3509147
commit 7b95773bd524cd86aaccc56cc33a003a9aff2004
commit b26bf9d60e2b94e0cdc365d1e2c0a37c33e24198
commit df11992106f8c338503b6e3e9a27ba6ddcfa2953
commit fcf98132410ed247e451bb449a8337a09bd857ce
commit 05e8e226de359a6d7bc99219eaec161a32268f17
commit 6dce948294351560948a32b64679b1879657af79
commit 53f97845caaa8adc25862e4017b94f3091063552
commit d5bfb5f57016341fbeaf73b5e4c9ed10dc3816d0
commit d333f7b1eee10893a81532ac2f5a77a46716d90b
commit 15983ceec4702dc8c7562250d59cd8231c67d46a
commit e18e2e771fb4678cb911a62bbc7c74a873466bf0
commit 134e210bdf601600a9d90dd0720a35cb122896b0
commit ec03260265f8a3bbdfd7f9b015de16a4950a05eb
commit 5d430057ed335801a524e1e7666061075ab6d859
commit 1625df3d21b8fa27815d7a7b89a55fc338eeb23b
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/f1e2be64
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/f1e2be64
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/f1e2be64
Branch: refs/heads/master
Commit: f1e2be64519a9ec815785b59e6187c3e99f7d998
Parents: abc393d
Author: Chris Hostetter <ho...@apache.org>
Authored: Thu Jun 15 09:14:24 2017 -0700
Committer: Chris Hostetter <ho...@apache.org>
Committed: Thu Jun 15 09:14:24 2017 -0700
----------------------------------------------------------------------
solr/CHANGES.txt | 2 +
.../collection1/conf/schema-icucollate-dv.xml | 4 +-
.../solr/collection1/conf/schema-icucollate.xml | 4 +-
.../conf/schema-icucollateoptions.xml | 4 +-
.../solr/schema/TestICUCollationField.java | 28 +-
.../schema/TestICUCollationFieldDocValues.java | 28 +-
.../schema/TestICUCollationFieldOptions.java | 26 +-
.../solr/analysisconfs/analysis-err-schema.xml | 4 +-
.../collection1/conf/schema-binaryfield.xml | 2 +-
.../conf/schema-blockjoinfacetcomponent.xml | 4 +-
.../solr/collection1/conf/schema-bm25.xml | 4 +-
.../collection1/conf/schema-charfilters.xml | 4 +-
.../solr/collection1/conf/schema-collate-dv.xml | 4 +-
.../solr/collection1/conf/schema-collate.xml | 4 +-
.../collection1/conf/schema-copyfield-test.xml | 2 +-
.../collection1/conf/schema-custom-field.xml | 6 +-
.../collection1/conf/schema-customfield.xml | 3 +-
.../solr/collection1/conf/schema-dfi.xml | 4 +-
.../solr/collection1/conf/schema-dfr.xml | 4 +-
.../conf/schema-distributed-missing-sort.xml | 6 +-
.../solr/collection1/conf/schema-docValues.xml | 5 +-
.../conf/schema-field-sort-values.xml | 2 +-
.../solr/collection1/conf/schema-hash.xml | 2 +-
.../solr/collection1/conf/schema-ib.xml | 4 +-
.../collection1/conf/schema-lmdirichlet.xml | 4 +-
.../collection1/conf/schema-lmjelinekmercer.xml | 4 +-
.../conf/schema-not-required-unique-key.xml | 2 +-
.../collection1/conf/schema-phrasesuggest.xml | 4 +-
.../conf/schema-postingshighlight.xml | 4 +-
.../collection1/conf/schema-replication1.xml | 2 +-
.../collection1/conf/schema-replication2.xml | 2 +-
.../collection1/conf/schema-required-fields.xml | 2 +-
.../solr/collection1/conf/schema-reversed.xml | 2 +-
.../conf/schema-sim-default-override.xml | 4 +-
.../solr/collection1/conf/schema-sim.xml | 4 +-
.../collection1/conf/schema-simpleqpplugin.xml | 4 +-
.../solr/collection1/conf/schema-sorts.xml | 2 +-
.../solr/collection1/conf/schema-sql.xml | 2 +-
.../solr/collection1/conf/schema-sweetspot.xml | 4 +-
.../conf/schema-synonym-tokenizer.xml | 6 +-
.../solr/collection1/conf/schema-tfidf.xml | 4 +-
.../collection1/conf/schema-tokenizer-test.xml | 5 +-
.../solr/collection1/conf/schema-trie.xml | 2 +-
.../conf/schema-unifiedhighlight.xml | 4 +-
.../test-files/solr/collection1/conf/schema.xml | 5 +-
.../solr/collection1/conf/schema11.xml | 6 +-
.../solr/configsets/configset-2/conf/schema.xml | 4 +-
.../test-files/solr/crazy-path-to-schema.xml | 4 +-
.../org/apache/solr/BasicFunctionalityTest.java | 36 +--
.../test/org/apache/solr/CursorPagingTest.java | 58 ++--
.../apache/solr/DisMaxRequestHandlerTest.java | 22 +-
.../src/test/org/apache/solr/SampleTest.java | 4 +-
.../apache/solr/TestDistributedGrouping.java | 18 +-
.../apache/solr/TestDistributedMissingSort.java | 60 ++--
.../org/apache/solr/TestDistributedSearch.java | 20 +-
.../org/apache/solr/TestTolerantSearch.java | 4 +-
.../PathHierarchyTokenizerFactoryTest.java | 32 +--
.../apache/solr/analysis/TestCharFilters.java | 8 +-
.../solr/cloud/BasicDistributedZk2Test.java | 8 +-
.../solr/cloud/BasicDistributedZkTest.java | 10 +-
.../test/org/apache/solr/cloud/BasicZkTest.java | 4 +-
.../solr/cloud/DistribCursorPagingTest.java | 10 +-
.../cloud/DistribJoinFromCollectionTest.java | 8 +-
.../FullThrottleStoppableIndexingThread.java | 2 +-
.../apache/solr/cloud/HttpPartitionTest.java | 2 +-
.../cloud/SegmentTerminateEarlyTestState.java | 30 +-
.../autoscaling/AutoScalingHandlerTest.java | 2 +-
.../test/org/apache/solr/core/HelloStream.java | 2 +-
.../test/org/apache/solr/core/MockInfoBean.java | 2 +-
.../test/org/apache/solr/core/SOLR749Test.java | 12 +-
.../apache/solr/core/TestJmxIntegration.java | 2 +-
.../core/snapshots/TestSolrCloudSnapshots.java | 2 +-
.../core/snapshots/TestSolrCoreSnapshots.java | 2 +-
.../solr/handler/MoreLikeThisHandlerTest.java | 20 +-
.../handler/StandardRequestHandlerTest.java | 24 +-
.../org/apache/solr/handler/TestSQLHandler.java | 32 +--
.../handler/XsltUpdateRequestHandlerTest.java | 2 +-
.../solr/handler/admin/MBeansHandlerTest.java | 2 +-
.../admin/PropertiesRequestHandlerTest.java | 2 +-
.../DistributedExpandComponentTest.java | 40 +--
.../component/DistributedMLTComponentTest.java | 12 +-
...DistributedQueryComponentCustomSortTest.java | 38 +--
.../DistributedQueryElevationComponentTest.java | 4 +-
.../component/QueryElevationComponentTest.java | 90 +++---
.../handler/component/StatsComponentTest.java | 20 +-
...estDistributedStatsComponentCardinality.java | 4 +-
.../handler/component/TestExpandComponent.java | 100 +++----
.../apache/solr/request/SimpleFacetsTest.java | 144 +++++-----
.../org/apache/solr/request/TestFaceting.java | 14 +-
.../transform/TestChildDocTransformer.java | 120 ++++----
.../org/apache/solr/rest/TestRestManager.java | 2 +-
.../solr/schema/AbstractCurrencyFieldTest.java | 82 +++---
.../org/apache/solr/schema/CopyFieldTest.java | 12 +-
.../solr/schema/CurrencyFieldXmlFileTest.java | 4 +-
.../apache/solr/schema/DateRangeFieldTest.java | 2 +-
.../org/apache/solr/schema/DocValuesTest.java | 256 ++++++++---------
.../schema/IndexSchemaRuntimeFieldTest.java | 4 +-
.../org/apache/solr/schema/IndexSchemaTest.java | 6 +-
.../org/apache/solr/schema/TestBinaryField.java | 6 +-
.../apache/solr/schema/TestCollationField.java | 32 +--
.../schema/TestCollationFieldDocValues.java | 32 +--
.../solr/schema/TestHalfAndHalfDocValues.java | 6 +-
.../apache/solr/schema/TestOmitPositions.java | 4 +-
.../apache/solr/search/SpatialFilterTest.java | 2 +-
.../solr/search/TestCollapseQParserPlugin.java | 280 +++++++++----------
.../TestComplexPhraseLeadingWildcard.java | 2 +-
.../org/apache/solr/search/TestCustomSort.java | 20 +-
.../apache/solr/search/TestFieldSortValues.java | 10 +-
.../solr/search/TestFoldingMultitermQuery.java | 2 +-
.../search/TestGraphTermsQParserPlugin.java | 34 +--
.../solr/search/TestHashQParserPlugin.java | 14 +-
.../org/apache/solr/search/TestQueryTypes.java | 22 +-
.../org/apache/solr/search/TestRangeQuery.java | 4 +-
.../solr/search/TestReRankQParserPlugin.java | 208 +++++++-------
.../test/org/apache/solr/search/TestReload.java | 2 +-
.../org/apache/solr/search/TestSearchPerf.java | 2 +-
.../apache/solr/search/TestSolrQueryParser.java | 2 +-
.../org/apache/solr/search/facet/DebugAgg.java | 2 +-
.../search/function/SortByFunctionTest.java | 68 ++---
.../solr/search/function/TestFunctionQuery.java | 43 +--
.../function/TestMinMaxOnMultiValuedField.java | 8 +-
.../solr/search/mlt/SimpleMLTQParserTest.java | 86 +++---
.../solr/search/stats/TestDistribIDF.java | 14 +-
.../solr/security/MockAuthorizationPlugin.java | 2 +-
.../apache/solr/servlet/NoCacheHeaderTest.java | 2 +-
.../solr/spelling/suggest/SuggesterTest.java | 19 +-
.../suggest/TestAnalyzeInfixSuggestions.java | 2 +-
.../suggest/TestFreeTextSuggestions.java | 2 +-
.../update/processor/AtomicUpdatesTest.java | 36 +--
.../ClassificationUpdateProcessorTest.java | 2 +-
.../org/apache/solr/util/PrimUtilsTest.java | 2 +-
.../org/apache/solr/util/UtilsToolTest.java | 2 +-
.../org/apache/solr/util/hll/BitVectorTest.java | 2 +-
.../apache/solr/util/hll/ExplicitHLLTest.java | 2 +-
.../org/apache/solr/util/hll/FullHLLTest.java | 2 +-
.../collection1/conf/schema-replication1.xml | 2 +-
.../solrj/solr/collection1/conf/schema-sql.xml | 2 +-
.../solrj/solr/collection1/conf/schema.xml | 2 +-
.../solrj/solr/crazy-path-to-schema.xml | 4 +-
139 files changed, 1326 insertions(+), 1306 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 88821bb..8db8752 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -424,6 +424,8 @@ Other Changes
* SOLR-10851: SolrClients should clarify expectations for solrServerUrl parameter (Jason Gerlowski
via Tomás Fernández Löbbe)
+* SOLR-10834: Fixed tests and test configs to stop using numeric uniqueKey fields (hossman)
+
================== 6.6.1 ==================
Bug Fixes
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate-dv.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate-dv.xml b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate-dv.xml
index 1e2029d..63f7330 100644
--- a/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate-dv.xml
+++ b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate-dv.xml
@@ -20,7 +20,7 @@
<schema name="test" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- basic text field -->
<fieldType name="text" class="solr.TextField">
@@ -37,7 +37,7 @@
<fieldType name="sort_da_t" class="solr.ICUCollationField" locale="da" strength="primary"/>
<fieldType name="sort_custom_t" class="solr.ICUCollationField" custom="customrules.dat" strength="primary"/>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text" indexed="true" stored="false"/>
<field name="sort_ar" type="sort_ar_t" indexed="false" stored="false" multiValued="false" docValues="true"/>
<field name="sort_de" type="sort_de_t" indexed="false" stored="false" multiValued="false" docValues="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate.xml b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate.xml
index 1d121f2..9698013 100644
--- a/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate.xml
+++ b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollate.xml
@@ -20,7 +20,7 @@
<schema name="test" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- basic text field -->
<fieldType name="text" class="solr.TextField">
@@ -37,7 +37,7 @@
<fieldType name="sort_da_t" class="solr.ICUCollationField" locale="da" strength="primary"/>
<fieldType name="sort_custom_t" class="solr.ICUCollationField" custom="customrules.dat" strength="primary"/>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text" indexed="true" stored="false"/>
<field name="sort_ar" type="sort_ar_t" indexed="true" stored="false" multiValued="false"/>
<field name="sort_de" type="sort_de_t" indexed="true" stored="false" multiValued="false"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollateoptions.xml
----------------------------------------------------------------------
diff --git a/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollateoptions.xml b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollateoptions.xml
index cc8e340..59b8d25 100644
--- a/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollateoptions.xml
+++ b/solr/contrib/analysis-extras/src/test-files/analysis-extras/solr/collection1/conf/schema-icucollateoptions.xml
@@ -20,7 +20,7 @@
<schema name="test" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- basic text field -->
<fieldType name="text" class="solr.TextField">
@@ -47,7 +47,7 @@
locale="en" strength="tertiary" caseFirst="upper"/>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text" indexed="true" stored="false"/>
<field name="sort_ignore_punctuation" type="sort_ignore_punctuation_t" indexed="true" stored="false"
multiValued="false"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java
----------------------------------------------------------------------
diff --git a/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java b/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java
index 4cff7fa..f164080 100644
--- a/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java
+++ b/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationField.java
@@ -108,8 +108,8 @@ public class TestICUCollationField extends SolrTestCaseJ4 {
assertQ("Collated TQ: ",
req("fl", "id", "q", "sort_de:tone", "sort", "id asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=4]",
- "//result/doc[2]/int[@name='id'][.=7]"
+ "//result/doc[1]/str[@name='id'][.=4]",
+ "//result/doc[2]/str[@name='id'][.=7]"
);
}
@@ -122,8 +122,8 @@ public class TestICUCollationField extends SolrTestCaseJ4 {
assertQ("Collated RangeQ: ",
req("fl", "id", "q", "sort_de:[tone TO tp]", "sort", "id asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=4]",
- "//result/doc[2]/int[@name='id'][.=7]"
+ "//result/doc[1]/str[@name='id'][.=4]",
+ "//result/doc[2]/str[@name='id'][.=7]"
);
}
@@ -134,8 +134,8 @@ public class TestICUCollationField extends SolrTestCaseJ4 {
assertQ("Collated Sort: ",
req("fl", "id", "q", "sort_da:[tz TO töz]", "sort", "sort_da asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=11]",
- "//result/doc[2]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=11]",
+ "//result/doc[2]/str[@name='id'][.=4]"
);
}
@@ -147,8 +147,8 @@ public class TestICUCollationField extends SolrTestCaseJ4 {
assertQ("Collated Sort: ",
req("fl", "id", "q", "sort_ar:[\u0698 TO \u0633\u0633]", "sort", "sort_ar asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=12]",
- "//result/doc[2]/int[@name='id'][.=1]"
+ "//result/doc[1]/str[@name='id'][.=12]",
+ "//result/doc[2]/str[@name='id'][.=1]"
);
}
@@ -171,9 +171,9 @@ public class TestICUCollationField extends SolrTestCaseJ4 {
assertQ("Collated TQ: ",
req("fl", "id", "q", "sort_tr_canon:\"I Will Use Turkish Casıng\"", "sort", "id asc" ),
"//*[@numFound='3']",
- "//result/doc[1]/int[@name='id'][.=2]",
- "//result/doc[2]/int[@name='id'][.=3]",
- "//result/doc[3]/int[@name='id'][.=5]"
+ "//result/doc[1]/str[@name='id'][.=2]",
+ "//result/doc[2]/str[@name='id'][.=3]",
+ "//result/doc[3]/str[@name='id'][.=5]"
);
}
@@ -183,10 +183,10 @@ public class TestICUCollationField extends SolrTestCaseJ4 {
*/
public void testCustomCollation() {
assertQ("Collated TQ: ",
- req("fl", "id", "q", "sort_custom:toene", "sort", "id asc" ),
+ req("fl", "id", "q", "sort_custom:toene"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=4]",
- "//result/doc[2]/int[@name='id'][.=10]"
+ "//result/doc/str[@name='id'][.=4]",
+ "//result/doc/str[@name='id'][.=10]"
);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldDocValues.java
----------------------------------------------------------------------
diff --git a/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldDocValues.java b/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldDocValues.java
index bdddc98..57b403a 100644
--- a/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldDocValues.java
+++ b/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldDocValues.java
@@ -96,8 +96,8 @@ public class TestICUCollationFieldDocValues extends SolrTestCaseJ4 {
assertQ("Collated TQ: ",
req("fl", "id", "q", "sort_de:tone", "sort", "id asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=4]",
- "//result/doc[2]/int[@name='id'][.=7]"
+ "//result/doc[1]/str[@name='id'][.=4]",
+ "//result/doc[2]/str[@name='id'][.=7]"
);
}
@@ -110,8 +110,8 @@ public class TestICUCollationFieldDocValues extends SolrTestCaseJ4 {
assertQ("Collated RangeQ: ",
req("fl", "id", "q", "sort_de:[tone TO tp]", "sort", "id asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=4]",
- "//result/doc[2]/int[@name='id'][.=7]"
+ "//result/doc[1]/str[@name='id'][.=4]",
+ "//result/doc[2]/str[@name='id'][.=7]"
);
}
@@ -122,8 +122,8 @@ public class TestICUCollationFieldDocValues extends SolrTestCaseJ4 {
assertQ("Collated Sort: ",
req("fl", "id", "q", "sort_da:[tz TO töz]", "sort", "sort_da asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=11]",
- "//result/doc[2]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=11]",
+ "//result/doc[2]/str[@name='id'][.=4]"
);
}
@@ -135,8 +135,8 @@ public class TestICUCollationFieldDocValues extends SolrTestCaseJ4 {
assertQ("Collated Sort: ",
req("fl", "id", "q", "sort_ar:[\u0698 TO \u0633\u0633]", "sort", "sort_ar asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=12]",
- "//result/doc[2]/int[@name='id'][.=1]"
+ "//result/doc[1]/str[@name='id'][.=12]",
+ "//result/doc[2]/str[@name='id'][.=1]"
);
}
@@ -159,9 +159,9 @@ public class TestICUCollationFieldDocValues extends SolrTestCaseJ4 {
assertQ("Collated TQ: ",
req("fl", "id", "q", "sort_tr_canon:\"I Will Use Turkish Casıng\"", "sort", "id asc" ),
"//*[@numFound='3']",
- "//result/doc[1]/int[@name='id'][.=2]",
- "//result/doc[2]/int[@name='id'][.=3]",
- "//result/doc[3]/int[@name='id'][.=5]"
+ "//result/doc[1]/str[@name='id'][.=2]",
+ "//result/doc[2]/str[@name='id'][.=3]",
+ "//result/doc[3]/str[@name='id'][.=5]"
);
}
@@ -171,10 +171,10 @@ public class TestICUCollationFieldDocValues extends SolrTestCaseJ4 {
*/
public void testCustomCollation() {
assertQ("Collated TQ: ",
- req("fl", "id", "q", "sort_custom:toene", "sort", "id asc" ),
+ req("fl", "id", "q", "sort_custom:toene"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=4]",
- "//result/doc[2]/int[@name='id'][.=10]"
+ "//result/doc/str[@name='id'][.=4]",
+ "//result/doc/str[@name='id'][.=10]"
);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java
----------------------------------------------------------------------
diff --git a/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java b/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java
index 7a5dca7..0b198b7 100644
--- a/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java
+++ b/solr/contrib/analysis-extras/src/test/org/apache/solr/schema/TestICUCollationFieldOptions.java
@@ -52,9 +52,9 @@ public class TestICUCollationFieldOptions extends SolrTestCaseJ4 {
assertQ("Collated TQ: ",
req("fl", "id", "q", "sort_ignore_punctuation:foobar", "sort", "id asc" ),
"//*[@numFound='3']",
- "//result/doc[1]/int[@name='id'][.=1]",
- "//result/doc[2]/int[@name='id'][.=2]",
- "//result/doc[3]/int[@name='id'][.=3]"
+ "//result/doc[1]/str[@name='id'][.=1]",
+ "//result/doc[2]/str[@name='id'][.=2]",
+ "//result/doc[3]/str[@name='id'][.=3]"
);
}
@@ -66,8 +66,8 @@ public class TestICUCollationFieldOptions extends SolrTestCaseJ4 {
assertQ("Collated TQ: ",
req("fl", "id", "q", "sort_ignore_space:\"foo bar\"", "sort", "id asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=2]",
- "//result/doc[2]/int[@name='id'][.=3]"
+ "//result/doc[1]/str[@name='id'][.=2]",
+ "//result/doc[2]/str[@name='id'][.=3]"
);
}
@@ -79,8 +79,8 @@ public class TestICUCollationFieldOptions extends SolrTestCaseJ4 {
assertQ("Collated sort: ",
req("fl", "id", "q", "id:[4 TO 5]", "sort", "sort_numerics asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=5]",
- "//result/doc[2]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=5]",
+ "//result/doc[2]/str[@name='id'][.=4]"
);
}
@@ -92,15 +92,15 @@ public class TestICUCollationFieldOptions extends SolrTestCaseJ4 {
assertQ("Collated TQ: ",
req("fl", "id", "q", "sort_ignore_accents:resume", "sort", "id asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=6]",
- "//result/doc[2]/int[@name='id'][.=9]"
+ "//result/doc[1]/str[@name='id'][.=6]",
+ "//result/doc[2]/str[@name='id'][.=9]"
);
assertQ("Collated TQ: ",
req("fl", "id", "q", "sort_ignore_accents:Resume", "sort", "id asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=7]",
- "//result/doc[2]/int[@name='id'][.=8]"
+ "//result/doc[1]/str[@name='id'][.=7]",
+ "//result/doc[2]/str[@name='id'][.=8]"
);
}
@@ -112,8 +112,8 @@ public class TestICUCollationFieldOptions extends SolrTestCaseJ4 {
assertQ("Collated sort: ",
req("fl", "id", "q", "id:6 OR id:8", "sort", "sort_uppercase_first asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=8]",
- "//result/doc[2]/int[@name='id'][.=6]"
+ "//result/doc[1]/str[@name='id'][.=8]",
+ "//result/doc[2]/str[@name='id'][.=6]"
);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/analysisconfs/analysis-err-schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/analysisconfs/analysis-err-schema.xml b/solr/core/src/test-files/solr/analysisconfs/analysis-err-schema.xml
index 168df6b..eedf4b7 100644
--- a/solr/core/src/test-files/solr/analysisconfs/analysis-err-schema.xml
+++ b/solr/core/src/test-files/solr/analysisconfs/analysis-err-schema.xml
@@ -22,7 +22,7 @@
<schema name="test" version="1.6">
<fieldType name="long" class="solr.TrieLongField" stored="true" indexed="true"/>
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0"/>
+ <fieldType name="string" class="solr.StrField" />
<fieldType name="text" class="solr.TextField">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
@@ -32,7 +32,7 @@
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false"/>
<field name="text" type="text" indexed="true" stored="true"/>
<field name="_version_" type="long"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-binaryfield.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-binaryfield.xml b/solr/core/src/test-files/solr/collection1/conf/schema-binaryfield.xml
index eb33896..26a428d 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-binaryfield.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-binaryfield.xml
@@ -67,7 +67,7 @@
<fieldType name="date" class="solr.TrieDateField" sortMissingLast="true"/>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="true"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/>
<field name="data" type="binary" stored="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-blockjoinfacetcomponent.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-blockjoinfacetcomponent.xml b/solr/core/src/test-files/solr/collection1/conf/schema-blockjoinfacetcomponent.xml
index e262b73..dc23b84 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-blockjoinfacetcomponent.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-blockjoinfacetcomponent.xml
@@ -22,9 +22,9 @@
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
<fieldtype name="string" class="solr.StrField" sortMissingLast="true"/>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>
- <field name="_root_" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="_root_" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="name" type="string" indexed="true" stored="true"/>
<dynamicField name="*_s" type="string" indexed="true" stored="true" multiValued="false"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-bm25.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-bm25.xml b/solr/core/src/test-files/solr/collection1/conf/schema-bm25.xml
index 13924b7..7c31f15 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-bm25.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-bm25.xml
@@ -19,7 +19,7 @@
<!-- Test schema file for BM25SimilarityFactory -->
<schema name="test" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- default parameters -->
<fieldType name="text" class="solr.TextField">
@@ -37,7 +37,7 @@
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text" indexed="true" stored="false"/>
<field name="text_params" type="text_params" indexed="true" stored="false"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-charfilters.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-charfilters.xml b/solr/core/src/test-files/solr/collection1/conf/schema-charfilters.xml
index 11e2aa7..1adb7aa 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-charfilters.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-charfilters.xml
@@ -16,7 +16,7 @@
-->
<schema name="test" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="4" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- charfilter only at query-time -->
<fieldType name="text" class="solr.TextField">
<analyzer type="index">
@@ -38,7 +38,7 @@
</analyzer>
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="true"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/>
<field name="content" type="text" indexed="true" stored="true"/>
<field name="content2" type="text2" indexed="true" stored="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-collate-dv.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-collate-dv.xml b/solr/core/src/test-files/solr/collection1/conf/schema-collate-dv.xml
index af74654..0a2953d 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-collate-dv.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-collate-dv.xml
@@ -19,7 +19,7 @@
<!-- Test schema file for CollationField -->
<schema name="test" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- basic text field -->
<fieldType name="text" class="solr.TextField">
@@ -37,7 +37,7 @@
<fieldType name="sort_da_t" class="solr.CollationField" language="da" strength="primary"/>
<fieldType name="sort_custom_t" class="solr.CollationField" custom="customrules.dat" strength="primary"/>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text" indexed="true" stored="false"/>
<field name="sort_ar" type="sort_ar_t" indexed="false" stored="false" multiValued="false" docValues="true"/>
<field name="sort_de" type="sort_de_t" indexed="false" stored="false" multiValued="false" docValues="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-collate.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-collate.xml b/solr/core/src/test-files/solr/collection1/conf/schema-collate.xml
index d5c4d69..bfe65b1 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-collate.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-collate.xml
@@ -19,7 +19,7 @@
<!-- Test schema file for CollationField -->
<schema name="test" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- basic text field -->
<fieldType name="text" class="solr.TextField">
@@ -37,7 +37,7 @@
<fieldType name="sort_da_t" class="solr.CollationField" language="da" strength="primary"/>
<fieldType name="sort_custom_t" class="solr.CollationField" custom="customrules.dat" strength="primary"/>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text" indexed="true" stored="false"/>
<field name="sort_ar" type="sort_ar_t" indexed="true" stored="false" multiValued="false"/>
<field name="sort_de" type="sort_de_t" indexed="true" stored="false" multiValued="false"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml b/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml
index c16bf55..96adf2d 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-copyfield-test.xml
@@ -333,7 +333,7 @@
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="name" type="nametext" indexed="true" stored="true"/>
<field name="text" type="text" indexed="true" stored="false"/>
<field name="subject" type="text" indexed="true" stored="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-custom-field.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-custom-field.xml b/solr/core/src/test-files/solr/collection1/conf/schema-custom-field.xml
index 58c40d5..23999e4 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-custom-field.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-custom-field.xml
@@ -26,7 +26,7 @@
</analyzer>
</fieldType>
<fieldType class="org.apache.solr.schema.SortableBinaryField" name="sortable_binary"/>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>
<field name="signatureField" type="string" indexed="true" stored="false"/>
<field name="text" type="text" indexed="true" stored="false"/>
@@ -34,6 +34,10 @@
stored="true" multiValued="false" docValues="true" required="true"/>
<dynamicField name="*_sS" type="string" indexed="false" stored="true"/>
+ <!-- int varient of id, adding this here simplifies some indexing to do numeric sorting -->
+ <field name="id_i" type="int" indexed="true" stored="true" multiValued="false" />
+ <copyField source="id" dest="id_i" />
+
<!-- catchall wildcard to help ensure we aren't breaking function sorting -->
<dynamicField name="*" type="string" indexed="true" stored="true"/>
<uniqueKey>id</uniqueKey>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-customfield.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-customfield.xml b/solr/core/src/test-files/solr/collection1/conf/schema-customfield.xml
index 4d0cbfd..83948b7 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-customfield.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-customfield.xml
@@ -32,6 +32,7 @@
attribute and any other attributes determine the real type and
behavior of the fieldType.
-->
+ <fieldType name="string" class="solr.StrField"/>
<!--
Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
@@ -65,7 +66,7 @@
<fieldType name="customtrieintfield" class="org.apache.solr.schema.TrieIntPrefixActsAsRangeQueryFieldType"/>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="true"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/>
<field name="intfield" type="int" indexed="true" stored="true"/>
<field name="swap_foo_bar_in_prefix_query" type="customfield" indexed="true" stored="true" multiValued="true"/>
<field name="int_prefix_as_range" type="customtrieintfield" indexed="true" stored="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-dfi.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-dfi.xml b/solr/core/src/test-files/solr/collection1/conf/schema-dfi.xml
index c3dc509..184f142 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-dfi.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-dfi.xml
@@ -19,7 +19,7 @@
<!-- Test schema file for DFISimilarityFactory -->
<schema name="dfi" version="1.5">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- default parameters -->
<fieldType name="text" class="solr.TextField">
@@ -39,7 +39,7 @@
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text" indexed="true" stored="false"/>
<field name="text_params" type="text_params" indexed="true" stored="false"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-dfr.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-dfr.xml b/solr/core/src/test-files/solr/collection1/conf/schema-dfr.xml
index 4b27707..3083510 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-dfr.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-dfr.xml
@@ -19,7 +19,7 @@
<!-- Test schema file for DFRSimilarityFactory -->
<schema name="test" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- default parameters -->
<fieldType name="text" class="solr.TextField">
@@ -54,7 +54,7 @@
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text" indexed="true" stored="false"/>
<field name="text_params" type="text_params" indexed="true" stored="false"/>
<field name="text_paramc" type="text_paramc" indexed="true" stored="false"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-distributed-missing-sort.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-distributed-missing-sort.xml b/solr/core/src/test-files/solr/collection1/conf/schema-distributed-missing-sort.xml
index 822d2be..13daf46 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-distributed-missing-sort.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-distributed-missing-sort.xml
@@ -45,7 +45,7 @@
<fieldType name="string_ml" class="solr.StrField" sortMissingLast="true"/>
<fieldType name="string_mf" class="solr.StrField" sortMissingFirst="true"/>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string_ml" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>
<field name="signatureField" type="string_ml" indexed="true" stored="false"/>
@@ -77,6 +77,10 @@
<dynamicField name="*_mfacet" type="string_ml" indexed="true" stored="false" multiValued="true"/>
<dynamicField name="*_sS" type="string_ml" indexed="false" stored="true"/>
+
+ <!-- int varient of id, adding this here simplifies some indexing and test assertions -->
+ <field name="id_i" type="int" indexed="true" stored="true" multiValued="false" />
+ <copyField source="id" dest="id_i" />
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-docValues.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-docValues.xml b/solr/core/src/test-files/solr/collection1/conf/schema-docValues.xml
index 9e4286d..0216791 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-docValues.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-docValues.xml
@@ -53,7 +53,10 @@
<fieldType name="uuid" class="solr.UUIDField"/>
- <field name="id" type="int" required="true"/>
+ <field name="id" type="string" required="true"/>
+ <!-- int varient of id, adding this here simplifies some indexing to do numeric sorting -->
+ <field name="id_i" type="int" indexed="true" stored="true" multiValued="false" />
+ <copyField source="id" dest="id_i" />
<field name="floatdv" type="float" indexed="false" stored="false" docValues="true" default="1"/>
<field name="intdv" type="int" indexed="false" stored="false" docValues="true" default="2"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-field-sort-values.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-field-sort-values.xml b/solr/core/src/test-files/solr/collection1/conf/schema-field-sort-values.xml
index 0cd22b0..94485f6 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-field-sort-values.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-field-sort-values.xml
@@ -26,7 +26,7 @@
</analyzer>
</fieldType>
<fieldType class="org.apache.solr.schema.WrappedIntField" name="wrapped_int"/>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>
<field name="text" type="text" indexed="true" stored="false"/>
<field name="payload" type="wrapped_int" indexed="false"
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-hash.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-hash.xml b/solr/core/src/test-files/solr/collection1/conf/schema-hash.xml
index 07ef7b1..5389614 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-hash.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-hash.xml
@@ -436,7 +436,7 @@
-->
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="signatureField" type="string" indexed="true" stored="false"/>
<field name="uuid" type="uuid" stored="true"/>
<field name="name" type="nametext" indexed="true" stored="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-ib.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-ib.xml b/solr/core/src/test-files/solr/collection1/conf/schema-ib.xml
index e477e25..7e66bb5 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-ib.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-ib.xml
@@ -19,7 +19,7 @@
<!-- Test schema file for IBSimilarityFactory -->
<schema name="test" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- default parameters -->
<fieldType name="text" class="solr.TextField">
@@ -42,7 +42,7 @@
</similarity>
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text" indexed="true" stored="false"/>
<field name="text_params" type="text_params" indexed="true" stored="false"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-lmdirichlet.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-lmdirichlet.xml b/solr/core/src/test-files/solr/collection1/conf/schema-lmdirichlet.xml
index a51685e..3c25098 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-lmdirichlet.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-lmdirichlet.xml
@@ -19,7 +19,7 @@
<!-- Test schema file for LMDirichletSimilarityFactory -->
<schema name="test" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- default parameters -->
<fieldType name="text" class="solr.TextField">
@@ -35,7 +35,7 @@
</similarity>
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text" indexed="true" stored="false"/>
<field name="text_params" type="text_params" indexed="true" stored="false"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-lmjelinekmercer.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-lmjelinekmercer.xml b/solr/core/src/test-files/solr/collection1/conf/schema-lmjelinekmercer.xml
index 7c0fcd3..a90fd65 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-lmjelinekmercer.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-lmjelinekmercer.xml
@@ -19,7 +19,7 @@
<!-- Test schema file for LMJelinekMercerSimilarityFactory -->
<schema name="test" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- default parameters -->
<fieldType name="text" class="solr.TextField">
@@ -35,7 +35,7 @@
</similarity>
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text" indexed="true" stored="false"/>
<field name="text_params" type="text_params" indexed="true" stored="false"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-not-required-unique-key.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-not-required-unique-key.xml b/solr/core/src/test-files/solr/collection1/conf/schema-not-required-unique-key.xml
index e2bbef3..d38952f 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-not-required-unique-key.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-not-required-unique-key.xml
@@ -31,7 +31,7 @@
</analyzer>
</fieldType>
- <field name="id" type="int" multiValued="false" indexed="true" stored="true" required="false"/>
+ <field name="id" type="string" multiValued="false" indexed="true" stored="true" required="false"/>
<field name="subject" type="text" indexed="true" stored="true"/>
<field name="signatureField" type="string" indexed="true" stored="false"/>
<dynamicField name="*_sS" type="string" indexed="false" stored="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-phrasesuggest.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-phrasesuggest.xml b/solr/core/src/test-files/solr/collection1/conf/schema-phrasesuggest.xml
index 0bc78d6..7059cd3 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-phrasesuggest.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-phrasesuggest.xml
@@ -19,7 +19,7 @@
<!-- Test schema file for phrase suggestions -->
<schema name="test" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- basic text field -->
<fieldType name="text" class="solr.TextField">
@@ -48,7 +48,7 @@
</analyzer>
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text" indexed="true" stored="false"/>
<field name="stext" type="text" indexed="true" stored="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-postingshighlight.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-postingshighlight.xml b/solr/core/src/test-files/solr/collection1/conf/schema-postingshighlight.xml
index 18aa51a..e68ba0f 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-postingshighlight.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-postingshighlight.xml
@@ -19,7 +19,7 @@
<!-- Test schema file for PostingsHighlighter -->
<schema name="postingshighlight" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- basic text field: no offsets! -->
<fieldType name="text" class="solr.TextField">
@@ -37,7 +37,7 @@
</analyzer>
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text_offsets" indexed="true" stored="true"/>
<field name="text2" type="text" indexed="true" stored="true"/>
<field name="text3" type="text_offsets" indexed="true" stored="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-replication1.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-replication1.xml b/solr/core/src/test-files/solr/collection1/conf/schema-replication1.xml
index b647fa2..eeb51bd 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-replication1.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-replication1.xml
@@ -30,7 +30,7 @@
<fieldType name="integer" class="solr.TrieIntField" precisionStep="0"/>
<fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
- <field name="id" type="integer" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="name" type="string" indexed="true" stored="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-replication2.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-replication2.xml b/solr/core/src/test-files/solr/collection1/conf/schema-replication2.xml
index 8c8c49d..ade7bf5 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-replication2.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-replication2.xml
@@ -30,7 +30,7 @@
<fieldType name="integer" class="solr.TrieIntField" precisionStep="0"/>
<fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
- <field name="id" type="integer" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="name" type="string" indexed="true" stored="true"/>
<!--adding new field newname in replication test.-->
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-required-fields.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-required-fields.xml b/solr/core/src/test-files/solr/collection1/conf/schema-required-fields.xml
index f394bbb..551ac1d 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-required-fields.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-required-fields.xml
@@ -316,7 +316,7 @@
</fieldType>
- <field name="id" type="int" multiValued="false" indexed="true"
+ <field name="id" type="string" multiValued="false" indexed="true"
stored="true"/> <!-- the uniqueKey is required by default -->
<field name="name" type="nametext" indexed="true" stored="true" required="true"/>
<field name="text" type="text" indexed="true" stored="false"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-reversed.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-reversed.xml b/solr/core/src/test-files/solr/collection1/conf/schema-reversed.xml
index 63887cb..3bb52eb 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-reversed.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-reversed.xml
@@ -66,7 +66,7 @@
</fieldType>
- <field name="id" type="integer" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="one" type="srev" indexed="true" stored="false"/>
<field name="two" type="rev" indexed="true" stored="false"/>
<field name="three" type="text" indexed="true" stored="false"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-sim-default-override.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-sim-default-override.xml b/solr/core/src/test-files/solr/collection1/conf/schema-sim-default-override.xml
index 100caaf..2764324 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-sim-default-override.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-sim-default-override.xml
@@ -50,7 +50,7 @@
</analyzer>
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="sim1text" type="sim-explicit" indexed="true" stored="true"/>
<field name="sim2text" type="sim-used-as-default-override" indexed="true" stored="true"/>
<field name="sim3text" type="sim-none-get-default" indexed="true" stored="true"/>
@@ -60,7 +60,7 @@
<dynamicField name="*_sim2" type="sim-used-as-default-override" indexed="true" stored="true"/>
<dynamicField name="*_sim3" type="sim-none-get-default" indexed="true" stored="true"/>
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-sim.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-sim.xml b/solr/core/src/test-files/solr/collection1/conf/schema-sim.xml
index 68c4d6d..b941571 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-sim.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-sim.xml
@@ -19,7 +19,7 @@
<!-- Per-field similarity example for testing -->
<schema name="test" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- some per-field similarity examples -->
<!-- specify a Similarity classname directly -->
<fieldType name="sim1" class="solr.TextField">
@@ -46,7 +46,7 @@
</analyzer>
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="sim1text" type="sim1" indexed="true" stored="true"/>
<field name="sim2text" type="sim2" indexed="true" stored="true"/>
<field name="sim3text" type="sim3" indexed="true" stored="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-simpleqpplugin.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-simpleqpplugin.xml b/solr/core/src/test-files/solr/collection1/conf/schema-simpleqpplugin.xml
index 1183fd0..0ed7e10 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-simpleqpplugin.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-simpleqpplugin.xml
@@ -20,7 +20,7 @@
<!-- Test schema file for SimpleQParserPlugin. -->
<schema name="simpleqp" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- basic text field: no offsets -->
<fieldType name="text" class="solr.TextField">
@@ -50,7 +50,7 @@
</analyzer>
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text0" type="text" indexed="true" stored="true"/>
<field name="text1" type="text" indexed="true" stored="true"/>
<field name="text-keyword0" type="text-keyword" indexed="true" stored="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-sorts.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-sorts.xml b/solr/core/src/test-files/solr/collection1/conf/schema-sorts.xml
index 8497318..1ff68c1 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-sorts.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-sorts.xml
@@ -25,7 +25,7 @@ NOTE: Tests expect every field in this schema to be sortable.
<schema name="sortable" version="1.6">
<uniqueKey>id</uniqueKey>
- <field name="id" type="int"/>
+ <field name="id" type="str"/>
<field name="_version_" type="long"/>
<field name="str" type="str"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-sql.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-sql.xml b/solr/core/src/test-files/solr/collection1/conf/schema-sql.xml
index efa110c..e73c9c9 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-sql.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-sql.xml
@@ -436,7 +436,7 @@
-->
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="signatureField" type="string" indexed="true" stored="false"/>
<field name="s_multi" type="string" indexed="true" stored="true" docValues="true" multiValued="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-sweetspot.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-sweetspot.xml b/solr/core/src/test-files/solr/collection1/conf/schema-sweetspot.xml
index ba021a2..080faab 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-sweetspot.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-sweetspot.xml
@@ -19,7 +19,7 @@
<!-- Test schema file for SweetSpotSimilarityFactory -->
<schema name="test" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- default parameters -->
<fieldType name="text" class="solr.TextField"
@@ -59,7 +59,7 @@
</similarity>
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text"/>
<field name="text_baseline" type="text_baseline"/>
<field name="text_hyperbolic" type="text_hyperbolic"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-synonym-tokenizer.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-synonym-tokenizer.xml b/solr/core/src/test-files/solr/collection1/conf/schema-synonym-tokenizer.xml
index 09792f9..8ab64af 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-synonym-tokenizer.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-synonym-tokenizer.xml
@@ -18,7 +18,7 @@
<!-- Test schema file for SynonymGraphFilterFactory argument "tokenizerFactory" -->
<schema name="synonym-test" version="1.0">
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="text_synonyms" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
@@ -33,8 +33,8 @@
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text_synonyms" indexed="true" stored="false"/>
<uniqueKey>id</uniqueKey>
-</schema>
\ No newline at end of file
+</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-tfidf.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-tfidf.xml b/solr/core/src/test-files/solr/collection1/conf/schema-tfidf.xml
index 0bec86f..df05e82 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-tfidf.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-tfidf.xml
@@ -38,7 +38,7 @@
</similarity>
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-tokenizer-test.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-tokenizer-test.xml b/solr/core/src/test-files/solr/collection1/conf/schema-tokenizer-test.xml
index af28016..174787e 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-tokenizer-test.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-tokenizer-test.xml
@@ -32,7 +32,8 @@ more concise example.
attribute and any other attributes determine the real type and
behavior of the fieldType.
-->
-
+ <fieldType name="string" class="solr.StrField" />
+
<!--
Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
-->
@@ -127,7 +128,7 @@ more concise example.
</analyzer>
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="true"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/>
<field name="letter" type="letterfieldType" indexed="true" stored="true"/>
<field name="lowerCase" type="lowerCasefieldType" indexed="true" stored="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml b/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml
index 8cab0c8..775ec9d 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-trie.xml
@@ -273,7 +273,7 @@
-->
<!-- for testing, a type that does a transform to see if it's correctly done everywhere -->
- <field name="id" type="tfloat" indexed="true" stored="true" required="true"/>
+ <field name="id" type="string" indexed="true" stored="true" required="true"/>
<field name="text" type="text" indexed="true" stored="false"/>
<field name="signatureField" type="string" indexed="true" stored="false"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema-unifiedhighlight.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-unifiedhighlight.xml b/solr/core/src/test-files/solr/collection1/conf/schema-unifiedhighlight.xml
index 3e093f3..0c9a083 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema-unifiedhighlight.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-unifiedhighlight.xml
@@ -18,7 +18,7 @@
<!-- Test schema file for UnifiedHighlighter -->
<schema name="unifiedhighlight" version="1.6" >
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
+ <fieldType name="string" class="solr.StrField" omitNorms="true" positionIncrementGap="0"/>
<!-- basic text field: no offsets! -->
<fieldType name="text" class="solr.TextField">
@@ -36,7 +36,7 @@
</analyzer>
</fieldType>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="text" type="text_offsets" indexed="true" stored="true"/>
<field name="text2" type="text" indexed="true" stored="true"/>
<field name="text3" type="text_offsets" indexed="true" stored="true" large="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema.xml b/solr/core/src/test-files/solr/collection1/conf/schema.xml
index f0ddae4..685ee68 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema.xml
@@ -497,8 +497,8 @@
</fieldType>
<fieldType name="severityType" class="solr.EnumField" enumsConfig="enumsConfig.xml" enumName="severity"/>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
- <field name="_root_" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="_root_" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="signatureField" type="string" indexed="true" stored="false"/>
<field name="uuid" type="uuid" stored="true"/>
@@ -806,6 +806,7 @@
<copyField source="*_t" dest="text"/>
<copyField source="id" dest="range_facet_l"/>
+ <copyField source="id" dest="id_i1"/>
<copyField source="range_facet_f" dest="range_facet_d"/>
<copyField source="range_facet_f1" dest="range_facet_f1_dv"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/collection1/conf/schema11.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema11.xml b/solr/core/src/test-files/solr/collection1/conf/schema11.xml
index 819b6d1..9584061 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema11.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema11.xml
@@ -319,8 +319,10 @@ valued. -->
best performance.
-->
- <!-- for testing, a type that does a transform to see if it's correctly done everywhere -->
- <field name="id" type="float" indexed="true" stored="true" required="true" />
+ <field name="id" type="string" indexed="true" stored="true" required="true" />
+ <!-- int varient of id, adding this here simplifies some indexing to do numeric sorting -->
+ <field name="id_i" type="int" indexed="true" stored="true" multiValued="false" />
+ <copyField source="id" dest="id_i" />
<field name="text" type="text" indexed="true" stored="false" />
<!-- Test a point field for distances -->
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/configsets/configset-2/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/configsets/configset-2/conf/schema.xml b/solr/core/src/test-files/solr/configsets/configset-2/conf/schema.xml
index 981e522..73f59c8 100644
--- a/solr/core/src/test-files/solr/configsets/configset-2/conf/schema.xml
+++ b/solr/core/src/test-files/solr/configsets/configset-2/conf/schema.xml
@@ -18,8 +18,8 @@
<schema name="minimal" version="1.1">
<fieldType name="string" class="solr.StrField"/>
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
- <field name="_root_" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="_root_" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<dynamicField name="*" type="string" indexed="true" stored="true"/>
<uniqueKey>id</uniqueKey>
</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test-files/solr/crazy-path-to-schema.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/crazy-path-to-schema.xml b/solr/core/src/test-files/solr/crazy-path-to-schema.xml
index ef9ce3a..5b443ea 100644
--- a/solr/core/src/test-files/solr/crazy-path-to-schema.xml
+++ b/solr/core/src/test-files/solr/crazy-path-to-schema.xml
@@ -23,7 +23,7 @@
<schema name="test" version="1.0">
<types>
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0"/>
+ <fieldType name="string" class="solr.StrField" />
<fieldType name="text" class="solr.TextField">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
@@ -37,7 +37,7 @@
<fields>
- <field name="id" type="int" indexed="true" stored="true" multiValued="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false"/>
<field name="subject" type="text" indexed="true" stored="true"/>
</fields>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java b/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
index b1747fd..2122c90 100644
--- a/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
+++ b/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
@@ -111,7 +111,7 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
assertQ("query with ignored field",
req("bar_ignored:yo id:42")
,"//*[@numFound='1']"
- ,"//int[@name='id'][.='42']"
+ ,"//str[@name='id'][.='42']"
);
}
@@ -150,13 +150,13 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
assertQ("backslash escaping semicolon",
req("id:42 AND val_s:aa\\;bb")
,"//*[@numFound='1']"
- ,"//int[@name='id'][.='42']"
+ ,"//str[@name='id'][.='42']"
);
assertQ("quote escaping semicolon",
req("id:42 AND val_s:\"aa;bb\"")
,"//*[@numFound='1']"
- ,"//int[@name='id'][.='42']"
+ ,"//str[@name='id'][.='42']"
);
assertQ("no escaping semicolon",
@@ -275,15 +275,15 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
);
assertQ(req("{!lucene q.op=AND df=text}grape green")
,"//*[@numFound='1']"
- ,"//int[@name='id'][.='103']"
+ ,"//str[@name='id'][.='103']"
);
assertQ(req("-_val_:\"{!lucene q.op=AND df=text}grape green\"")
,"//*[@numFound='5']"
- ,"//int[@name='id'][.='101']"
- ,"//int[@name='id'][.='102']"
- ,"//int[@name='id'][.='104']"
- ,"//int[@name='id'][.='105']"
- ,"//int[@name='id'][.='106']"
+ ,"//str[@name='id'][.='101']"
+ ,"//str[@name='id'][.='102']"
+ ,"//str[@name='id'][.='104']"
+ ,"//str[@name='id'][.='105']"
+ ,"//str[@name='id'][.='106']"
);
// tests
@@ -298,26 +298,26 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
assertU(commit());
assertQ(req("*:*")
,"//*[@numFound='4']"
- ,"//int[@name='id'][.='101']"
- ,"//int[@name='id'][.='102']"
- ,"//int[@name='id'][.='103']"
- ,"//int[@name='id'][.='106']"
+ ,"//str[@name='id'][.='101']"
+ ,"//str[@name='id'][.='102']"
+ ,"//str[@name='id'][.='103']"
+ ,"//str[@name='id'][.='106']"
);
assertU(delQ("{!term f=id}106"));
assertU(commit());
assertQ(req("*:*")
,"//*[@numFound='3']"
- ,"//int[@name='id'][.='101']"
- ,"//int[@name='id'][.='102']"
- ,"//int[@name='id'][.='103']"
+ ,"//str[@name='id'][.='101']"
+ ,"//str[@name='id'][.='102']"
+ ,"//str[@name='id'][.='103']"
);
assertU(delQ("-_val_:\"{!lucene q.op=AND df=text}grape green\""));
assertU(commit());
assertQ(req("*:*")
,"//*[@numFound='1']"
- ,"//int[@name='id'][.='103']"
+ ,"//str[@name='id'][.='103']"
);
assertU(delQ("-text:doesnotexist"));
@@ -907,7 +907,7 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
assertQ("check math on field query: " + q,
req("q", q),
"*[count(//doc)=1]",
- "//int[@name='id'][.='1']");
+ "//str[@name='id'][.='1']");
}
// range queries using date math
[4/7] lucene-solr:master: SOLR-10834: Fixed tests and test configs to
stop using numeric uniqueKey fields
Posted by ho...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/schema/DocValuesTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/DocValuesTest.java b/solr/core/src/test/org/apache/solr/schema/DocValuesTest.java
index cf43a68..43c0006 100644
--- a/solr/core/src/test/org/apache/solr/schema/DocValuesTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/DocValuesTest.java
@@ -166,31 +166,31 @@ public class DocValuesTest extends SolrTestCaseJ4 {
assertU(adoc("id", "4"));
assertU(commit());
assertQ(req("q", "*:*", "sort", "floatdv desc", "rows", "1", "fl", "id"),
- "//int[@name='id'][.='2']");
+ "//str[@name='id'][.='2']");
assertQ(req("q", "*:*", "sort", "intdv desc", "rows", "1", "fl", "id"),
- "//int[@name='id'][.='2']");
+ "//str[@name='id'][.='2']");
assertQ(req("q", "*:*", "sort", "doubledv desc", "rows", "1", "fl", "id"),
- "//int[@name='id'][.='1']");
+ "//str[@name='id'][.='1']");
assertQ(req("q", "*:*", "sort", "longdv desc", "rows", "1", "fl", "id"),
- "//int[@name='id'][.='1']");
+ "//str[@name='id'][.='1']");
assertQ(req("q", "*:*", "sort", "datedv desc", "rows", "1", "fl", "id,datedv"),
- "//int[@name='id'][.='2']",
+ "//str[@name='id'][.='2']",
"//result/doc[1]/date[@name='datedv'][.='1997-12-31T23:59:59.999Z']"
);
assertQ(req("q", "*:*", "sort", "stringdv desc", "rows", "1", "fl", "id"),
- "//int[@name='id'][.='4']");
+ "//str[@name='id'][.='4']");
assertQ(req("q", "*:*", "sort", "floatdv asc", "rows", "1", "fl", "id"),
- "//int[@name='id'][.='4']");
+ "//str[@name='id'][.='4']");
assertQ(req("q", "*:*", "sort", "intdv asc", "rows", "1", "fl", "id"),
- "//int[@name='id'][.='3']");
+ "//str[@name='id'][.='3']");
assertQ(req("q", "*:*", "sort", "doubledv asc", "rows", "1", "fl", "id"),
- "//int[@name='id'][.='3']");
+ "//str[@name='id'][.='3']");
assertQ(req("q", "*:*", "sort", "longdv asc", "rows", "1", "fl", "id"),
- "//int[@name='id'][.='3']");
+ "//str[@name='id'][.='3']");
assertQ(req("q", "*:*", "sort", "datedv asc", "rows", "1", "fl", "id"),
- "//int[@name='id'][.='1']");
+ "//str[@name='id'][.='1']");
assertQ(req("q", "*:*", "sort", "stringdv asc", "rows", "1", "fl", "id"),
- "//int[@name='id'][.='2']");
+ "//str[@name='id'][.='2']");
assertQ(req("q", "*:*", "sort", "booldv asc", "rows", "10", "fl", "booldv,stringdv"),
"//result/doc[1]/bool[@name='booldv'][.='false']",
"//result/doc[2]/bool[@name='booldv'][.='true']",
@@ -212,13 +212,13 @@ public class DocValuesTest extends SolrTestCaseJ4 {
assertU(adoc("id", "7", "doubledv", "1.7976931348623157E308"));
assertU(commit());
assertQ(req("fl", "id", "q", "*:*", "sort", "doubledv asc"),
- "//result/doc[1]/int[@name='id'][.='6']",
- "//result/doc[2]/int[@name='id'][.='5']",
- "//result/doc[3]/int[@name='id'][.='3']",
- "//result/doc[4]/int[@name='id'][.='4']",
- "//result/doc[5]/int[@name='id'][.='1']",
- "//result/doc[6]/int[@name='id'][.='2']",
- "//result/doc[7]/int[@name='id'][.='7']"
+ "//result/doc[1]/str[@name='id'][.='6']",
+ "//result/doc[2]/str[@name='id'][.='5']",
+ "//result/doc[3]/str[@name='id'][.='3']",
+ "//result/doc[4]/str[@name='id'][.='4']",
+ "//result/doc[5]/str[@name='id'][.='1']",
+ "//result/doc[6]/str[@name='id'][.='2']",
+ "//result/doc[7]/str[@name='id'][.='7']"
);
}
@@ -366,156 +366,156 @@ public class DocValuesTest extends SolrTestCaseJ4 {
assertU(commit());
// string: termquery
- assertQ(req("q", "stringdv:car", "sort", "id asc"),
+ assertQ(req("q", "stringdv:car", "sort", "id_i asc"),
"//*[@numFound='1']",
- "//result/doc[1]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=4]"
);
// string: range query
- assertQ(req("q", "stringdv:[b TO d]", "sort", "id asc"),
+ assertQ(req("q", "stringdv:[b TO d]", "sort", "id_i asc"),
"//*[@numFound='3']",
- "//result/doc[1]/int[@name='id'][.=1]",
- "//result/doc[2]/int[@name='id'][.=3]",
- "//result/doc[3]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=1]",
+ "//result/doc[2]/str[@name='id'][.=3]",
+ "//result/doc[3]/str[@name='id'][.=4]"
);
// string: prefix query
- assertQ(req("q", "stringdv:c*", "sort", "id asc"),
+ assertQ(req("q", "stringdv:c*", "sort", "id_i asc"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=3]",
- "//result/doc[2]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=3]",
+ "//result/doc[2]/str[@name='id'][.=4]"
);
// string: wildcard query
- assertQ(req("q", "stringdv:c?r", "sort", "id asc"),
+ assertQ(req("q", "stringdv:c?r", "sort", "id_i asc"),
"//*[@numFound='1']",
- "//result/doc[1]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=4]"
);
// string: regexp query
- assertQ(req("q", "stringdv:/c[a-b]r/", "sort", "id asc"),
+ assertQ(req("q", "stringdv:/c[a-b]r/", "sort", "id_i asc"),
"//*[@numFound='1']",
- "//result/doc[1]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=4]"
);
// float: termquery
- assertQ(req("q", "floatdv:3", "sort", "id asc"),
+ assertQ(req("q", "floatdv:3", "sort", "id_i asc"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=3]",
- "//result/doc[2]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=3]",
+ "//result/doc[2]/str[@name='id'][.=4]"
);
// float: rangequery
- assertQ(req("q", "floatdv:[2 TO 3]", "sort", "id asc"),
+ assertQ(req("q", "floatdv:[2 TO 3]", "sort", "id_i asc"),
"//*[@numFound='3']",
- "//result/doc[1]/int[@name='id'][.=1]",
- "//result/doc[2]/int[@name='id'][.=3]",
- "//result/doc[3]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=1]",
+ "//result/doc[2]/str[@name='id'][.=3]",
+ "//result/doc[3]/str[@name='id'][.=4]"
);
// (neg) float: termquery
- assertQ(req("q", "floatdv:\"-5\"", "sort", "id asc"),
+ assertQ(req("q", "floatdv:\"-5\"", "sort", "id_i asc"),
"//*[@numFound='1']",
- "//result/doc[1]/int[@name='id'][.=2]"
+ "//result/doc[1]/str[@name='id'][.=2]"
);
// (neg) float: rangequery
- assertQ(req("q", "floatdv:[-6 TO -4]", "sort", "id asc"),
+ assertQ(req("q", "floatdv:[-6 TO -4]", "sort", "id_i asc"),
"//*[@numFound='1']",
- "//result/doc[1]/int[@name='id'][.=2]"
+ "//result/doc[1]/str[@name='id'][.=2]"
);
// (cross zero bounds) float: rangequery
- assertQ(req("q", "floatdv:[-6 TO 2.1]", "sort", "id asc"),
+ assertQ(req("q", "floatdv:[-6 TO 2.1]", "sort", "id_i asc"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=1]",
- "//result/doc[2]/int[@name='id'][.=2]"
+ "//result/doc[1]/str[@name='id'][.=1]",
+ "//result/doc[2]/str[@name='id'][.=2]"
);
// int: termquery
- assertQ(req("q", "intdv:1", "sort", "id asc"),
+ assertQ(req("q", "intdv:1", "sort", "id_i asc"),
"//*[@numFound='1']",
- "//result/doc[1]/int[@name='id'][.=3]"
+ "//result/doc[1]/str[@name='id'][.=3]"
);
// int: rangequery
- assertQ(req("q", "intdv:[3 TO 4]", "sort", "id asc"),
+ assertQ(req("q", "intdv:[3 TO 4]", "sort", "id_i asc"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=1]",
- "//result/doc[2]/int[@name='id'][.=2]"
+ "//result/doc[1]/str[@name='id'][.=1]",
+ "//result/doc[2]/str[@name='id'][.=2]"
);
// (neg) int: termquery
- assertQ(req("q", "intdv:\"-1\"", "sort", "id asc"),
+ assertQ(req("q", "intdv:\"-1\"", "sort", "id_i asc"),
"//*[@numFound='1']",
- "//result/doc[1]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=4]"
);
// (neg) int: rangequery
- assertQ(req("q", "intdv:[-1 TO 1]", "sort", "id asc"),
+ assertQ(req("q", "intdv:[-1 TO 1]", "sort", "id_i asc"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=3]",
- "//result/doc[2]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=3]",
+ "//result/doc[2]/str[@name='id'][.=4]"
);
// long: termquery
- assertQ(req("q", "longdv:1", "sort", "id asc"),
+ assertQ(req("q", "longdv:1", "sort", "id_i asc"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=3]",
- "//result/doc[2]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=3]",
+ "//result/doc[2]/str[@name='id'][.=4]"
);
// long: rangequery
- assertQ(req("q", "longdv:[1 TO 2]", "sort", "id asc"),
+ assertQ(req("q", "longdv:[1 TO 2]", "sort", "id_i asc"),
"//*[@numFound='3']",
- "//result/doc[1]/int[@name='id'][.=2]",
- "//result/doc[2]/int[@name='id'][.=3]",
- "//result/doc[3]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=2]",
+ "//result/doc[2]/str[@name='id'][.=3]",
+ "//result/doc[3]/str[@name='id'][.=4]"
);
// double: termquery
- assertQ(req("q", "doubledv:3.1", "sort", "id asc"),
+ assertQ(req("q", "doubledv:3.1", "sort", "id_i asc"),
"//*[@numFound='1']",
- "//result/doc[1]/int[@name='id'][.=1]"
+ "//result/doc[1]/str[@name='id'][.=1]"
);
// double: rangequery
- assertQ(req("q", "doubledv:[2 TO 3.3]", "sort", "id asc"),
+ assertQ(req("q", "doubledv:[2 TO 3.3]", "sort", "id_i asc"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=1]",
- "//result/doc[2]/int[@name='id'][.=3]"
+ "//result/doc[1]/str[@name='id'][.=1]",
+ "//result/doc[2]/str[@name='id'][.=3]"
);
// (neg) double: termquery
- assertQ(req("q", "doubledv:\"-4.3\"", "sort", "id asc"),
+ assertQ(req("q", "doubledv:\"-4.3\"", "sort", "id_i asc"),
"//*[@numFound='1']",
- "//result/doc[1]/int[@name='id'][.=2]"
+ "//result/doc[1]/str[@name='id'][.=2]"
);
// (neg) double: rangequery
- assertQ(req("q", "doubledv:[-6 TO -4]", "sort", "id asc"),
+ assertQ(req("q", "doubledv:[-6 TO -4]", "sort", "id_i asc"),
"//*[@numFound='1']",
- "//result/doc[1]/int[@name='id'][.=2]"
+ "//result/doc[1]/str[@name='id'][.=2]"
);
// (cross zero bounds) double: rangequery
- assertQ(req("q", "doubledv:[-6 TO 2.0]", "sort", "id asc"),
+ assertQ(req("q", "doubledv:[-6 TO 2.0]", "sort", "id_i asc"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=2]",
- "//result/doc[2]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=2]",
+ "//result/doc[2]/str[@name='id'][.=4]"
);
// boolean basic queries:
- assertQ(req("q", "booldv:false", "sort", "id asc"),
+ assertQ(req("q", "booldv:false", "sort", "id_i asc"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=1]",
- "//result/doc[2]/int[@name='id'][.=3]"
+ "//result/doc[1]/str[@name='id'][.=1]",
+ "//result/doc[2]/str[@name='id'][.=3]"
);
- assertQ(req("q", "booldv:true", "sort", "id asc"),
+ assertQ(req("q", "booldv:true", "sort", "id_i asc"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=2]",
- "//result/doc[2]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=2]",
+ "//result/doc[2]/str[@name='id'][.=4]"
);
}
@@ -617,7 +617,7 @@ public class DocValuesTest extends SolrTestCaseJ4 {
if((minInclusive && minSortable<=valSortable || !minInclusive && minSortable<valSortable) &&
(maxInclusive && maxSortable>=valSortable || !maxInclusive && maxSortable>valSortable)) {
counter++;
- tests.add("//result/doc["+counter+"]/int[@name='id'][.="+(k+1)+"]");
+ tests.add("//result/doc["+counter+"]/str[@name='id'][.="+(k+1)+"]");
tests.add("//result/doc["+counter+"]/float[@name='score'][.=1.0]");
}
}
@@ -630,7 +630,7 @@ public class DocValuesTest extends SolrTestCaseJ4 {
}
log.info("Expected: "+tests);
assertQ(req("q", fieldName[i] + ":" + (minInclusive? '[': '{') + min + " TO " + max + (maxInclusive? ']': '}'),
- "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+ "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
testsArr);
}
}
@@ -654,88 +654,88 @@ public class DocValuesTest extends SolrTestCaseJ4 {
assertU(commit());
// Negative Zero to Positive
- assertQ(req("q", fieldName[i]+":[-0.0 TO 2.5]", "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+ assertQ(req("q", fieldName[i]+":[-0.0 TO 2.5]", "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
"//*[@numFound='1']",
- "//result/doc[1]/int[@name='id'][.=1]"
+ "//result/doc[1]/str[@name='id'][.=1]"
);
// Negative to Positive Zero
- assertQ(req("q", fieldName[i]+":[-6 TO 0]", "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+ assertQ(req("q", fieldName[i]+":[-6 TO 0]", "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=2]",
- "//result/doc[2]/int[@name='id'][.=5]"
+ "//result/doc[1]/str[@name='id'][.=2]",
+ "//result/doc[2]/str[@name='id'][.=5]"
);
// Negative to Positive
- assertQ(req("q", fieldName[i]+":[-6 TO 2.5]", "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+ assertQ(req("q", fieldName[i]+":[-6 TO 2.5]", "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
"//*[@numFound='3']",
- "//result/doc[1]/int[@name='id'][.=1]",
- "//result/doc[2]/int[@name='id'][.=2]",
- "//result/doc[3]/int[@name='id'][.=5]"
+ "//result/doc[1]/str[@name='id'][.=1]",
+ "//result/doc[2]/str[@name='id'][.=2]",
+ "//result/doc[3]/str[@name='id'][.=5]"
);
// Positive to Positive
- assertQ(req("q", fieldName[i]+":[2 TO 3]", "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+ assertQ(req("q", fieldName[i]+":[2 TO 3]", "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
"//*[@numFound='3']",
- "//result/doc[1]/int[@name='id'][.=1]",
- "//result/doc[2]/int[@name='id'][.=3]",
- "//result/doc[3]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=1]",
+ "//result/doc[2]/str[@name='id'][.=3]",
+ "//result/doc[3]/str[@name='id'][.=4]"
);
// Positive to POSITIVE_INF
- assertQ(req("q", fieldName[i]+":[2 TO *]", "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+ assertQ(req("q", fieldName[i]+":[2 TO *]", "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
"//*[@numFound='4']",
- "//result/doc[1]/int[@name='id'][.=1]",
- "//result/doc[2]/int[@name='id'][.=3]",
- "//result/doc[3]/int[@name='id'][.=4]",
- "//result/doc[4]/int[@name='id'][.=7]"
+ "//result/doc[1]/str[@name='id'][.=1]",
+ "//result/doc[2]/str[@name='id'][.=3]",
+ "//result/doc[3]/str[@name='id'][.=4]",
+ "//result/doc[4]/str[@name='id'][.=7]"
);
// NEGATIVE_INF to Negative
- assertQ(req("q", fieldName[i]+":[* TO -1]", "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+ assertQ(req("q", fieldName[i]+":[* TO -1]", "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=2]",
- "//result/doc[2]/int[@name='id'][.=6]"
+ "//result/doc[1]/str[@name='id'][.=2]",
+ "//result/doc[2]/str[@name='id'][.=6]"
);
// NEGATIVE_INF to Positive
- assertQ(req("q", fieldName[i]+":[* TO 2]", "sort", "id asc", "fl", "id,"+fieldName[i]),
+ assertQ(req("q", fieldName[i]+":[* TO 2]", "sort", "id_i asc", "fl", "id,"+fieldName[i]),
"//*[@numFound='4']",
- "//result/doc[1]/int[@name='id'][.=1]",
- "//result/doc[2]/int[@name='id'][.=2]",
- "//result/doc[3]/int[@name='id'][.=5]",
- "//result/doc[4]/int[@name='id'][.=6]"
+ "//result/doc[1]/str[@name='id'][.=1]",
+ "//result/doc[2]/str[@name='id'][.=2]",
+ "//result/doc[3]/str[@name='id'][.=5]",
+ "//result/doc[4]/str[@name='id'][.=6]"
);
// NEGATIVE_INF to Positive (non-inclusive)
- assertQ(req("q", fieldName[i]+":[* TO 2}", "sort", "id asc", "fl", "id,"+fieldName[i]),
+ assertQ(req("q", fieldName[i]+":[* TO 2}", "sort", "id_i asc", "fl", "id,"+fieldName[i]),
"//*[@numFound='3']",
- "//result/doc[1]/int[@name='id'][.=2]",
- "//result/doc[2]/int[@name='id'][.=5]",
- "//result/doc[3]/int[@name='id'][.=6]"
+ "//result/doc[1]/str[@name='id'][.=2]",
+ "//result/doc[2]/str[@name='id'][.=5]",
+ "//result/doc[3]/str[@name='id'][.=6]"
);
// Negative to POSITIVE_INF
- assertQ(req("q", fieldName[i]+":[-6 TO *]", "sort", "id asc", "fl", "id,"+fieldName[i]),
+ assertQ(req("q", fieldName[i]+":[-6 TO *]", "sort", "id_i asc", "fl", "id,"+fieldName[i]),
"//*[@numFound='6']",
- "//result/doc[1]/int[@name='id'][.=1]",
- "//result/doc[2]/int[@name='id'][.=2]",
- "//result/doc[3]/int[@name='id'][.=3]",
- "//result/doc[4]/int[@name='id'][.=4]",
- "//result/doc[5]/int[@name='id'][.=5]",
- "//result/doc[6]/int[@name='id'][.=7]"
+ "//result/doc[1]/str[@name='id'][.=1]",
+ "//result/doc[2]/str[@name='id'][.=2]",
+ "//result/doc[3]/str[@name='id'][.=3]",
+ "//result/doc[4]/str[@name='id'][.=4]",
+ "//result/doc[5]/str[@name='id'][.=5]",
+ "//result/doc[6]/str[@name='id'][.=7]"
);
// NEGATIVE_INF to POSITIVE_INF
- assertQ(req("q", fieldName[i]+":[* TO *]", "sort", "id asc", "fl", "id,"+fieldName[i]+",score"),
+ assertQ(req("q", fieldName[i]+":[* TO *]", "sort", "id_i asc", "fl", "id,"+fieldName[i]+",score"),
"//*[@numFound='7']",
- "//result/doc[1]/int[@name='id'][.=1]",
- "//result/doc[2]/int[@name='id'][.=2]",
- "//result/doc[3]/int[@name='id'][.=3]",
- "//result/doc[4]/int[@name='id'][.=4]",
- "//result/doc[5]/int[@name='id'][.=5]",
- "//result/doc[6]/int[@name='id'][.=6]",
- "//result/doc[7]/int[@name='id'][.=7]",
+ "//result/doc[1]/str[@name='id'][.=1]",
+ "//result/doc[2]/str[@name='id'][.=2]",
+ "//result/doc[3]/str[@name='id'][.=3]",
+ "//result/doc[4]/str[@name='id'][.=4]",
+ "//result/doc[5]/str[@name='id'][.=5]",
+ "//result/doc[6]/str[@name='id'][.=6]",
+ "//result/doc[7]/str[@name='id'][.=7]",
"//result/doc[1]/float[@name='score'][.=1.0]",
"//result/doc[2]/float[@name='score'][.=1.0]",
"//result/doc[3]/float[@name='score'][.=1.0]",
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/schema/IndexSchemaRuntimeFieldTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/IndexSchemaRuntimeFieldTest.java b/solr/core/src/test/org/apache/solr/schema/IndexSchemaRuntimeFieldTest.java
index 1a429b2..3237b65 100644
--- a/solr/core/src/test/org/apache/solr/schema/IndexSchemaRuntimeFieldTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/IndexSchemaRuntimeFieldTest.java
@@ -57,14 +57,14 @@ public class IndexSchemaRuntimeFieldTest extends SolrTestCaseJ4 {
assertQ("Make sure they got in", req
,"//*[@numFound='1']"
- ,"//result/doc[1]/int[@name='id'][.='10']"
+ ,"//result/doc[1]/str[@name='id'][.='10']"
);
// Check to see if our copy field made it out safely
query.setQuery( "dynamic_runtime:aaa" );
assertQ("Make sure they got in", req
,"//*[@numFound='1']"
- ,"//result/doc[1]/int[@name='id'][.='10']"
+ ,"//result/doc[1]/str[@name='id'][.='10']"
);
clearIndex();
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java b/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java
index 44716bb..7790859 100644
--- a/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java
+++ b/solr/core/src/test/org/apache/solr/schema/IndexSchemaTest.java
@@ -58,7 +58,7 @@ public class IndexSchemaTest extends SolrTestCaseJ4 {
assertQ("Make sure they got in", req
,"//*[@numFound='1']"
- ,"//result/doc[1]/int[@name='id'][.='10']"
+ ,"//result/doc[1]/str[@name='id'][.='10']"
);
args = new HashMap<>();
@@ -67,7 +67,7 @@ public class IndexSchemaTest extends SolrTestCaseJ4 {
req = new LocalSolrQueryRequest( core, new MapSolrParams( args) );
assertQ("dynamic source", req
,"//*[@numFound='1']"
- ,"//result/doc[1]/int[@name='id'][.='10']"
+ ,"//result/doc[1]/str[@name='id'][.='10']"
);
args = new HashMap<>();
@@ -76,7 +76,7 @@ public class IndexSchemaTest extends SolrTestCaseJ4 {
req = new LocalSolrQueryRequest( core, new MapSolrParams( args) );
assertQ("dynamic destination", req
,"//*[@numFound='1']"
- ,"//result/doc[1]/int[@name='id'][.='10']"
+ ,"//result/doc[1]/str[@name='id'][.='10']"
);
clearIndex();
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/schema/TestBinaryField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/TestBinaryField.java b/solr/core/src/test/org/apache/solr/schema/TestBinaryField.java
index 9b42749..b3376c8 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestBinaryField.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestBinaryField.java
@@ -105,7 +105,7 @@ public class TestBinaryField extends SolrJettyTestBase {
assertEquals(3, beans.size());
for (SolrDocument d : res) {
- Integer id = (Integer) d.getFieldValue("id");
+ Integer id = Integer.parseInt(d.getFieldValue("id").toString());
byte[] data = (byte[]) d.getFieldValue("data");
if (id == 1) {
assertEquals(5, data.length);
@@ -133,7 +133,7 @@ public class TestBinaryField extends SolrJettyTestBase {
}
for (Bean d : beans) {
- Integer id = d.id;
+ Integer id = Integer.parseInt(d.id);
byte[] data = d.data;
if (id == 1) {
assertEquals(5, data.length);
@@ -165,7 +165,7 @@ public class TestBinaryField extends SolrJettyTestBase {
}
public static class Bean{
@Field
- int id;
+ String id;
@Field
byte [] data;
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/schema/TestCollationField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/TestCollationField.java b/solr/core/src/test/org/apache/solr/schema/TestCollationField.java
index 6351b82..f33a902 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestCollationField.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestCollationField.java
@@ -98,8 +98,8 @@ public class TestCollationField extends SolrTestCaseJ4 {
assertQ("Collated TQ: ",
req("fl", "id", "q", "sort_de:tone", "sort", "id asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=4]",
- "//result/doc[2]/int[@name='id'][.=7]"
+ "//result/doc[1]/str[@name='id'][.=4]",
+ "//result/doc[2]/str[@name='id'][.=7]"
);
}
@@ -112,8 +112,8 @@ public class TestCollationField extends SolrTestCaseJ4 {
assertQ("Collated RangeQ: ",
req("fl", "id", "q", "sort_de:[tone TO tp]", "sort", "id asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=4]",
- "//result/doc[2]/int[@name='id'][.=7]"
+ "//result/doc[1]/str[@name='id'][.=4]",
+ "//result/doc[2]/str[@name='id'][.=7]"
);
}
@@ -124,8 +124,8 @@ public class TestCollationField extends SolrTestCaseJ4 {
assertQ("Collated Sort: ",
req("fl", "id", "q", "sort_da:[tz TO töz]", "sort", "sort_da asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=11]",
- "//result/doc[2]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=11]",
+ "//result/doc[2]/str[@name='id'][.=4]"
);
}
@@ -137,8 +137,8 @@ public class TestCollationField extends SolrTestCaseJ4 {
assertQ("Collated Sort: ",
req("fl", "id", "q", "sort_ar:[\u0698 TO \u0633\u0633]", "sort", "sort_ar asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=12]",
- "//result/doc[2]/int[@name='id'][.=1]"
+ "//result/doc[1]/str[@name='id'][.=12]",
+ "//result/doc[2]/str[@name='id'][.=1]"
);
}
@@ -161,9 +161,9 @@ public class TestCollationField extends SolrTestCaseJ4 {
assertQ("Collated TQ: ",
req("fl", "id", "q", "sort_tr_canon:\"I Will Use Turkish Casıng\"", "sort", "id asc" ),
"//*[@numFound='3']",
- "//result/doc[1]/int[@name='id'][.=2]",
- "//result/doc[2]/int[@name='id'][.=3]",
- "//result/doc[3]/int[@name='id'][.=5]"
+ "//result/doc[1]/str[@name='id'][.=2]",
+ "//result/doc[2]/str[@name='id'][.=3]",
+ "//result/doc[3]/str[@name='id'][.=5]"
);
}
@@ -175,8 +175,8 @@ public class TestCollationField extends SolrTestCaseJ4 {
assertQ("Collated TQ: ",
req("fl", "id", "q", "sort_zh_full:Testing", "sort", "id asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=6]",
- "//result/doc[2]/int[@name='id'][.=8]"
+ "//result/doc[1]/str[@name='id'][.=6]",
+ "//result/doc[2]/str[@name='id'][.=8]"
);
}
@@ -186,10 +186,10 @@ public class TestCollationField extends SolrTestCaseJ4 {
*/
public void testCustomCollation() {
assertQ("Collated TQ: ",
- req("fl", "id", "q", "sort_custom:toene", "sort", "id asc" ),
+ req("fl", "id", "q", "sort_custom:toene" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=4]",
- "//result/doc[2]/int[@name='id'][.=10]"
+ "//result/doc/str[@name='id'][.=4]",
+ "//result/doc/str[@name='id'][.=10]"
);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/schema/TestCollationFieldDocValues.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/TestCollationFieldDocValues.java b/solr/core/src/test/org/apache/solr/schema/TestCollationFieldDocValues.java
index 1de339a..c950f67 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestCollationFieldDocValues.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestCollationFieldDocValues.java
@@ -97,8 +97,8 @@ public class TestCollationFieldDocValues extends SolrTestCaseJ4 {
assertQ("Collated TQ: ",
req("fl", "id", "q", "sort_de:tone", "sort", "id asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=4]",
- "//result/doc[2]/int[@name='id'][.=7]"
+ "//result/doc[1]/str[@name='id'][.=4]",
+ "//result/doc[2]/str[@name='id'][.=7]"
);
}
@@ -111,8 +111,8 @@ public class TestCollationFieldDocValues extends SolrTestCaseJ4 {
assertQ("Collated RangeQ: ",
req("fl", "id", "q", "sort_de:[tone TO tp]", "sort", "id asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=4]",
- "//result/doc[2]/int[@name='id'][.=7]"
+ "//result/doc[1]/str[@name='id'][.=4]",
+ "//result/doc[2]/str[@name='id'][.=7]"
);
}
@@ -123,8 +123,8 @@ public class TestCollationFieldDocValues extends SolrTestCaseJ4 {
assertQ("Collated Sort: ",
req("fl", "id", "q", "sort_da:[tz TO töz]", "sort", "sort_da asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=11]",
- "//result/doc[2]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=11]",
+ "//result/doc[2]/str[@name='id'][.=4]"
);
}
@@ -136,8 +136,8 @@ public class TestCollationFieldDocValues extends SolrTestCaseJ4 {
assertQ("Collated Sort: ",
req("fl", "id", "q", "sort_ar:[\u0698 TO \u0633\u0633]", "sort", "sort_ar asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=12]",
- "//result/doc[2]/int[@name='id'][.=1]"
+ "//result/doc[1]/str[@name='id'][.=12]",
+ "//result/doc[2]/str[@name='id'][.=1]"
);
}
@@ -160,9 +160,9 @@ public class TestCollationFieldDocValues extends SolrTestCaseJ4 {
assertQ("Collated TQ: ",
req("fl", "id", "q", "sort_tr_canon:\"I Will Use Turkish Casıng\"", "sort", "id asc" ),
"//*[@numFound='3']",
- "//result/doc[1]/int[@name='id'][.=2]",
- "//result/doc[2]/int[@name='id'][.=3]",
- "//result/doc[3]/int[@name='id'][.=5]"
+ "//result/doc[1]/str[@name='id'][.=2]",
+ "//result/doc[2]/str[@name='id'][.=3]",
+ "//result/doc[3]/str[@name='id'][.=5]"
);
}
@@ -174,8 +174,8 @@ public class TestCollationFieldDocValues extends SolrTestCaseJ4 {
assertQ("Collated TQ: ",
req("fl", "id", "q", "sort_zh_full:Testing", "sort", "id asc" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=6]",
- "//result/doc[2]/int[@name='id'][.=8]"
+ "//result/doc[1]/str[@name='id'][.=6]",
+ "//result/doc[2]/str[@name='id'][.=8]"
);
}
@@ -185,10 +185,10 @@ public class TestCollationFieldDocValues extends SolrTestCaseJ4 {
*/
public void testCustomCollation() {
assertQ("Collated TQ: ",
- req("fl", "id", "q", "sort_custom:toene", "sort", "id asc" ),
+ req("fl", "id", "q", "sort_custom:toene" ),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=4]",
- "//result/doc[2]/int[@name='id'][.=10]"
+ "//result/doc/str[@name='id'][.=4]",
+ "//result/doc/str[@name='id'][.=10]"
);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/schema/TestHalfAndHalfDocValues.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/TestHalfAndHalfDocValues.java b/solr/core/src/test/org/apache/solr/schema/TestHalfAndHalfDocValues.java
index feb9236..eb8c196 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestHalfAndHalfDocValues.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestHalfAndHalfDocValues.java
@@ -123,9 +123,9 @@ public class TestHalfAndHalfDocValues extends SolrTestCaseJ4 {
// Assert sort order is correct
assertQ(req("q", "string_add_dv_later:*", "sort", "string_add_dv_later asc"),
"//*[@numFound='3']",
- "//result/doc[1]/int[@name='id'][.=1]",
- "//result/doc[2]/int[@name='id'][.=2]",
- "//result/doc[3]/int[@name='id'][.=3]"
+ "//result/doc[1]/str[@name='id'][.=1]",
+ "//result/doc[2]/str[@name='id'][.=2]",
+ "//result/doc[3]/str[@name='id'][.=3]"
);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/schema/TestOmitPositions.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/schema/TestOmitPositions.java b/solr/core/src/test/org/apache/solr/schema/TestOmitPositions.java
index 19081b9..0fcc9fe 100644
--- a/solr/core/src/test/org/apache/solr/schema/TestOmitPositions.java
+++ b/solr/core/src/test/org/apache/solr/schema/TestOmitPositions.java
@@ -34,8 +34,8 @@ public class TestOmitPositions extends SolrTestCaseJ4 {
assertQ("term query: ",
req("fl", "id", "q", "nopositionstext:test"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.=2]",
- "//result/doc[2]/int[@name='id'][.=1]"
+ "//result/doc[1]/str[@name='id'][.=2]",
+ "//result/doc[2]/str[@name='id'][.=1]"
);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/SpatialFilterTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/SpatialFilterTest.java b/solr/core/src/test/org/apache/solr/search/SpatialFilterTest.java
index 720f9b5..66034c9 100644
--- a/solr/core/src/test/org/apache/solr/search/SpatialFilterTest.java
+++ b/solr/core/src/test/org/apache/solr/search/SpatialFilterTest.java
@@ -142,7 +142,7 @@ public class SpatialFilterTest extends SolrTestCaseJ4 {
if (docIds != null && docIds.length > 0) {
int i = 1;
for (int docId : docIds) {
- tests[i++] = "//result/doc/int[@name='id'][.='" + docId + "']";
+ tests[i++] = "//result/doc/str[@name='id'][.='" + docId + "']";
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java
index ef0404c..087c7e1 100644
--- a/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestCollapseQParserPlugin.java
@@ -70,111 +70,111 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field=group_s sort=$sort}");
- params.add("sort", "test_i asc, test_l desc, id desc");
+ params.add("sort", "test_i asc, test_l desc, id_i desc");
assertQ(req(params)
, "*[count(//doc)=2]"
- ,"//result/doc[1]/float[@name='id'][.='7.0']"
- ,"//result/doc[2]/float[@name='id'][.='3.0']"
+ ,"//result/doc[1]/str[@name='id'][.='7']"
+ ,"//result/doc[2]/str[@name='id'][.='3']"
);
// group heads are selected using a complex sort, simpler sort used for final groups
params = new ModifiableSolrParams();
params.add("q", "*:*");
- params.add("fq", "{!collapse field=group_s sort='test_i asc, test_l desc, id desc'}");
- params.add("sort", "id asc");
+ params.add("fq", "{!collapse field=group_s sort='test_i asc, test_l desc, id_i desc'}");
+ params.add("sort", "id_i asc");
assertQ(req(params)
, "*[count(//doc)=2]"
- ,"//result/doc[1]/float[@name='id'][.='3.0']"
- ,"//result/doc[2]/float[@name='id'][.='7.0']"
+ ,"//result/doc[1]/str[@name='id'][.='3']"
+ ,"//result/doc[2]/str[@name='id'][.='7']"
);
// diff up the sort directions, only first clause matters with our data
params = new ModifiableSolrParams();
params.add("q", "*:*");
- params.add("fq", "{!collapse field=group_s sort='test_i desc, test_l asc, id asc'}");
- params.add("sort", "id desc");
+ params.add("fq", "{!collapse field=group_s sort='test_i desc, test_l asc, id_i asc'}");
+ params.add("sort", "id_i desc");
assertQ(req(params)
, "*[count(//doc)=2]"
- ,"//result/doc[1]/float[@name='id'][.='8.0']"
- ,"//result/doc[2]/float[@name='id'][.='4.0']"
+ ,"//result/doc[1]/str[@name='id'][.='8']"
+ ,"//result/doc[2]/str[@name='id'][.='4']"
);
// tie broken by index order
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field=group_s sort='test_l desc'}");
- params.add("sort", "id desc");
+ params.add("sort", "id_i desc");
assertQ(req(params)
, "*[count(//doc)=2]"
- ,"//result/doc[1]/float[@name='id'][.='6.0']"
- ,"//result/doc[2]/float[@name='id'][.='2.0']"
+ ,"//result/doc[1]/str[@name='id'][.='6']"
+ ,"//result/doc[2]/str[@name='id'][.='2']"
);
// score, then tiebreakers; note top level sort by score ASCENDING (just for weirdness)
params = new ModifiableSolrParams();
params.add("q", "*:* term_s:YYYY");
- params.add("fq", "{!collapse field=group_s sort='score desc, test_l desc, test_i asc, id asc'}");
+ params.add("fq", "{!collapse field=group_s sort='score desc, test_l desc, test_i asc, id_i asc'}");
params.add("sort", "score asc");
assertQ(req(params)
, "*[count(//doc)=2]"
- ,"//result/doc[1]/float[@name='id'][.='2.0']"
- ,"//result/doc[2]/float[@name='id'][.='5.0']"
+ ,"//result/doc[1]/str[@name='id'][.='2']"
+ ,"//result/doc[2]/str[@name='id'][.='5']"
);
// score, then tiebreakers; note no score in top level sort/fl to check needsScores logic
params = new ModifiableSolrParams();
params.add("q", "*:* term_s:YYYY");
- params.add("fq", "{!collapse field=group_s sort='score desc, test_l desc, test_i asc, id asc'}");
- params.add("sort", "id desc");
+ params.add("fq", "{!collapse field=group_s sort='score desc, test_l desc, test_i asc, id_i asc'}");
+ params.add("sort", "id_i desc");
assertQ(req(params)
, "*[count(//doc)=2]"
- ,"//result/doc[1]/float[@name='id'][.='5.0']"
- ,"//result/doc[2]/float[@name='id'][.='2.0']"
+ ,"//result/doc[1]/str[@name='id'][.='5']"
+ ,"//result/doc[2]/str[@name='id'][.='2']"
);
// term_s desc -- term_s is missing from many docs, and uses sortMissingLast=true
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field=group_s sort='term_s desc, test_l asc'}");
- params.add("sort", "id asc");
+ params.add("sort", "id_i asc");
assertQ(req(params)
, "*[count(//doc)=2]"
- ,"//result/doc[1]/float[@name='id'][.='1.0']"
- ,"//result/doc[2]/float[@name='id'][.='5.0']"
+ ,"//result/doc[1]/str[@name='id'][.='1']"
+ ,"//result/doc[2]/str[@name='id'][.='5']"
);
// term_s asc -- term_s is missing from many docs, and uses sortMissingLast=true
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field=group_s sort='term_s asc, test_l asc'}");
- params.add("sort", "id asc");
+ params.add("sort", "id_i asc");
assertQ(req(params)
, "*[count(//doc)=2]"
- ,"//result/doc[1]/float[@name='id'][.='1.0']"
- ,"//result/doc[2]/float[@name='id'][.='7.0']"
+ ,"//result/doc[1]/str[@name='id'][.='1']"
+ ,"//result/doc[2]/str[@name='id'][.='7']"
);
// collapse on int field
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field=test_i sort='term_s asc, group_s asc'}");
- params.add("sort", "id asc");
+ params.add("sort", "id_i asc");
assertQ(req(params)
, "*[count(//doc)=2]"
- ,"//result/doc[1]/float[@name='id'][.='4.0']"
- ,"//result/doc[2]/float[@name='id'][.='7.0']"
+ ,"//result/doc[1]/str[@name='id'][.='4']"
+ ,"//result/doc[2]/str[@name='id'][.='7']"
);
// collapse on term_s (very sparse) with nullPolicy=collapse
params = new ModifiableSolrParams();
params.add("q", "*:*");
- params.add("fq", "{!collapse field=term_s nullPolicy=collapse sort='test_i asc, test_l desc, id asc'}");
- params.add("sort", "test_l asc, id asc");
+ params.add("fq", "{!collapse field=term_s nullPolicy=collapse sort='test_i asc, test_l desc, id_i asc'}");
+ params.add("sort", "test_l asc, id_i asc");
assertQ(req(params)
, "*[count(//doc)=3]"
- ,"//result/doc[1]/float[@name='id'][.='5.0']"
- ,"//result/doc[2]/float[@name='id'][.='2.0']"
- ,"//result/doc[3]/float[@name='id'][.='7.0']"
+ ,"//result/doc[1]/str[@name='id'][.='5']"
+ ,"//result/doc[2]/str[@name='id'][.='2']"
+ ,"//result/doc[3]/str[@name='id'][.='7']"
);
// sort local param + elevation
@@ -184,11 +184,11 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("sort", "test_l asc");
params.add("qt", "/elevate");
params.add("forceElevation", "true");
- params.add("elevateIds", "4.0");
+ params.add("elevateIds", "4");
assertQ(req(params),
"*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='4.0']",
- "//result/doc[2]/float[@name='id'][.='5.0']");
+ "//result/doc[1]/str[@name='id'][.='4']",
+ "//result/doc[2]/str[@name='id'][.='5']");
//
params = new ModifiableSolrParams();
params.add("q", "*:*");
@@ -196,11 +196,11 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("sort", "test_l asc");
params.add("qt", "/elevate");
params.add("forceElevation", "true");
- params.add("elevateIds", "7.0");
+ params.add("elevateIds", "7");
assertQ(req(params),
"*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='7.0']",
- "//result/doc[2]/float[@name='id'][.='1.0']");
+ "//result/doc[1]/str[@name='id'][.='7']",
+ "//result/doc[2]/str[@name='id'][.='1']");
}
@@ -250,13 +250,13 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("q", "*:*");
params.add("fq", "{!collapse field=group_i min=test_f}");
assertQ(req(params), "*[count(//doc)=1]",
- "//result/doc[1]/float[@name='id'][.='6.0']");
+ "//result/doc[1]/str[@name='id'][.='6']");
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field=group_i max=test_f}");
assertQ(req(params), "*[count(//doc)=1]",
- "//result/doc[1]/float[@name='id'][.='2.0']");
+ "//result/doc[1]/str[@name='id'][.='2']");
}
@@ -378,8 +378,8 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("defType", "edismax");
params.add("bf", "field(test_i)");
assertQ(req(params, "indent", "on"), "*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='2.0']",
- "//result/doc[2]/float[@name='id'][.='6.0']"
+ "//result/doc[1]/str[@name='id'][.='2']",
+ "//result/doc[2]/str[@name='id'][.='6']"
);
@@ -391,10 +391,10 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("bf", "field(test_i)");
params.add("sort","");
assertQ(req(params), "*[count(//doc)=4]",
- "//result/doc[1]/float[@name='id'][.='3.0']",
- "//result/doc[2]/float[@name='id'][.='4.0']",
- "//result/doc[3]/float[@name='id'][.='2.0']",
- "//result/doc[4]/float[@name='id'][.='6.0']"
+ "//result/doc[1]/str[@name='id'][.='3']",
+ "//result/doc[2]/str[@name='id'][.='4']",
+ "//result/doc[3]/str[@name='id'][.='2']",
+ "//result/doc[4]/str[@name='id'][.='6']"
);
// Test value source collapse criteria
@@ -403,9 +403,9 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("fq", "{!collapse field="+group+" nullPolicy=collapse min=field(test_i)"+hint+"}");
params.add("sort", "test_i desc");
assertQ(req(params), "*[count(//doc)=3]",
- "//result/doc[1]/float[@name='id'][.='4.0']",
- "//result/doc[2]/float[@name='id'][.='1.0']",
- "//result/doc[3]/float[@name='id'][.='5.0']"
+ "//result/doc[1]/str[@name='id'][.='4']",
+ "//result/doc[2]/str[@name='id'][.='1']",
+ "//result/doc[3]/str[@name='id'][.='5']"
);
// Test value source collapse criteria with cscore function
@@ -415,9 +415,9 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("defType", "edismax");
params.add("bf", "field(test_i)");
assertQ(req(params), "*[count(//doc)=3]",
- "//result/doc[1]/float[@name='id'][.='4.0']",
- "//result/doc[2]/float[@name='id'][.='1.0']",
- "//result/doc[3]/float[@name='id'][.='5.0']"
+ "//result/doc[1]/str[@name='id'][.='4']",
+ "//result/doc[2]/str[@name='id'][.='1']",
+ "//result/doc[3]/str[@name='id'][.='5']"
);
// Test value source collapse criteria with cscore function but no top level score sort
@@ -427,11 +427,11 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("defType", "edismax");
params.add("bf", "field(test_i)");
params.add("fl", "id");
- params.add("sort", "id desc");
+ params.add("sort", "id_i desc");
assertQ(req(params), "*[count(//doc)=3]",
- "//result/doc[1]/float[@name='id'][.='5.0']",
- "//result/doc[2]/float[@name='id'][.='4.0']",
- "//result/doc[3]/float[@name='id'][.='1.0']"
+ "//result/doc[1]/str[@name='id'][.='5']",
+ "//result/doc[2]/str[@name='id'][.='4']",
+ "//result/doc[3]/str[@name='id'][.='1']"
);
// Test value source collapse criteria with compound cscore function
@@ -441,9 +441,9 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("defType", "edismax");
params.add("bf", "field(test_i)");
assertQ(req(params), "*[count(//doc)=3]",
- "//result/doc[1]/float[@name='id'][.='4.0']",
- "//result/doc[2]/float[@name='id'][.='1.0']",
- "//result/doc[3]/float[@name='id'][.='5.0']"
+ "//result/doc[1]/str[@name='id'][.='4']",
+ "//result/doc[2]/str[@name='id'][.='1']",
+ "//result/doc[3]/str[@name='id'][.='5']"
);
//Test collapse by score with elevation
@@ -456,10 +456,10 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("qf", "term_s");
params.add("qt", "/elevate");
assertQ(req(params), "*[count(//doc)=4]",
- "//result/doc[1]/float[@name='id'][.='1.0']",
- "//result/doc[2]/float[@name='id'][.='2.0']",
- "//result/doc[3]/float[@name='id'][.='3.0']",
- "//result/doc[4]/float[@name='id'][.='6.0']");
+ "//result/doc[1]/str[@name='id'][.='1']",
+ "//result/doc[2]/str[@name='id'][.='2']",
+ "//result/doc[3]/str[@name='id'][.='3']",
+ "//result/doc[4]/str[@name='id'][.='6']");
//Test SOLR-5773 with score collapse criteria
// try both default & sort localparams as alternate ways to ask for max score
@@ -473,9 +473,9 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("qt", "/elevate");
params.add("elevateIds", "1,5");
assertQ(req(params), "*[count(//doc)=3]",
- "//result/doc[1]/float[@name='id'][.='1.0']",
- "//result/doc[2]/float[@name='id'][.='5.0']",
- "//result/doc[3]/float[@name='id'][.='3.0']");
+ "//result/doc[1]/str[@name='id'][.='1']",
+ "//result/doc[2]/str[@name='id'][.='5']",
+ "//result/doc[3]/str[@name='id'][.='3']");
}
//Test SOLR-5773 with max field collapse criteria
@@ -490,9 +490,9 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("qt", "/elevate");
params.add("elevateIds", "1,5");
assertQ(req(params), "*[count(//doc)=3]",
- "//result/doc[1]/float[@name='id'][.='1.0']",
- "//result/doc[2]/float[@name='id'][.='5.0']",
- "//result/doc[3]/float[@name='id'][.='3.0']");
+ "//result/doc[1]/str[@name='id'][.='1']",
+ "//result/doc[2]/str[@name='id'][.='5']",
+ "//result/doc[3]/str[@name='id'][.='3']");
}
//Test SOLR-5773 with min field collapse criteria
@@ -507,9 +507,9 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("qt", "/elevate");
params.add("elevateIds", "1,5");
assertQ(req(params), "*[count(//doc)=3]",
- "//result/doc[1]/float[@name='id'][.='1.0']",
- "//result/doc[2]/float[@name='id'][.='5.0']",
- "//result/doc[3]/float[@name='id'][.='4.0']");
+ "//result/doc[1]/str[@name='id'][.='1']",
+ "//result/doc[2]/str[@name='id'][.='5']",
+ "//result/doc[3]/str[@name='id'][.='4']");
}
//Test SOLR-5773 elevating documents with null group
@@ -522,33 +522,33 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("qt", "/elevate");
params.add("elevateIds", "3,4");
assertQ(req(params), "*[count(//doc)=4]",
- "//result/doc[1]/float[@name='id'][.='3.0']",
- "//result/doc[2]/float[@name='id'][.='4.0']",
- "//result/doc[3]/float[@name='id'][.='2.0']",
- "//result/doc[4]/float[@name='id'][.='6.0']");
+ "//result/doc[1]/str[@name='id'][.='3']",
+ "//result/doc[2]/str[@name='id'][.='4']",
+ "//result/doc[3]/str[@name='id'][.='2']",
+ "//result/doc[4]/str[@name='id'][.='6']");
// Non trivial sort local param for picking group head
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field="+group+" nullPolicy=collapse sort='term_s asc, test_i asc' "+hint+"}");
- params.add("sort", "id desc");
+ params.add("sort", "id_i desc");
assertQ(req(params),
"*[count(//doc)=3]",
- "//result/doc[1]/float[@name='id'][.='5.0']",
- "//result/doc[2]/float[@name='id'][.='4.0']",
- "//result/doc[3]/float[@name='id'][.='1.0']"
+ "//result/doc[1]/str[@name='id'][.='5']",
+ "//result/doc[2]/str[@name='id'][.='4']",
+ "//result/doc[3]/str[@name='id'][.='1']"
);
//
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field="+group+" nullPolicy=collapse sort='term_s asc, test_i desc' "+hint+"}");
- params.add("sort", "id desc");
+ params.add("sort", "id_i desc");
assertQ(req(params),
"*[count(//doc)=3]",
- "//result/doc[1]/float[@name='id'][.='6.0']",
- "//result/doc[2]/float[@name='id'][.='3.0']",
- "//result/doc[3]/float[@name='id'][.='2.0']"
+ "//result/doc[1]/str[@name='id'][.='6']",
+ "//result/doc[2]/str[@name='id'][.='3']",
+ "//result/doc[3]/str[@name='id'][.='2']"
);
@@ -559,40 +559,40 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field="+group + min + hint+"}");
- params.add("sort", "id desc");
+ params.add("sort", "id_i desc");
assertQ(req(params),
"*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='5.0']",
- "//result/doc[2]/float[@name='id'][.='1.0']");
+ "//result/doc[1]/str[@name='id'][.='5']",
+ "//result/doc[2]/str[@name='id'][.='1']");
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field="+group + min + hint+"}");
- params.add("sort", "id asc");
+ params.add("sort", "id_i asc");
assertQ(req(params),
"*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='1.0']",
- "//result/doc[2]/float[@name='id'][.='5.0']");
+ "//result/doc[1]/str[@name='id'][.='1']",
+ "//result/doc[2]/str[@name='id'][.='5']");
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field="+group + min + hint+"}");
- params.add("sort", "test_l asc,id desc");
+ params.add("sort", "test_l asc,id_i desc");
assertQ(req(params),
"*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='5.0']",
- "//result/doc[2]/float[@name='id'][.='1.0']");
+ "//result/doc[1]/str[@name='id'][.='5']",
+ "//result/doc[2]/str[@name='id'][.='1']");
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field="+group + min + hint+"}");
- params.add("sort", "score desc,id asc");
+ params.add("sort", "score desc,id_i asc");
params.add("defType", "edismax");
- params.add("bf", "field(id)");
+ params.add("bf", "field(id_i)");
assertQ(req(params),
"*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='5.0']",
- "//result/doc[2]/float[@name='id'][.='1.0']");
+ "//result/doc[1]/str[@name='id'][.='5']",
+ "//result/doc[2]/str[@name='id'][.='1']");
}
@@ -602,8 +602,8 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("fq", "{!collapse field="+group+" max=test_i"+hint+"}");
params.add("sort", "test_i asc");
assertQ(req(params), "*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='6.0']",
- "//result/doc[2]/float[@name='id'][.='2.0']"
+ "//result/doc[1]/str[@name='id'][.='6']",
+ "//result/doc[2]/str[@name='id'][.='2']"
);
try {
@@ -613,8 +613,8 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("fq", "{!collapse field="+group+" min=test_l"+hint+"}");
params.add("sort", "test_i desc");
assertQ(req(params), "*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='1.0']",
- "//result/doc[2]/float[@name='id'][.='5.0']");
+ "//result/doc[1]/str[@name='id'][.='1']",
+ "//result/doc[2]/str[@name='id'][.='5']");
//Test collapse by max long field
@@ -623,8 +623,8 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("fq", "{!collapse field="+group+" max=test_l"+hint+"}");
params.add("sort", "test_i desc");
assertQ(req(params), "*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='2.0']",
- "//result/doc[2]/float[@name='id'][.='6.0']");
+ "//result/doc[1]/str[@name='id'][.='2']",
+ "//result/doc[2]/str[@name='id'][.='6']");
} catch (Exception e) {
if(!numeric) {
throw e;
@@ -638,8 +638,8 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("fq", "{!collapse field="+group+" min=test_f"+hint+"}");
params.add("sort", "test_i desc");
assertQ(req(params), "*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='2.0']",
- "//result/doc[2]/float[@name='id'][.='6.0']");
+ "//result/doc[1]/str[@name='id'][.='2']",
+ "//result/doc[2]/str[@name='id'][.='6']");
//Test collapse by min float field
params = new ModifiableSolrParams();
@@ -647,23 +647,23 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("fq", "{!collapse field="+group+" max=test_f"+hint+"}");
params.add("sort", "test_i asc");
assertQ(req(params), "*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='5.0']",
- "//result/doc[2]/float[@name='id'][.='1.0']");
+ "//result/doc[1]/str[@name='id'][.='5']",
+ "//result/doc[2]/str[@name='id'][.='1']");
//Test collapse by min float field sort by score
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field="+group+" max=test_f"+hint+"}");
params.add("defType", "edismax");
- params.add("bf", "field(id)");
+ params.add("bf", "field(id_i)");
params.add("fl", "score, id");
params.add("facet","true");
params.add("fq", "{!tag=test}term_s:YYYY");
params.add("facet.field", "{!ex=test}term_s");
assertQ(req(params), "*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='5.0']",
- "//result/doc[2]/float[@name='id'][.='1.0']");
+ "//result/doc[1]/str[@name='id'][.='5']",
+ "//result/doc[2]/str[@name='id'][.='1']");
// Test collapse using selector field in no docs
// tie selector in all of these cases
@@ -690,8 +690,8 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
// attempting to use cscore() in sort local param should fail
assertQEx("expected error trying to sort on a function that includes cscore()",
- req(params("q", "{!func}sub(sub(test_l,1000),id)",
- "fq", "{!collapse field="+group+" sort='abs(cscore()) asc, id asc'}",
+ req(params("q", "{!func}sub(sub(test_l,1000),id_i)",
+ "fq", "{!collapse field="+group+" sort='abs(cscore()) asc, id_i asc'}",
"sort", "score asc")),
SolrException.ErrorCode.BAD_REQUEST);
@@ -718,9 +718,9 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
assertQ(req(collapse, "q", "*:*", "sort", "test_i desc"),
"*[count(//doc)=3]",
- "//result/doc[1]/float[@name='id'][.='4.0']",
- "//result/doc[2]/float[@name='id'][.='1.0']",
- "//result/doc[3]/float[@name='id'][.='5.0']");
+ "//result/doc[1]/str[@name='id'][.='4']",
+ "//result/doc[2]/str[@name='id'][.='1']",
+ "//result/doc[3]/str[@name='id'][.='5']");
}
@@ -728,22 +728,22 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field="+group+" max=test_f nullPolicy=expand"+hint+"}");
- params.add("sort", "id desc");
+ params.add("sort", "id_i desc");
assertQ(req(params), "*[count(//doc)=4]",
- "//result/doc[1]/float[@name='id'][.='5.0']",
- "//result/doc[2]/float[@name='id'][.='4.0']",
- "//result/doc[3]/float[@name='id'][.='3.0']",
- "//result/doc[4]/float[@name='id'][.='1.0']");
+ "//result/doc[1]/str[@name='id'][.='5']",
+ "//result/doc[2]/str[@name='id'][.='4']",
+ "//result/doc[3]/str[@name='id'][.='3']",
+ "//result/doc[4]/str[@name='id'][.='1']");
//Test nullPolicy collapse
params = new ModifiableSolrParams();
params.add("q", "*:*");
params.add("fq", "{!collapse field="+group+" max=test_f nullPolicy=collapse"+hint+"}");
- params.add("sort", "id desc");
+ params.add("sort", "id_i desc");
assertQ(req(params), "*[count(//doc)=3]",
- "//result/doc[1]/float[@name='id'][.='5.0']",
- "//result/doc[2]/float[@name='id'][.='4.0']",
- "//result/doc[3]/float[@name='id'][.='1.0']");
+ "//result/doc[1]/str[@name='id'][.='5']",
+ "//result/doc[2]/str[@name='id'][.='4']",
+ "//result/doc[3]/str[@name='id'][.='1']");
params = new ModifiableSolrParams();
@@ -778,9 +778,9 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
params.add("qf", "term_s");
params.add("qt", "/elevate");
assertQ(req(params), "*[count(//doc)=3]",
- "//result/doc[1]/float[@name='id'][.='3.0']",
- "//result/doc[2]/float[@name='id'][.='6.0']",
- "//result/doc[3]/float[@name='id'][.='7.0']");
+ "//result/doc[1]/str[@name='id'][.='3']",
+ "//result/doc[2]/str[@name='id'][.='6']",
+ "//result/doc[3]/str[@name='id'][.='7']");
}
@@ -850,25 +850,25 @@ public class TestCollapseQParserPlugin extends SolrTestCaseJ4 {
// w/default nullPolicy, no groups found
params = new ModifiableSolrParams();
params.add("q", "*:*");
- params.add("sort", "id desc");
+ params.add("sort", "id_i desc");
params.add("fq", "{!collapse "+group+" "+selector+"}");
assertQ(req(params), "*[count(//doc)=0]");
// w/nullPolicy=expand, every doc found
params = new ModifiableSolrParams();
params.add("q", "*:*");
- params.add("sort", "id desc");
+ params.add("sort", "id_i desc");
params.add("fq", "{!collapse field="+group+" nullPolicy=expand "+selector+"}");
assertQ(req(params)
, "*[count(//doc)=8]"
- ,"//result/doc[1]/float[@name='id'][.='8.0']"
- ,"//result/doc[2]/float[@name='id'][.='7.0']"
- ,"//result/doc[3]/float[@name='id'][.='6.0']"
- ,"//result/doc[4]/float[@name='id'][.='5.0']"
- ,"//result/doc[5]/float[@name='id'][.='4.0']"
- ,"//result/doc[6]/float[@name='id'][.='3.0']"
- ,"//result/doc[7]/float[@name='id'][.='2.0']"
- ,"//result/doc[8]/float[@name='id'][.='1.0']"
+ ,"//result/doc[1]/str[@name='id'][.='8']"
+ ,"//result/doc[2]/str[@name='id'][.='7']"
+ ,"//result/doc[3]/str[@name='id'][.='6']"
+ ,"//result/doc[4]/str[@name='id'][.='5']"
+ ,"//result/doc[5]/str[@name='id'][.='4']"
+ ,"//result/doc[6]/str[@name='id'][.='3']"
+ ,"//result/doc[7]/str[@name='id'][.='2']"
+ ,"//result/doc[8]/str[@name='id'][.='1']"
);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/TestComplexPhraseLeadingWildcard.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestComplexPhraseLeadingWildcard.java b/solr/core/src/test/org/apache/solr/search/TestComplexPhraseLeadingWildcard.java
index 6c48cc3..ffccaca 100644
--- a/solr/core/src/test/org/apache/solr/search/TestComplexPhraseLeadingWildcard.java
+++ b/solr/core/src/test/org/apache/solr/search/TestComplexPhraseLeadingWildcard.java
@@ -106,7 +106,7 @@ public class TestComplexPhraseLeadingWildcard extends SolrTestCaseJ4 {
xpathes[0]= "//result[@numFound=" +ids.length+ "]";
int i=1;
for(String id : ids) {
- xpathes[i++] = "//doc/int[@name='id' and text()='"+id+"']";
+ xpathes[i++] = "//doc/str[@name='id' and text()='"+id+"']";
}
return xpathes;
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/TestCustomSort.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestCustomSort.java b/solr/core/src/test/org/apache/solr/search/TestCustomSort.java
index ca33ea0..74b8301 100644
--- a/solr/core/src/test/org/apache/solr/search/TestCustomSort.java
+++ b/solr/core/src/test/org/apache/solr/search/TestCustomSort.java
@@ -49,7 +49,7 @@ public class TestCustomSort extends SolrTestCaseJ4 {
assertU(adoc(sdoc("id", "13", "text", "d", "payload", ByteBuffer.wrap(new byte[] { (byte)0x80, 0x11, 0x33 })))); // 12
assertU(commit());
- assertQ(req("q", "*:*", "fl", "id", "sort", "payload asc", "rows", "20")
+ assertQ(req("q", "*:*", "fl", "id_i", "sort", "payload asc", "rows", "20")
, "//result[@numFound='13']" // <result name="response" numFound="13" start="0">
, "//result/doc[int='7' and position()=1]" // <doc><int name="id">7</int></doc> 00 3c 73
, "//result/doc[int='1' and position()=2]" // <doc><int name="id">1</int></doc> 12 62 15
@@ -64,7 +64,7 @@ public class TestCustomSort extends SolrTestCaseJ4 {
, "//result/doc[int='8' and position()=11]" // <doc><int name="id">8</int></doc> 59 2d 4d
, "//result/doc[int='13' and position()=12]" // <doc><int name="id">13</int></doc> 80 11 33
, "//result/doc[int='11' and position()=13]"); // <doc><int name="id">11</int></doc> ff af 9c
- assertQ(req("q", "*:*", "fl", "id", "sort", "payload desc", "rows", "20")
+ assertQ(req("q", "*:*", "fl", "id_i", "sort", "payload desc", "rows", "20")
, "//result[@numFound='13']" // <result name="response" numFound="13" start="0">
, "//result/doc[int='11' and position()=1]" // <doc><int name="id">11</int></doc> ff af 9c
, "//result/doc[int='13' and position()=2]" // <doc><int name="id">13</int></doc> 80 11 33
@@ -79,44 +79,44 @@ public class TestCustomSort extends SolrTestCaseJ4 {
, "//result/doc[int='6' and position()=11]" // <doc><int name="id">6</int></doc> 1a 2b 3c 00 00 03
, "//result/doc[int='1' and position()=12]" // <doc><int name="id">1</int></doc> 12 62 15
, "//result/doc[int='7' and position()=13]"); // <doc><int name="id">7</int></doc> 00 3c 73
- assertQ(req("q", "text:a", "fl", "id", "sort", "payload asc", "rows", "20")
+ assertQ(req("q", "text:a", "fl", "id_i", "sort", "payload asc", "rows", "20")
, "//result[@numFound='4']" // <result name="response" numFound="4" start="0">
, "//result/doc[int='1' and position()=1]" // <doc><int name="id">1</int></doc> 12 62 15
, "//result/doc[int='3' and position()=2]" // <doc><int name="id">3</int></doc> 35 32 58
, "//result/doc[int='5' and position()=3]" // <doc><int name="id">5</int></doc> 35 35 10 00
, "//result/doc[int='9' and position()=4]"); // <doc><int name="id">9</int></doc> 39 79 7a
- assertQ(req("q", "text:a", "fl", "id", "sort", "payload desc", "rows", "20")
+ assertQ(req("q", "text:a", "fl", "id_i", "sort", "payload desc", "rows", "20")
, "//result[@numFound='4']" // <result name="response" numFound="4" start="0">
, "//result/doc[int='9' and position()=1]" // <doc><int name="id">9</int></doc> 39 79 7a
, "//result/doc[int='5' and position()=2]" // <doc><int name="id">5</int></doc> 35 35 10 00
, "//result/doc[int='3' and position()=3]" // <doc><int name="id">3</int></doc> 35 32 58
, "//result/doc[int='1' and position()=4]"); // <doc><int name="id">1</int></doc> 12 62 15
- assertQ(req("q", "text:b", "fl", "id", "sort", "payload asc", "rows", "20")
+ assertQ(req("q", "text:b", "fl", "id_i", "sort", "payload asc", "rows", "20")
, "//result[@numFound='3']" // <result name="response" numFound="3" start="0">
, "//result/doc[int='4' and position()=1]" // <doc><int name="id">4</int></doc> 25 21 15
, "//result/doc[int='2' and position()=2]" // <doc><int name="id">2</int></doc> 25 21 16
, "//result/doc[int='10' and position()=3]"); // <doc><int name="id">10</int></doc> 31 39 7c
- assertQ(req("q", "text:b", "fl", "id", "sort", "payload desc", "rows", "20")
+ assertQ(req("q", "text:b", "fl", "id_i", "sort", "payload desc", "rows", "20")
, "//result[@numFound='3']" // <result name="response" numFound="3" start="0">
, "//result/doc[int='10' and position()=1]" // <doc><int name="id">10</int></doc> 31 39 7c
, "//result/doc[int='2' and position()=2]" // <doc><int name="id">2</int></doc> 25 21 16
, "//result/doc[int='4' and position()=3]"); // <doc><int name="id">4</int></doc> 25 21 15
- assertQ(req("q", "text:c", "fl", "id", "sort", "payload asc", "rows", "20")
+ assertQ(req("q", "text:c", "fl", "id_i", "sort", "payload asc", "rows", "20")
, "//result[@numFound='3']" // <result name="response" numFound="3" start="0">
, "//result/doc[int='7' and position()=1]" // <doc><int name="id">7</int></doc> 00 3c 73
, "//result/doc[int='6' and position()=2]" // <doc><int name="id">6</int></doc> 1a 2b 3c 00 00 03
, "//result/doc[int='8' and position()=3]"); // <doc><int name="id">8</int></doc> 59 2d 4d
- assertQ(req("q", "text:c", "fl", "id", "sort", "payload desc", "rows", "20")
+ assertQ(req("q", "text:c", "fl", "id_i", "sort", "payload desc", "rows", "20")
, "//result[@numFound='3']" // <result name="response" numFound="3" start="0">
, "//result/doc[int='8' and position()=1]" // <doc><int name="id">8</int></doc> 59 2d 4d
, "//result/doc[int='6' and position()=2]" // <doc><int name="id">6</int></doc> 1a 2b 3c 00 00 03
, "//result/doc[int='7' and position()=3]"); // <doc><int name="id">7</int></doc> 00 3c 73
- assertQ(req("q", "text:d", "fl", "id", "sort", "payload asc", "rows", "20")
+ assertQ(req("q", "text:d", "fl", "id_i", "sort", "payload asc", "rows", "20")
, "//result[@numFound='3']" // <result name="response" numFound="3" start="0">
, "//result/doc[int='12' and position()=1]" // <doc><int name="id">12</int></doc> 34 dd 4d
, "//result/doc[int='13' and position()=2]" // <doc><int name="id">13</int></doc> 80 11 33
, "//result/doc[int='11' and position()=3]"); // <doc><int name="id">11</int></doc> ff af 9c
- assertQ(req("q", "text:d", "fl", "id", "sort", "payload desc", "rows", "20")
+ assertQ(req("q", "text:d", "fl", "id_i", "sort", "payload desc", "rows", "20")
, "//result[@numFound='3']" // <result name="response" numFound="3" start="0">
, "//result/doc[int='11' and position()=1]" // <doc><int name="id">11</int></doc> ff af 9c
, "//result/doc[int='13' and position()=2]" // <doc><int name="id">13</int></doc> 80 11 33
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/TestFieldSortValues.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestFieldSortValues.java b/solr/core/src/test/org/apache/solr/search/TestFieldSortValues.java
index 781127b..3e07bf3 100644
--- a/solr/core/src/test/org/apache/solr/search/TestFieldSortValues.java
+++ b/solr/core/src/test/org/apache/solr/search/TestFieldSortValues.java
@@ -41,10 +41,10 @@ public class TestFieldSortValues extends SolrTestCaseJ4 {
// payload is backed by a custom sort field which returns the payload value mod 3
assertQ(req("q", "*:*", "fl", "id", "sort", "payload asc, id asc", "fsv", "true")
- , "//result/doc[int='2' and position()=1]"
- , "//result/doc[int='3' and position()=2]"
- , "//result/doc[int='5' and position()=3]"
- , "//result/doc[int='1' and position()=4]"
- , "//result/doc[int='4' and position()=5]");
+ , "//result/doc[str='2' and position()=1]"
+ , "//result/doc[str='3' and position()=2]"
+ , "//result/doc[str='5' and position()=3]"
+ , "//result/doc[str='1' and position()=4]"
+ , "//result/doc[str='4' and position()=5]");
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/TestFoldingMultitermQuery.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestFoldingMultitermQuery.java b/solr/core/src/test/org/apache/solr/search/TestFoldingMultitermQuery.java
index fb982b8..5ceb224 100644
--- a/solr/core/src/test/org/apache/solr/search/TestFoldingMultitermQuery.java
+++ b/solr/core/src/test/org/apache/solr/search/TestFoldingMultitermQuery.java
@@ -346,4 +346,4 @@ public class TestFoldingMultitermQuery extends SolrTestCaseJ4 {
public void testCJKWidth() {
assertQ(req("q", "content_width:ヴィ*"), "//result[@numFound='1']");
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/TestGraphTermsQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestGraphTermsQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestGraphTermsQParserPlugin.java
index 05ec982..1cb927d 100644
--- a/solr/core/src/test/org/apache/solr/search/TestGraphTermsQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestGraphTermsQParserPlugin.java
@@ -74,11 +74,11 @@ public class TestGraphTermsQParserPlugin extends SolrTestCaseJ4 {
params.add("q", "{!graphTerms f=group_s maxDocFreq=10}1,2");
params.add("sort", "id asc");
assertQ(req(params, "indent", "on"), "*[count(//doc)=5]",
- "//result/doc[1]/float[@name='id'][.='1.0']",
- "//result/doc[2]/float[@name='id'][.='2.0']",
- "//result/doc[3]/float[@name='id'][.='5.0']",
- "//result/doc[4]/float[@name='id'][.='6.0']",
- "//result/doc[5]/float[@name='id'][.='7.0']"
+ "//result/doc[1]/str[@name='id'][.='1']",
+ "//result/doc[2]/str[@name='id'][.='2']",
+ "//result/doc[3]/str[@name='id'][.='5']",
+ "//result/doc[4]/str[@name='id'][.='6']",
+ "//result/doc[5]/str[@name='id'][.='7']"
);
//Test without maxDocFreq param. Should default to Integer.MAX_VALUE and match all terms.
@@ -86,11 +86,11 @@ public class TestGraphTermsQParserPlugin extends SolrTestCaseJ4 {
params.add("q", "{!graphTerms f=group_s}1,2");
params.add("sort", "id asc");
assertQ(req(params, "indent", "on"), "*[count(//doc)=5]",
- "//result/doc[1]/float[@name='id'][.='1.0']",
- "//result/doc[2]/float[@name='id'][.='2.0']",
- "//result/doc[3]/float[@name='id'][.='5.0']",
- "//result/doc[4]/float[@name='id'][.='6.0']",
- "//result/doc[5]/float[@name='id'][.='7.0']"
+ "//result/doc[1]/str[@name='id'][.='1']",
+ "//result/doc[2]/str[@name='id'][.='2']",
+ "//result/doc[3]/str[@name='id'][.='5']",
+ "//result/doc[4]/str[@name='id'][.='6']",
+ "//result/doc[5]/str[@name='id'][.='7']"
);
params = new ModifiableSolrParams();
@@ -104,11 +104,11 @@ public class TestGraphTermsQParserPlugin extends SolrTestCaseJ4 {
params.add("q", "{!graphTerms f=test_ti maxDocFreq=10}5,10");
params.add("sort", "id asc");
assertQ(req(params, "indent", "on"), "*[count(//doc)=5]",
- "//result/doc[1]/float[@name='id'][.='1.0']",
- "//result/doc[2]/float[@name='id'][.='2.0']",
- "//result/doc[3]/float[@name='id'][.='5.0']",
- "//result/doc[4]/float[@name='id'][.='6.0']",
- "//result/doc[5]/float[@name='id'][.='7.0']"
+ "//result/doc[1]/str[@name='id'][.='1']",
+ "//result/doc[2]/str[@name='id'][.='2']",
+ "//result/doc[3]/str[@name='id'][.='5']",
+ "//result/doc[4]/str[@name='id'][.='6']",
+ "//result/doc[5]/str[@name='id'][.='7']"
);
//Test with int field
@@ -116,8 +116,8 @@ public class TestGraphTermsQParserPlugin extends SolrTestCaseJ4 {
params.add("q", "{!graphTerms f=test_ti maxDocFreq=2}5,10");
params.add("sort", "id asc");
assertQ(req(params, "indent", "on"), "*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='6.0']",
- "//result/doc[2]/float[@name='id'][.='7.0']"
+ "//result/doc[1]/str[@name='id'][.='6']",
+ "//result/doc[2]/str[@name='id'][.='7']"
);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/TestHashQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestHashQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestHashQParserPlugin.java
index 46b7b60..a4fa1b8 100644
--- a/solr/core/src/test/org/apache/solr/search/TestHashQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestHashQParserPlugin.java
@@ -91,7 +91,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {
while(it.hasNext()) {
String s = it.next();
- String results = h.validateXPath(response, "*[count(//int[@name='id'][.='"+s+"'])=1]");
+ String results = h.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");
if(results == null) {
set1.add(s);
}
@@ -109,7 +109,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {
while(it.hasNext()) {
String s = it.next();
- String results = h.validateXPath(response, "*[count(//int[@name='id'][.='"+s+"'])=1]");
+ String results = h.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");
if(results == null) {
set2.add(s);
}
@@ -128,7 +128,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {
while(it.hasNext()) {
String s = it.next();
- String results = h.validateXPath(response, "*[count(//int[@name='id'][.='"+s+"'])=1]");
+ String results = h.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");
if(results == null) {
set3.add(s);
}
@@ -158,7 +158,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {
while(it.hasNext()) {
String s = it.next();
- String results = h.validateXPath(response, "*[count(//int[@name='id'][.='"+s+"'])=1]");
+ String results = h.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");
if(results == null) {
set1.add(s);
}
@@ -176,7 +176,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {
while(it.hasNext()) {
String s = it.next();
- String results = h.validateXPath(response, "*[count(//int[@name='id'][.='"+s+"'])=1]");
+ String results = h.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");
if(results == null) {
set2.add(s);
}
@@ -203,7 +203,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {
while(it.hasNext()) {
String s = it.next();
- String results = h.validateXPath(response, "*[count(//int[@name='id'][.='"+s+"'])=1]");
+ String results = h.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");
if(results == null) {
set1.add(s);
}
@@ -221,7 +221,7 @@ public class TestHashQParserPlugin extends SolrTestCaseJ4 {
while(it.hasNext()) {
String s = it.next();
- String results = h.validateXPath(response, "*[count(//int[@name='id'][.='"+s+"'])=1]");
+ String results = h.validateXPath(response, "*[count(//str[@name='id'][.='"+s+"'])=1]");
if(results == null) {
set2.add(s);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java b/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java
index f282c3f..0945ea2 100644
--- a/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java
+++ b/solr/core/src/test/org/apache/solr/search/TestQueryTypes.java
@@ -45,7 +45,7 @@ public class TestQueryTypes extends AbstractSolrTestCase {
assertU(adoc("id","10","text_no_analyzer","should just work"));
Object[] arr = new Object[] {
- "id",999.0
+ "id",999
,"v_s","wow dude"
,"v_t","wow"
,"v_ti",-1
@@ -75,7 +75,7 @@ public class TestQueryTypes extends AbstractSolrTestCase {
// normal lucene fielded query
assertQ(req( "q",f+":\""+v+'"')
,"//result[@numFound='1']"
- ,"//*[@name='id'][.='999.0']"
+ ,"//*[@name='id'][.='999']"
,"//*[@name='" + f + "'][.='" + v + "']"
);
@@ -116,7 +116,7 @@ public class TestQueryTypes extends AbstractSolrTestCase {
// frange and function query only work on single valued field types
Object[] fc_vals = new Object[] {
- "id",999.0
+ "id_i",999
,"v_s","wow dude"
,"v_ti",-1
,"v_tl",-1234567891234567890L
@@ -154,7 +154,7 @@ public class TestQueryTypes extends AbstractSolrTestCase {
,"//result[@numFound='1']"
);
- if (!"id".equals(f)) {
+ if (!"id_i".equals(f)) {
assertQ(req( "fq","id:1", "q", "{!frange l=1 u=1}if(exists("+f+"),1,0)" )
,"//result[@numFound='0']"
);
@@ -352,40 +352,40 @@ public class TestQueryTypes extends AbstractSolrTestCase {
req("df", "v_t",
"q", "{!switch case.x=Dude case.z=Yonik} x ")
,"//result[@numFound='1']"
- ,"//*[@name='id'][.='1.0']");
+ ,"//*[@name='id'][.='1']");
assertQ("test empty matching switch query",
req("df", "v_t",
"q", "{!switch case.x=Dude case=Yonik} ")
,"//result[@numFound='1']"
- ,"//*[@name='id'][.='2.0']");
+ ,"//*[@name='id'][.='2']");
assertQ("test empty matching switch query",
req("df", "v_t",
"q", "{!switch case.x=Dude case=Yonik v=''}")
,"//result[@numFound='1']"
- ,"//*[@name='id'][.='2.0']");
+ ,"//*[@name='id'][.='2']");
assertQ("test empty matching switch query",
req("df", "v_t",
"q", "{!switch case.x=Dude case=Yonik v=$qq}")
,"//result[@numFound='1']"
- ,"//*[@name='id'][.='2.0']");
+ ,"//*[@name='id'][.='2']");
assertQ("test matching switch query w/deref",
req("q", "{!switch case.x=$d case.z=Yonik} x ",
"df", "v_t",
"d", "Dude")
,"//result[@numFound='1']"
- ,"//*[@name='id'][.='1.0']");
+ ,"//*[@name='id'][.='1']");
assertQ("test default switch query",
req("q", "{!switch default=$d case.x=$d case.z=Yonik}asdf",
"df", "v_t",
"d", "Dude")
,"//result[@numFound='1']"
- ,"//*[@name='id'][.='1.0']");
+ ,"//*[@name='id'][.='1']");
assertQ("test empty default switch query",
req("q", "{!switch default=$d case.x=$d case.z=Yonik v=$qq}",
"df", "v_t",
"d", "Dude")
,"//result[@numFound='1']"
- ,"//*[@name='id'][.='1.0']");
+ ,"//*[@name='id'][.='1']");
try {
ignoreException("No\\ default\\, and no switch case");
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java b/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java
index 0ba716d..959386a 100644
--- a/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java
+++ b/solr/core/src/test/org/apache/solr/search/TestRangeQuery.java
@@ -135,8 +135,8 @@ public class TestRangeQuery extends SolrTestCaseJ4 {
// simple test of a function rather than just the field
assertQ(req("{!frange l=0 u=2}id"), "*[count(//doc)=3]");
- assertQ(req("{!frange l=0 u=2}product(id,2)"), "*[count(//doc)=2]");
- assertQ(req("{!frange l=100 u=102}sum(id,100)"), "*[count(//doc)=3]");
+ assertQ(req("{!frange l=0 u=2}product(id_i,2)"), "*[count(//doc)=2]");
+ assertQ(req("{!frange l=100 u=102}sum(id_i,100)"), "*[count(//doc)=3]");
for (Map.Entry<String,String[]> entry : norm_fields.entrySet()) {
[3/7] lucene-solr:master: SOLR-10834: Fixed tests and test configs to
stop using numeric uniqueKey fields
Posted by ho...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java
index 93cc294..0fd1a4a 100644
--- a/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestReRankQParserPlugin.java
@@ -93,12 +93,12 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("rows", "6");
params.add("df", "text");
assertQ(req(params), "*[count(//doc)=6]",
- "//result/doc[1]/float[@name='id'][.='3.0']",
- "//result/doc[2]/float[@name='id'][.='4.0']",
- "//result/doc[3]/float[@name='id'][.='2.0']",
- "//result/doc[4]/float[@name='id'][.='6.0']",
- "//result/doc[5]/float[@name='id'][.='1.0']",
- "//result/doc[6]/float[@name='id'][.='5.0']"
+ "//result/doc[1]/str[@name='id'][.='3']",
+ "//result/doc[2]/str[@name='id'][.='4']",
+ "//result/doc[3]/str[@name='id'][.='2']",
+ "//result/doc[4]/str[@name='id'][.='6']",
+ "//result/doc[5]/str[@name='id'][.='1']",
+ "//result/doc[6]/str[@name='id'][.='5']"
);
params = new ModifiableSolrParams();
@@ -113,12 +113,12 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("df", "text");
assertQ(req(params), "*[count(//doc)=6]",
- "//result/doc[1]/float[@name='id'][.='2.0']",
- "//result/doc[2]/float[@name='id'][.='6.0']",
- "//result/doc[3]/float[@name='id'][.='5.0']",
- "//result/doc[4]/float[@name='id'][.='4.0']",
- "//result/doc[5]/float[@name='id'][.='3.0']",
- "//result/doc[6]/float[@name='id'][.='1.0']"
+ "//result/doc[1]/str[@name='id'][.='2']",
+ "//result/doc[2]/str[@name='id'][.='6']",
+ "//result/doc[3]/str[@name='id'][.='5']",
+ "//result/doc[4]/str[@name='id'][.='4']",
+ "//result/doc[5]/str[@name='id'][.='3']",
+ "//result/doc[6]/str[@name='id'][.='1']"
);
//Test with sort by score.
@@ -134,12 +134,12 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("sort", "score desc");
params.add("df", "text");
assertQ(req(params), "*[count(//doc)=6]",
- "//result/doc[1]/float[@name='id'][.='2.0']",
- "//result/doc[2]/float[@name='id'][.='6.0']",
- "//result/doc[3]/float[@name='id'][.='5.0']",
- "//result/doc[4]/float[@name='id'][.='4.0']",
- "//result/doc[5]/float[@name='id'][.='3.0']",
- "//result/doc[6]/float[@name='id'][.='1.0']"
+ "//result/doc[1]/str[@name='id'][.='2']",
+ "//result/doc[2]/str[@name='id'][.='6']",
+ "//result/doc[3]/str[@name='id'][.='5']",
+ "//result/doc[4]/str[@name='id'][.='4']",
+ "//result/doc[5]/str[@name='id'][.='3']",
+ "//result/doc[6]/str[@name='id'][.='1']"
);
@@ -157,12 +157,12 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("df", "text");
assertQ(req(params), "*[count(//doc)=6]",
- "//result/doc[1]/float[@name='id'][.='2.0']",
- "//result/doc[2]/float[@name='id'][.='6.0']",
- "//result/doc[3]/float[@name='id'][.='5.0']",
- "//result/doc[4]/float[@name='id'][.='4.0']",
- "//result/doc[5]/float[@name='id'][.='3.0']",
- "//result/doc[6]/float[@name='id'][.='1.0']"
+ "//result/doc[1]/str[@name='id'][.='2']",
+ "//result/doc[2]/str[@name='id'][.='6']",
+ "//result/doc[3]/str[@name='id'][.='5']",
+ "//result/doc[4]/str[@name='id'][.='4']",
+ "//result/doc[5]/str[@name='id'][.='3']",
+ "//result/doc[6]/str[@name='id'][.='1']"
);
@@ -179,12 +179,12 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("qt", "/elevate");
params.add("elevateIds", "1");
assertQ(req(params), "*[count(//doc)=6]",
- "//result/doc[1]/float[@name='id'][.='1.0']",
- "//result/doc[2]/float[@name='id'][.='2.0']",
- "//result/doc[3]/float[@name='id'][.='6.0']",
- "//result/doc[4]/float[@name='id'][.='5.0']",
- "//result/doc[5]/float[@name='id'][.='4.0']",
- "//result/doc[6]/float[@name='id'][.='3.0']"
+ "//result/doc[1]/str[@name='id'][.='1']",
+ "//result/doc[2]/str[@name='id'][.='2']",
+ "//result/doc[3]/str[@name='id'][.='6']",
+ "//result/doc[4]/str[@name='id'][.='5']",
+ "//result/doc[5]/str[@name='id'][.='4']",
+ "//result/doc[6]/str[@name='id'][.='3']"
);
@@ -201,12 +201,12 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("df", "text");
assertQ(req(params), "*[count(//doc)=6]",
- "//result/doc[1]/float[@name='id'][.='2.0']",
- "//result/doc[2]/float[@name='id'][.='6.0']",
- "//result/doc[3]/float[@name='id'][.='5.0']",
- "//result/doc[4]/float[@name='id'][.='4.0']",
- "//result/doc[5]/float[@name='id'][.='3.0']",
- "//result/doc[6]/float[@name='id'][.='1.0']"
+ "//result/doc[1]/str[@name='id'][.='2']",
+ "//result/doc[2]/str[@name='id'][.='6']",
+ "//result/doc[3]/str[@name='id'][.='5']",
+ "//result/doc[4]/str[@name='id'][.='4']",
+ "//result/doc[5]/str[@name='id'][.='3']",
+ "//result/doc[6]/str[@name='id'][.='1']"
);
@@ -223,12 +223,12 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("elevateIds", "1,4");
assertQ(req(params), "*[count(//doc)=6]",
- "//result/doc[1]/float[@name='id'][.='1.0']", //Elevated
- "//result/doc[2]/float[@name='id'][.='4.0']", //Elevated
- "//result/doc[3]/float[@name='id'][.='2.0']", //Boosted during rerank.
- "//result/doc[4]/float[@name='id'][.='6.0']",
- "//result/doc[5]/float[@name='id'][.='5.0']",
- "//result/doc[6]/float[@name='id'][.='3.0']"
+ "//result/doc[1]/str[@name='id'][.='1']", //Elevated
+ "//result/doc[2]/str[@name='id'][.='4']", //Elevated
+ "//result/doc[3]/str[@name='id'][.='2']", //Boosted during rerank.
+ "//result/doc[4]/str[@name='id'][.='6']",
+ "//result/doc[5]/str[@name='id'][.='5']",
+ "//result/doc[6]/str[@name='id'][.='3']"
);
@@ -245,12 +245,12 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("elevateIds", "4,1");
assertQ(req(params), "*[count(//doc)=6]",
- "//result/doc[1]/float[@name='id'][.='4.0']", //Elevated
- "//result/doc[2]/float[@name='id'][.='1.0']", //Elevated
- "//result/doc[3]/float[@name='id'][.='2.0']", //Boosted during rerank.
- "//result/doc[4]/float[@name='id'][.='6.0']",
- "//result/doc[5]/float[@name='id'][.='5.0']",
- "//result/doc[6]/float[@name='id'][.='3.0']"
+ "//result/doc[1]/str[@name='id'][.='4']", //Elevated
+ "//result/doc[2]/str[@name='id'][.='1']", //Elevated
+ "//result/doc[3]/str[@name='id'][.='2']", //Boosted during rerank.
+ "//result/doc[4]/str[@name='id'][.='6']",
+ "//result/doc[5]/str[@name='id'][.='5']",
+ "//result/doc[6]/str[@name='id'][.='3']"
);
@@ -268,12 +268,12 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("elevateIds", "4,1");
assertQ(req(params), "*[count(//doc)=6]",
- "//result/doc[1]/float[@name='id'][.='4.0']", //Elevated
- "//result/doc[2]/float[@name='id'][.='1.0']", //Elevated
- "//result/doc[3]/float[@name='id'][.='6.0']",
- "//result/doc[4]/float[@name='id'][.='5.0']",
- "//result/doc[5]/float[@name='id'][.='3.0']",
- "//result/doc[6]/float[@name='id'][.='2.0']" //Not in reRankeDocs
+ "//result/doc[1]/str[@name='id'][.='4']", //Elevated
+ "//result/doc[2]/str[@name='id'][.='1']", //Elevated
+ "//result/doc[3]/str[@name='id'][.='6']",
+ "//result/doc[4]/str[@name='id'][.='5']",
+ "//result/doc[5]/str[@name='id'][.='3']",
+ "//result/doc[6]/str[@name='id'][.='2']" //Not in reRankeDocs
);
//Test Elevation with start beyond the rerank docs
@@ -289,8 +289,8 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("elevateIds", "4,1");
assertQ(req(params), "*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='3.0']",
- "//result/doc[2]/float[@name='id'][.='2.0']" //Was not in reRankDocs
+ "//result/doc[1]/str[@name='id'][.='3']",
+ "//result/doc[2]/str[@name='id'][.='2']" //Was not in reRankDocs
);
//Test Elevation with zero results
@@ -320,12 +320,12 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("rows", "10");
assertQ(req(params), "*[count(//doc)=6]",
- "//result/doc[1]/float[@name='id'][.='6.0']",
- "//result/doc[2]/float[@name='id'][.='5.0']",
- "//result/doc[3]/float[@name='id'][.='4.0']",
- "//result/doc[4]/float[@name='id'][.='3.0']",
- "//result/doc[5]/float[@name='id'][.='2.0']",
- "//result/doc[6]/float[@name='id'][.='1.0']"
+ "//result/doc[1]/str[@name='id'][.='6']",
+ "//result/doc[2]/str[@name='id'][.='5']",
+ "//result/doc[3]/str[@name='id'][.='4']",
+ "//result/doc[4]/str[@name='id'][.='3']",
+ "//result/doc[5]/str[@name='id'][.='2']",
+ "//result/doc[6]/str[@name='id'][.='1']"
);
params = new ModifiableSolrParams();
@@ -338,12 +338,12 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("rows", "10");
assertQ(req(params), "*[count(//doc)=6]",
- "//result/doc[1]/float[@name='id'][.='6.0']",
- "//result/doc[2]/float[@name='id'][.='5.0']",
- "//result/doc[3]/float[@name='id'][.='4.0']",
- "//result/doc[4]/float[@name='id'][.='3.0']",
- "//result/doc[5]/float[@name='id'][.='2.0']",
- "//result/doc[6]/float[@name='id'][.='1.0']"
+ "//result/doc[1]/str[@name='id'][.='6']",
+ "//result/doc[2]/str[@name='id'][.='5']",
+ "//result/doc[3]/str[@name='id'][.='4']",
+ "//result/doc[4]/str[@name='id'][.='3']",
+ "//result/doc[5]/str[@name='id'][.='2']",
+ "//result/doc[6]/str[@name='id'][.='1']"
);
params = new ModifiableSolrParams();
@@ -356,12 +356,12 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("rows", "10");
assertQ(req(params), "*[count(//doc)=6]",
- "//result/doc[1]/float[@name='id'][.='5.0']",
- "//result/doc[2]/float[@name='id'][.='6.0']",
- "//result/doc[3]/float[@name='id'][.='4.0']",
- "//result/doc[4]/float[@name='id'][.='3.0']",
- "//result/doc[5]/float[@name='id'][.='2.0']",
- "//result/doc[6]/float[@name='id'][.='1.0']"
+ "//result/doc[1]/str[@name='id'][.='5']",
+ "//result/doc[2]/str[@name='id'][.='6']",
+ "//result/doc[3]/str[@name='id'][.='4']",
+ "//result/doc[4]/str[@name='id'][.='3']",
+ "//result/doc[5]/str[@name='id'][.='2']",
+ "//result/doc[6]/str[@name='id'][.='1']"
);
//Test reRankWeight of 0, reranking will have no effect.
@@ -375,11 +375,11 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("rows", "5");
assertQ(req(params), "*[count(//doc)=5]",
- "//result/doc[1]/float[@name='id'][.='6.0']",
- "//result/doc[2]/float[@name='id'][.='5.0']",
- "//result/doc[3]/float[@name='id'][.='4.0']",
- "//result/doc[4]/float[@name='id'][.='3.0']",
- "//result/doc[5]/float[@name='id'][.='2.0']"
+ "//result/doc[1]/str[@name='id'][.='6']",
+ "//result/doc[2]/str[@name='id'][.='5']",
+ "//result/doc[3]/str[@name='id'][.='4']",
+ "//result/doc[4]/str[@name='id'][.='3']",
+ "//result/doc[5]/str[@name='id'][.='2']"
);
MetricsMap metrics = (MetricsMap)h.getCore().getCoreMetricManager().getRegistry().getMetrics().get("CACHE.searcher.queryResultCache");
@@ -399,11 +399,11 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("rows", "6");
assertQ(req(params), "*[count(//doc)=5]",
- "//result/doc[1]/float[@name='id'][.='6.0']",
- "//result/doc[2]/float[@name='id'][.='5.0']",
- "//result/doc[3]/float[@name='id'][.='4.0']",
- "//result/doc[4]/float[@name='id'][.='2.0']",
- "//result/doc[5]/float[@name='id'][.='1.0']"
+ "//result/doc[1]/str[@name='id'][.='6']",
+ "//result/doc[2]/str[@name='id'][.='5']",
+ "//result/doc[3]/str[@name='id'][.='4']",
+ "//result/doc[4]/str[@name='id'][.='2']",
+ "//result/doc[5]/str[@name='id'][.='1']"
);
@@ -424,11 +424,11 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("rows", "6");
assertQ(req(params), "*[count(//doc)=5]",
- "//result/doc[1]/float[@name='id'][.='6.0']",
- "//result/doc[2]/float[@name='id'][.='5.0']",
- "//result/doc[3]/float[@name='id'][.='4.0']",
- "//result/doc[4]/float[@name='id'][.='2.0']",
- "//result/doc[5]/float[@name='id'][.='1.0']"
+ "//result/doc[1]/str[@name='id'][.='6']",
+ "//result/doc[2]/str[@name='id'][.='5']",
+ "//result/doc[3]/str[@name='id'][.='4']",
+ "//result/doc[4]/str[@name='id'][.='2']",
+ "//result/doc[5]/str[@name='id'][.='1']"
);
stats = metrics.getValue();
@@ -441,7 +441,7 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params = new ModifiableSolrParams();
params.add("rq", "{!"+ReRankQParserPlugin.NAME+" "+ReRankQParserPlugin.RERANK_QUERY+"=$rqq "+ReRankQParserPlugin.RERANK_DOCS+"=6}");
// function query for predictible scores (relative to id) independent of similarity
- params.add("q", "{!func}id");
+ params.add("q", "{!func}id_i");
// constant score for each clause (unique per doc) for predictible scores independent of similarity
// NOTE: biased in favor of doc id == 2
params.add("rqq", "id:1^=10 id:2^=40 id:3^=30 id:4^=40 id:5^=50 id:6^=60");
@@ -450,12 +450,12 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("rows", "6");
assertQ(req(params), "*[count(//doc)=6]",
- "//result/doc[1]/float[@name='id'][.='6.0']",
- "//result/doc[2]/float[@name='id'][.='5.0']",
- "//result/doc[3]/float[@name='id'][.='4.0']",
- "//result/doc[4]/float[@name='id'][.='2.0']", // reranked out of orig order
- "//result/doc[5]/float[@name='id'][.='3.0']",
- "//result/doc[6]/float[@name='id'][.='1.0']"
+ "//result/doc[1]/str[@name='id'][.='6']",
+ "//result/doc[2]/str[@name='id'][.='5']",
+ "//result/doc[3]/str[@name='id'][.='4']",
+ "//result/doc[4]/str[@name='id'][.='2']", // reranked out of orig order
+ "//result/doc[5]/str[@name='id'][.='3']",
+ "//result/doc[6]/str[@name='id'][.='1']"
);
@@ -469,8 +469,8 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("rows", "5");
assertQ(req(params), "*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='2.0']",
- "//result/doc[2]/float[@name='id'][.='1.0']"
+ "//result/doc[1]/str[@name='id'][.='2']",
+ "//result/doc[2]/str[@name='id'][.='1']"
);
@@ -485,7 +485,7 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("rows", "1");
assertQ(req(params), "*[count(//doc)=1]",
- "//result/doc[1]/float[@name='id'][.='1.0']"
+ "//result/doc[1]/str[@name='id'][.='1']"
);
@@ -556,8 +556,8 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("df", "text");
assertQ(req(params), "*[count(//doc)=2]",
- "//result/doc[1]/float[@name='id'][.='8.0']",
- "//result/doc[2]/float[@name='id'][.='2.0']"
+ "//result/doc[1]/str[@name='id'][.='8']",
+ "//result/doc[2]/str[@name='id'][.='2']"
);
//Test Elevation
@@ -573,9 +573,9 @@ public class TestReRankQParserPlugin extends SolrTestCaseJ4 {
params.add("elevateIds", "1,4");
assertQ(req(params), "*[count(//doc)=3]",
- "//result/doc[1]/float[@name='id'][.='1.0']", //Elevated
- "//result/doc[2]/float[@name='id'][.='4.0']", //Elevated
- "//result/doc[3]/float[@name='id'][.='8.0']"); //Boosted during rerank.
+ "//result/doc[1]/str[@name='id'][.='1']", //Elevated
+ "//result/doc[2]/str[@name='id'][.='4']", //Elevated
+ "//result/doc[3]/str[@name='id'][.='8']"); //Boosted during rerank.
}
@Test
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/TestReload.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestReload.java b/solr/core/src/test/org/apache/solr/search/TestReload.java
index f721d41..872abec 100644
--- a/solr/core/src/test/org/apache/solr/search/TestReload.java
+++ b/solr/core/src/test/org/apache/solr/search/TestReload.java
@@ -98,4 +98,4 @@ public class TestReload extends TestRTGBase {
// test framework should ensure that all searchers opened have been closed.
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/TestSearchPerf.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestSearchPerf.java b/solr/core/src/test/org/apache/solr/search/TestSearchPerf.java
index a4b506b..4c63309 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSearchPerf.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSearchPerf.java
@@ -246,4 +246,4 @@ public class TestSearchPerf extends AbstractSolrTestCase {
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java b/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
index 4b82e62..21bf2c7 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSolrQueryParser.java
@@ -1074,4 +1074,4 @@ public class TestSolrQueryParser extends SolrTestCaseJ4 {
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/facet/DebugAgg.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/facet/DebugAgg.java b/solr/core/src/test/org/apache/solr/search/facet/DebugAgg.java
index b8dbf2a..d1be4fe 100644
--- a/solr/core/src/test/org/apache/solr/search/facet/DebugAgg.java
+++ b/solr/core/src/test/org/apache/solr/search/facet/DebugAgg.java
@@ -142,4 +142,4 @@ public class DebugAgg extends AggValueSource {
return new FacetLongMerger();
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java b/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java
index 58a1b53..ada1208 100644
--- a/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java
+++ b/solr/core/src/test/org/apache/solr/search/function/SortByFunctionTest.java
@@ -49,51 +49,51 @@ public class SortByFunctionTest extends AbstractSolrTestCase {
assertQ(req("fl", "*,score", "q", "*:*"),
"//*[@numFound='4']",
"//float[@name='score']='1.0'",
- "//result/doc[1]/int[@name='id'][.='1']",
- "//result/doc[2]/int[@name='id'][.='2']",
- "//result/doc[3]/int[@name='id'][.='3']",
- "//result/doc[4]/int[@name='id'][.='4']"
+ "//result/doc[1]/str[@name='id'][.='1']",
+ "//result/doc[2]/str[@name='id'][.='2']",
+ "//result/doc[3]/str[@name='id'][.='3']",
+ "//result/doc[4]/str[@name='id'][.='4']"
);
assertQ(req("fl", "*,score", "q", "*:*", "sort", "score desc"),
"//*[@numFound='4']",
"//float[@name='score']='1.0'",
- "//result/doc[1]/int[@name='id'][.='1']",
- "//result/doc[2]/int[@name='id'][.='2']",
- "//result/doc[3]/int[@name='id'][.='3']",
- "//result/doc[4]/int[@name='id'][.='4']"
+ "//result/doc[1]/str[@name='id'][.='1']",
+ "//result/doc[2]/str[@name='id'][.='2']",
+ "//result/doc[3]/str[@name='id'][.='3']",
+ "//result/doc[4]/str[@name='id'][.='4']"
);
assertQ(req("fl", "id,score", "q", "f_t:ipod", "sort", "score desc"),
"//*[@numFound='4']",
- "//result/doc[1]/int[@name='id'][.='1']",
- "//result/doc[2]/int[@name='id'][.='2']",
- "//result/doc[3]/int[@name='id'][.='3']",
- "//result/doc[4]/int[@name='id'][.='4']"
+ "//result/doc[1]/str[@name='id'][.='1']",
+ "//result/doc[2]/str[@name='id'][.='2']",
+ "//result/doc[3]/str[@name='id'][.='3']",
+ "//result/doc[4]/str[@name='id'][.='4']"
);
assertQ(req("fl", "*,score", "q", "*:*", "sort", "sum(x_td1, y_td1) desc"),
"//*[@numFound='4']",
"//float[@name='score']='1.0'",
- "//result/doc[1]/int[@name='id'][.='4']",
- "//result/doc[2]/int[@name='id'][.='3']",
- "//result/doc[3]/int[@name='id'][.='2']",
- "//result/doc[4]/int[@name='id'][.='1']"
+ "//result/doc[1]/str[@name='id'][.='4']",
+ "//result/doc[2]/str[@name='id'][.='3']",
+ "//result/doc[3]/str[@name='id'][.='2']",
+ "//result/doc[4]/str[@name='id'][.='1']"
);
assertQ(req("fl", "*,score", "q", "*:*", "sort", "sum(x_td1, y_td1) asc"),
"//*[@numFound='4']",
"//float[@name='score']='1.0'",
- "//result/doc[1]/int[@name='id'][.='1']",
- "//result/doc[2]/int[@name='id'][.='2']",
- "//result/doc[3]/int[@name='id'][.='3']",
- "//result/doc[4]/int[@name='id'][.='4']"
+ "//result/doc[1]/str[@name='id'][.='1']",
+ "//result/doc[2]/str[@name='id'][.='2']",
+ "//result/doc[3]/str[@name='id'][.='3']",
+ "//result/doc[4]/str[@name='id'][.='4']"
);
//the function is equal, w_td1 separates
assertQ(req("q", "*:*", "fl", "id", "sort", "sum(z_td1, y_td1) asc, w_td1 asc"),
"//*[@numFound='4']",
- "//result/doc[1]/int[@name='id'][.='2']",
- "//result/doc[2]/int[@name='id'][.='1']",
- "//result/doc[3]/int[@name='id'][.='4']",
- "//result/doc[4]/int[@name='id'][.='3']"
+ "//result/doc[1]/str[@name='id'][.='2']",
+ "//result/doc[2]/str[@name='id'][.='1']",
+ "//result/doc[3]/str[@name='id'][.='4']",
+ "//result/doc[4]/str[@name='id'][.='3']"
);
}
@@ -108,24 +108,24 @@ public class SortByFunctionTest extends AbstractSolrTestCase {
assertQ(req("q", "links_mfacet:B", "fl", "id", "sort", "id asc"),
"//*[@numFound='2']",
- "//result/doc[1]/int[@name='id'][.='3']",
- "//result/doc[2]/int[@name='id'][.='4']"
+ "//result/doc[1]/str[@name='id'][.='3']",
+ "//result/doc[2]/str[@name='id'][.='4']"
);
assertQ(req("q", "*:*", "fl", "id", "sort", "joindf(id_s1, links_mfacet) desc"),
"//*[@numFound='4']",
- "//result/doc[1]/int[@name='id'][.='1']",
- "//result/doc[2]/int[@name='id'][.='2']",
- "//result/doc[3]/int[@name='id'][.='3']",
- "//result/doc[4]/int[@name='id'][.='4']"
+ "//result/doc[1]/str[@name='id'][.='1']",
+ "//result/doc[2]/str[@name='id'][.='2']",
+ "//result/doc[3]/str[@name='id'][.='3']",
+ "//result/doc[4]/str[@name='id'][.='4']"
);
assertQ(req("q", "*:*", "fl", "id", "sort", "joindf(id_s1, links_mfacet) asc"),
"//*[@numFound='4']",
- "//result/doc[1]/int[@name='id'][.='4']",
- "//result/doc[2]/int[@name='id'][.='3']",
- "//result/doc[3]/int[@name='id'][.='2']",
- "//result/doc[4]/int[@name='id'][.='1']"
+ "//result/doc[1]/str[@name='id'][.='4']",
+ "//result/doc[2]/str[@name='id'][.='3']",
+ "//result/doc[3]/str[@name='id'][.='2']",
+ "//result/doc[4]/str[@name='id'][.='1']"
);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java b/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
index 675123c..f19e4b0 100644
--- a/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
+++ b/solr/core/src/test/org/apache/solr/search/function/TestFunctionQuery.java
@@ -59,10 +59,10 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
}
- void createIndex(String field, float... values) {
+ void createIndex(String field, int... values) {
// lrf.args.put("version","2.0");
- for (float val : values) {
- String s = Float.toString(val);
+ for (int val : values) {
+ String s = Integer.toString(val);
if (field!=null) assertU(adoc("id", s, field, s));
else assertU(adoc("id", s));
@@ -98,6 +98,10 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
}
protected void singleTest(String field, String funcTemplate, List<String> args, float... results) {
+ // NOTE: we're abusing the "results" float[] here ...
+ // - even elements are ids which must be valid 'ints'
+ // - odd elements are the expected score values
+
String parseableQuery = func(field, funcTemplate);
List<String> nargs = new ArrayList<>(Arrays.asList("q", parseableQuery
@@ -113,13 +117,12 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
List<String> tests = new ArrayList<>();
- // Construct xpaths like the following:
- // "//doc[./float[@name='foo_f']='10.0' and ./float[@name='score']='10.0']"
-
for (int i=0; i<results.length; i+=2) {
- String xpath = "//doc[./float[@name='" + "id" + "']='"
- + results[i] + "' and ./float[@name='score']='"
- + results[i+1] + "']";
+ final int id = (int) results[i];
+ assert ((float) id) == results[i];
+
+ String xpath = "//doc[./str[@name='id']='" + id + "' "
+ + " and ./float[@name='score']='" + results[i+1] + "']";
tests.add(xpath);
}
@@ -134,9 +137,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
void doTest(String field) {
// lrf.args.put("version","2.0");
- float[] vals = new float[] {
- 100,-4,0,10,25,5
- };
+ int[] vals = { 100,-4,0,10,25,5 };
createIndex(field,vals);
createIndex(null, 88); // id with no value
@@ -208,7 +209,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
public void testExternalField() throws Exception {
String field = "foo_extf";
- float[] ids = {100,-4,0,10,25,5,77,23,55,-78,-45,-24,63,78,94,22,34,54321,261,-627};
+ int[] ids = {100,-4,0,10,25,5,77,23,55,-78,-45,-24,63,78,94,22,34,54321,261,-627};
createIndex(null,ids);
@@ -236,7 +237,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
// shuffle ids
for (int j=0; j<ids.length; j++) {
int other=r.nextInt(ids.length);
- float v=ids[0];
+ int v=ids[0];
ids[0] = ids[other];
ids[other] = v;
}
@@ -391,8 +392,8 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
// test that sorting by function query weights correctly. superman should sort higher than batman due to idf of the whole index
assertQ(req("q", "*:*", "fq","id:120 OR id:121", "sort","{!func v=$sortfunc} desc", "sortfunc","query($qq)", "qq","text:(batman OR superman)")
- ,"*//doc[1]/float[.='120.0']"
- ,"*//doc[2]/float[.='121.0']"
+ ,"*//doc[1]/str[.='120']"
+ ,"*//doc[2]/str[.='121']"
);
}
@@ -503,7 +504,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
String threeonetwo = "/response/docs==[{'x_i':200},{'x_i':100},{'x_i':300}]";
- String q = "id:[1 TO 3]";
+ String q = "id_i:[1 TO 3]";
assertJQ(req("q",q, "fl","x_i", "sort","add(x_i,x_i) desc")
,desc
);
@@ -681,7 +682,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
String field = "CoMpleX fieldName _extf";
String fieldAsFunc = "field(\"CoMpleX fieldName _extf\")";
- float[] ids = {100,-4,0,10,25,5,77,23,55,-78,-45,-24,63,78,94,22,34,54321,261,-627};
+ int[] ids = {100,-4,0,10,25,5,77,23,55,-78,-45,-24,63,78,94,22,34,54321,261,-627};
createIndex(null,ids);
@@ -716,7 +717,7 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
String field = "CoMpleX \" fieldName _f";
String fieldAsFunc = "field(\"CoMpleX \\\" fieldName _f\")";
- float[] ids = {100,-4,0,10,25,5,77,1};
+ int[] ids = {100,-4,0,10,25,5,77,1};
createIndex(field, ids);
@@ -762,8 +763,8 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
// def(), the default function that returns the first value that exists
- assertJQ(req("q", "id:1", "fl", "x:def(id,testfunc(123.0)), y:def(foo_f,234.0)")
- , "/response/docs/[0]=={'x':1.0, 'y':234.0}");
+ assertJQ(req("q", "id:1", "fl", "x:def(id,testfunc(123)), y:def(foo_f,234.0)")
+ , "/response/docs/[0]=={'x':'1', 'y':234.0}");
assertJQ(req("q", "id:1", "fl", "x:def(foo_s,'Q'), y:def(missing_s,'W')")
, "/response/docs/[0]=={'x':'A', 'y':'W'}");
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java b/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java
index f725994..7ec690f 100644
--- a/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java
+++ b/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java
@@ -372,8 +372,8 @@ public class TestMinMaxOnMultiValuedField extends SolrTestCaseJ4 {
"sort", func + " " + dir)
,"//*[@numFound='2']"
// no assumptions about order for now, see bug: SOLR-8005
- ,"//float[@name='id']='1.0'"
- ,"//float[@name='id']='2.0'"
+ ,"//str[@name='id']='1'"
+ ,"//str[@name='id']='2'"
);
}
}
@@ -430,7 +430,7 @@ public class TestMinMaxOnMultiValuedField extends SolrTestCaseJ4 {
assertQ(sort,
req("q","*:*", "rows", ""+numDocs, "sort", sort)
,"//result[@numFound='"+numDocs+"']"
- ,"//result/doc[1]/float[@name='id']='0.0'"
+ ,"//result/doc[1]/str[@name='id']='0'"
);
}
/** helper for testSimpleSort */
@@ -438,7 +438,7 @@ public class TestMinMaxOnMultiValuedField extends SolrTestCaseJ4 {
assertQ(sort,
req("q","*:*", "rows", ""+numDocs, "sort", sort)
,"//result[@numFound='"+numDocs+"']"
- ,"//result/doc["+numDocs+"]/float[@name='id']='0.0'"
+ ,"//result/doc["+numDocs+"]/str[@name='id']='0'"
);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/mlt/SimpleMLTQParserTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/mlt/SimpleMLTQParserTest.java b/solr/core/src/test/org/apache/solr/search/mlt/SimpleMLTQParserTest.java
index 026c594..c773aa8 100644
--- a/solr/core/src/test/org/apache/solr/search/mlt/SimpleMLTQParserTest.java
+++ b/solr/core/src/test/org/apache/solr/search/mlt/SimpleMLTQParserTest.java
@@ -80,69 +80,69 @@ public class SimpleMLTQParserTest extends SolrTestCaseJ4 {
ModifiableSolrParams params = new ModifiableSolrParams();
params.set(CommonParams.Q, "{!mlt qf=lowerfilt}17");
assertQ(req(params),
- "//result/doc[1]/int[@name='id'][.='13']",
- "//result/doc[2]/int[@name='id'][.='14']",
- "//result/doc[3]/int[@name='id'][.='15']",
- "//result/doc[4]/int[@name='id'][.='16']",
- "//result/doc[5]/int[@name='id'][.='18']",
- "//result/doc[6]/int[@name='id'][.='19']",
- "//result/doc[7]/int[@name='id'][.='20']",
- "//result/doc[8]/int[@name='id'][.='21']",
- "//result/doc[9]/int[@name='id'][.='22']",
- "//result/doc[10]/int[@name='id'][.='23']"
+ "//result/doc[1]/str[@name='id'][.='13']",
+ "//result/doc[2]/str[@name='id'][.='14']",
+ "//result/doc[3]/str[@name='id'][.='15']",
+ "//result/doc[4]/str[@name='id'][.='16']",
+ "//result/doc[5]/str[@name='id'][.='18']",
+ "//result/doc[6]/str[@name='id'][.='19']",
+ "//result/doc[7]/str[@name='id'][.='20']",
+ "//result/doc[8]/str[@name='id'][.='21']",
+ "//result/doc[9]/str[@name='id'][.='22']",
+ "//result/doc[10]/str[@name='id'][.='23']"
);
params = new ModifiableSolrParams();
params.set(CommonParams.Q, "{!mlt qf=lowerfilt boost=true}17");
assertQ(req(params),
- "//result/doc[1]/int[@name='id'][.='13']",
- "//result/doc[2]/int[@name='id'][.='14']",
- "//result/doc[3]/int[@name='id'][.='15']",
- "//result/doc[4]/int[@name='id'][.='16']",
- "//result/doc[5]/int[@name='id'][.='18']",
- "//result/doc[6]/int[@name='id'][.='19']",
- "//result/doc[7]/int[@name='id'][.='20']",
- "//result/doc[8]/int[@name='id'][.='21']",
- "//result/doc[9]/int[@name='id'][.='22']",
- "//result/doc[10]/int[@name='id'][.='23']"
+ "//result/doc[1]/str[@name='id'][.='13']",
+ "//result/doc[2]/str[@name='id'][.='14']",
+ "//result/doc[3]/str[@name='id'][.='15']",
+ "//result/doc[4]/str[@name='id'][.='16']",
+ "//result/doc[5]/str[@name='id'][.='18']",
+ "//result/doc[6]/str[@name='id'][.='19']",
+ "//result/doc[7]/str[@name='id'][.='20']",
+ "//result/doc[8]/str[@name='id'][.='21']",
+ "//result/doc[9]/str[@name='id'][.='22']",
+ "//result/doc[10]/str[@name='id'][.='23']"
);
params = new ModifiableSolrParams();
params.set(CommonParams.Q, "{!mlt qf=lowerfilt,lowerfilt1^1000 boost=false mintf=0 mindf=0}30");
assertQ(req(params),
- "//result/doc[1]/int[@name='id'][.='31']",
- "//result/doc[2]/int[@name='id'][.='13']",
- "//result/doc[3]/int[@name='id'][.='14']",
- "//result/doc[4]/int[@name='id'][.='18']",
- "//result/doc[5]/int[@name='id'][.='20']",
- "//result/doc[6]/int[@name='id'][.='22']",
- "//result/doc[7]/int[@name='id'][.='23']",
- "//result/doc[8]/int[@name='id'][.='32']",
- "//result/doc[9]/int[@name='id'][.='15']",
- "//result/doc[10]/int[@name='id'][.='16']"
+ "//result/doc[1]/str[@name='id'][.='31']",
+ "//result/doc[2]/str[@name='id'][.='13']",
+ "//result/doc[3]/str[@name='id'][.='14']",
+ "//result/doc[4]/str[@name='id'][.='18']",
+ "//result/doc[5]/str[@name='id'][.='20']",
+ "//result/doc[6]/str[@name='id'][.='22']",
+ "//result/doc[7]/str[@name='id'][.='23']",
+ "//result/doc[8]/str[@name='id'][.='32']",
+ "//result/doc[9]/str[@name='id'][.='15']",
+ "//result/doc[10]/str[@name='id'][.='16']"
);
params = new ModifiableSolrParams();
params.set(CommonParams.Q, "{!mlt qf=lowerfilt,lowerfilt1^1000 boost=true mintf=0 mindf=0}30");
assertQ(req(params),
- "//result/doc[1]/int[@name='id'][.='29']",
- "//result/doc[2]/int[@name='id'][.='31']",
- "//result/doc[3]/int[@name='id'][.='32']",
- "//result/doc[4]/int[@name='id'][.='13']",
- "//result/doc[5]/int[@name='id'][.='14']",
- "//result/doc[6]/int[@name='id'][.='18']",
- "//result/doc[7]/int[@name='id'][.='20']",
- "//result/doc[8]/int[@name='id'][.='22']",
- "//result/doc[9]/int[@name='id'][.='23']",
- "//result/doc[10]/int[@name='id'][.='15']"
+ "//result/doc[1]/str[@name='id'][.='29']",
+ "//result/doc[2]/str[@name='id'][.='31']",
+ "//result/doc[3]/str[@name='id'][.='32']",
+ "//result/doc[4]/str[@name='id'][.='13']",
+ "//result/doc[5]/str[@name='id'][.='14']",
+ "//result/doc[6]/str[@name='id'][.='18']",
+ "//result/doc[7]/str[@name='id'][.='20']",
+ "//result/doc[8]/str[@name='id'][.='22']",
+ "//result/doc[9]/str[@name='id'][.='23']",
+ "//result/doc[10]/str[@name='id'][.='15']"
);
params = new ModifiableSolrParams();
params.set(CommonParams.Q, "{!mlt qf=lowerfilt mindf=0 mintf=1}26");
assertQ(req(params),
- "//result/doc[1]/int[@name='id'][.='29']",
- "//result/doc[2]/int[@name='id'][.='27']",
- "//result/doc[3]/int[@name='id'][.='28']"
+ "//result/doc[1]/str[@name='id'][.='29']",
+ "//result/doc[2]/str[@name='id'][.='27']",
+ "//result/doc[3]/str[@name='id'][.='28']"
);
params = new ModifiableSolrParams();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java b/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java
index c355932..cac2dc5 100644
--- a/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java
+++ b/solr/core/src/test/org/apache/solr/search/stats/TestDistribIDF.java
@@ -78,14 +78,14 @@ public class TestDistribIDF extends SolrTestCaseJ4 {
createCollection("onecollection_local", "conf2", ImplicitDocRouter.NAME);
SolrInputDocument doc = new SolrInputDocument();
- doc.setField("id", 1);
+ doc.setField("id", "1");
doc.setField("cat", "football");
doc.addField(ShardParams._ROUTE_, "a");
solrCluster.getSolrClient().add("onecollection", doc);
solrCluster.getSolrClient().add("onecollection_local", doc);
doc = new SolrInputDocument();
- doc.setField("id", 2);
+ doc.setField("id", "2");
doc.setField("cat", "football");
doc.addField(ShardParams._ROUTE_, "b");
solrCluster.getSolrClient().add("onecollection", doc);
@@ -94,7 +94,7 @@ public class TestDistribIDF extends SolrTestCaseJ4 {
int nDocs = TestUtil.nextInt(random(), 10, 100);
for (int i=0; i<nDocs; i++) {
doc = new SolrInputDocument();
- doc.setField("id", 3 + i);
+ doc.setField("id", "" + (3 + i));
String cat = TestUtil.randomSimpleString(random());
if (!cat.equals("football")) { //Making sure no other document has the query term in it.
doc.setField("cat", cat);
@@ -129,8 +129,8 @@ public class TestDistribIDF extends SolrTestCaseJ4 {
query.setFields("*,score");
queryResponse = solrClient_local.query("onecollection_local", query);
assertEquals(2, queryResponse.getResults().getNumFound());
- assertEquals(2, queryResponse.getResults().get(0).get("id"));
- assertEquals(1, queryResponse.getResults().get(1).get("id"));
+ assertEquals("2", queryResponse.getResults().get(0).get("id"));
+ assertEquals("1", queryResponse.getResults().get(1).get("id"));
float score1_local = (float) queryResponse.getResults().get(0).get("score");
float score2_local = (float) queryResponse.getResults().get(1).get("score");
assertEquals("Doc1 score=" + score1_local + " Doc2 score=" + score2_local, 1,
@@ -176,8 +176,8 @@ public class TestDistribIDF extends SolrTestCaseJ4 {
query.setFields("*,score").add("collection", "collection1_local,collection2_local");
queryResponse = solrClient_local.query("collection1_local", query);
assertEquals(2, queryResponse.getResults().getNumFound());
- assertEquals(2, queryResponse.getResults().get(0).get("id"));
- assertEquals(1, queryResponse.getResults().get(1).get("id"));
+ assertEquals("2", queryResponse.getResults().get(0).get("id"));
+ assertEquals("1", queryResponse.getResults().get(1).get("id"));
float score1_local = (float) queryResponse.getResults().get(0).get("score");
float score2_local = (float) queryResponse.getResults().get(1).get("score");
assertEquals("Doc1 score=" + score1_local + " Doc2 score=" + score2_local, 1,
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/security/MockAuthorizationPlugin.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/security/MockAuthorizationPlugin.java b/solr/core/src/test/org/apache/solr/security/MockAuthorizationPlugin.java
index 1cbe849..17091ab 100644
--- a/solr/core/src/test/org/apache/solr/security/MockAuthorizationPlugin.java
+++ b/solr/core/src/test/org/apache/solr/security/MockAuthorizationPlugin.java
@@ -61,4 +61,4 @@ public class MockAuthorizationPlugin implements AuthorizationPlugin {
public void close() throws IOException {
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/servlet/NoCacheHeaderTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/servlet/NoCacheHeaderTest.java b/solr/core/src/test/org/apache/solr/servlet/NoCacheHeaderTest.java
index 7f2fe73..d886f17 100644
--- a/solr/core/src/test/org/apache/solr/servlet/NoCacheHeaderTest.java
+++ b/solr/core/src/test/org/apache/solr/servlet/NoCacheHeaderTest.java
@@ -172,4 +172,4 @@ public class NoCacheHeaderTest extends CacheHeaderTestBase {
head = response.getFirstHeader("Expires");
assertNull("We got an Expires header in response", head);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java b/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java
index a9eefdc..9168741 100644
--- a/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java
+++ b/solr/core/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java
@@ -16,8 +16,6 @@
*/
package org.apache.solr.spelling.suggest;
-import java.io.File;
-
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.params.SpellingParams;
import org.apache.solr.common.util.NamedList;
@@ -76,25 +74,18 @@ public class SuggesterTest extends SolrTestCaseJ4 {
@Test
public void testReload() throws Exception {
- String leaveData = System.getProperty("solr.test.leavedatadir");
- if (leaveData == null) leaveData = "";
- System.setProperty("solr.test.leavedatadir", "true");
addDocs();
assertU(commit());
- File data = initCoreDataDir;
- String config = configString;
- deleteCore();
- initCoreDataDir = data;
- configString = config;
- initCore();
+
+ h.reload();
+ // wait until the new searcher is registered
+ waitForWarming();
+
assertQ(req("qt", requestUri, "q", "ac", SpellingParams.SPELLCHECK_COUNT, "2", SpellingParams.SPELLCHECK_ONLY_MORE_POPULAR, "true"),
"//lst[@name='spellcheck']/lst[@name='suggestions']/lst[@name='ac']/int[@name='numFound'][.='2']",
"//lst[@name='spellcheck']/lst[@name='suggestions']/lst[@name='ac']/arr[@name='suggestion']/str[1][.='acquire']",
"//lst[@name='spellcheck']/lst[@name='suggestions']/lst[@name='ac']/arr[@name='suggestion']/str[2][.='accommodate']"
);
-
- // restore the property
- System.setProperty("solr.test.leavedatadir", leaveData);
}
@Test
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/spelling/suggest/TestAnalyzeInfixSuggestions.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/spelling/suggest/TestAnalyzeInfixSuggestions.java b/solr/core/src/test/org/apache/solr/spelling/suggest/TestAnalyzeInfixSuggestions.java
index ed8e812..321e9ad 100644
--- a/solr/core/src/test/org/apache/solr/spelling/suggest/TestAnalyzeInfixSuggestions.java
+++ b/solr/core/src/test/org/apache/solr/spelling/suggest/TestAnalyzeInfixSuggestions.java
@@ -114,4 +114,4 @@ public class TestAnalyzeInfixSuggestions extends SolrTestCaseJ4 {
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/spelling/suggest/TestFreeTextSuggestions.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/spelling/suggest/TestFreeTextSuggestions.java b/solr/core/src/test/org/apache/solr/spelling/suggest/TestFreeTextSuggestions.java
index a091235..f304f8e 100644
--- a/solr/core/src/test/org/apache/solr/spelling/suggest/TestFreeTextSuggestions.java
+++ b/solr/core/src/test/org/apache/solr/spelling/suggest/TestFreeTextSuggestions.java
@@ -54,4 +54,4 @@ public class TestFreeTextSuggestions extends SolrTestCaseJ4 {
);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdatesTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdatesTest.java b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdatesTest.java
index bfcf015..19780df 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdatesTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdatesTest.java
@@ -1043,19 +1043,19 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
assertU(commit());
assertJQ(req("q", "id:2"),
- "/response/docs/[0]/id==2",
+ "/response/docs/[0]/id=='2'",
"/response/docs/[0]/title/[0]=='newtitle2'",
"/response/docs/[0]/single_i_dvo==101");
assertJQ(req("q", "id:3"),
1e-4,
- "/response/docs/[0]/id==3",
+ "/response/docs/[0]/id=='3'",
"/response/docs/[0]/title/[0]=='newtitle3'",
"/response/docs/[0]/single_d_dvo==4.14");
assertJQ(req("q", "id:4"),
1e-4,
- "/response/docs/[0]/id==4",
+ "/response/docs/[0]/id=='4'",
"/response/docs/[0]/single_s_dvo=='abc'",
"/response/docs/[0]/single_i_dvo==2");
@@ -1064,7 +1064,7 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
assertU(commit());
assertJQ(req("q", "id:3"),
1e-4,
- "/response/docs/[0]/id==3",
+ "/response/docs/[0]/id=='3'",
"/response/docs/[0]/title/[0]=='newertitle3'",
"/response/docs/[0]/single_d_dvo==4.14");
}
@@ -1079,7 +1079,7 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
// test that non stored multivalued docvalues was carried forward for a non docvalues update
assertJQ(req("q", "id:1"),
- "/response/docs/[0]/id==1",
+ "/response/docs/[0]/id=='1'",
"/response/docs/[0]/title/[0]=='newtitle1'",
"/response/docs/[0]/multi_ii_dvo/[0]==100",
"/response/docs/[0]/multi_ii_dvo/[1]==" + Integer.MAX_VALUE);
@@ -1103,18 +1103,18 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
assertU(commit());
assertJQ(req("q", "id:101"),
- "/response/docs/[0]/id==101",
+ "/response/docs/[0]/id=='101'",
"/response/docs/[0]/title/[0]=='newtitle2'",
"/response/docs/[0]/single_i_dvn==102");
assertJQ(req("q", "id:102"),
1e-4,
- "/response/docs/[0]/id==102",
+ "/response/docs/[0]/id=='102'",
"/response/docs/[0]/title/[0]=='newtitle3'",
"/response/docs/[0]/single_d_dvn==5.14");
assertJQ(req("q", "id:103"),
- "/response/docs/[0]/id==103",
+ "/response/docs/[0]/id=='103'",
"/response/docs/[0]/single_s_dvn=='abc'",
"/response/docs/[0]/single_i_dvn==3");
@@ -1123,7 +1123,7 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
"single_i_dvn", ImmutableMap.of("set", 5))));
assertU(commit());
assertJQ(req("q", "id:103"),
- "/response/docs/[0]/id==103",
+ "/response/docs/[0]/id=='103'",
"/response/docs/[0]/single_s_dvn=='abcupdate'",
"/response/docs/[0]/single_i_dvn==5");
}
@@ -1162,7 +1162,7 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
assertQ(fieldToUpdate + ": initial RTG"
, req("qt", "/get", "id", "7")
, "count(//doc)=1"
- , "//doc/int[@name='id'][.='7']"
+ , "//doc/str[@name='id'][.='7']"
, "//doc/int[@name='"+fieldToUpdate+"'][.='666']"
, "//doc/int[@name='intDefault'][.='42']"
, "//doc/int[@name='intDvoDefault'][.='42']"
@@ -1177,7 +1177,7 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
assertQ(fieldToUpdate + ": RTG after atomic update"
, req("qt", "/get", "id", "7")
, "count(//doc)=1"
- , "//doc/int[@name='id'][.='7']"
+ , "//doc/str[@name='id'][.='7']"
, "//doc/int[@name='"+fieldToUpdate+"'][.='111']"
, "//doc/int[@name='intDefault'][.='42']"
, "//doc/int[@name='intDvoDefault'][.='42']"
@@ -1191,7 +1191,7 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
assertQ(fieldToUpdate + ": post commit RTG"
, req("qt", "/get", "id", "7")
, "count(//doc)=1"
- , "//doc/int[@name='id'][.='7']"
+ , "//doc/str[@name='id'][.='7']"
, "//doc/int[@name='"+fieldToUpdate+"'][.='111']"
, "//doc/int[@name='intDefault'][.='42']"
, "//doc/int[@name='intDvoDefault'][.='42']"
@@ -1214,7 +1214,7 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
assertQ(fieldToUpdate + ": initial RTG#7"
, req("qt", "/get", "id", "7")
, "count(//doc)=1"
- , "//doc/int[@name='id'][.='7']"
+ , "//doc/str[@name='id'][.='7']"
, "//doc/int[@name='"+fieldToUpdate+"'][.='708']"
// whichever field we did *NOT* update
, "//doc/int[@name!='"+fieldToUpdate+"'][.='42']"
@@ -1228,7 +1228,7 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
assertQ(fieldToUpdate + ": RTG#7 after atomic update"
, req("qt", "/get", "id", "7")
, "count(//doc)=1"
- , "//doc/int[@name='id'][.='7']"
+ , "//doc/str[@name='id'][.='7']"
, "//doc/int[@name='"+fieldToUpdate+"'][.='153']"
// whichever field we did *NOT* update
, "//doc/int[@name!='"+fieldToUpdate+"'][.='42']"
@@ -1243,7 +1243,7 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
assertQ(fieldToUpdate + ": initial RTG#8"
, req("qt", "/get", "id", "8")
, "count(//doc)=1"
- , "//doc/int[@name='id'][.='8']"
+ , "//doc/str[@name='id'][.='8']"
, "//doc/int[@name='"+fieldToUpdate+"'][.='666']"
// whichever field we did *NOT* update
, "//doc/int[@name!='"+fieldToUpdate+"'][.='42']"
@@ -1257,7 +1257,7 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
assertQ(fieldToUpdate + ": RTG after atomic update"
, req("qt", "/get", "id", "8")
, "count(//doc)=1"
- , "//doc/int[@name='id'][.='8']"
+ , "//doc/str[@name='id'][.='8']"
, "//doc/int[@name='"+fieldToUpdate+"'][.='111']"
// whichever field we did *NOT* update
, "//doc/int[@name!='"+fieldToUpdate+"'][.='42']"
@@ -1272,7 +1272,7 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
assertQ(fieldToUpdate + ": doc7 post commit RTG"
, req("qt", "/get", "id", "7")
, "count(//doc)=1"
- , "//doc/int[@name='id'][.='7']"
+ , "//doc/str[@name='id'][.='7']"
, "//doc/int[@name='"+fieldToUpdate+"'][.='153']"
// whichever field we did *NOT* update
, "//doc/int[@name!='"+fieldToUpdate+"'][.='42']"
@@ -1284,7 +1284,7 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
assertQ(fieldToUpdate + ": doc8 post commit RTG"
, req("qt", "/get", "id", "8")
, "count(//doc)=1"
- , "//doc/int[@name='id'][.='8']"
+ , "//doc/str[@name='id'][.='8']"
, "//doc/int[@name='"+fieldToUpdate+"'][.='111']"
// whichever field we did *NOT* update
, "//doc/int[@name!='"+fieldToUpdate+"'][.='42']"
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/update/processor/ClassificationUpdateProcessorTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/processor/ClassificationUpdateProcessorTest.java b/solr/core/src/test/org/apache/solr/update/processor/ClassificationUpdateProcessorTest.java
index aa536a7..df2e7aa 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/ClassificationUpdateProcessorTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/ClassificationUpdateProcessorTest.java
@@ -503,4 +503,4 @@ public class ClassificationUpdateProcessorTest extends SolrTestCaseJ4 {
writer.addDocument(doc);
return writer.numDocs() - 1;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/util/PrimUtilsTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/PrimUtilsTest.java b/solr/core/src/test/org/apache/solr/util/PrimUtilsTest.java
index b9121c3..3514fb8 100644
--- a/solr/core/src/test/org/apache/solr/util/PrimUtilsTest.java
+++ b/solr/core/src/test/org/apache/solr/util/PrimUtilsTest.java
@@ -89,4 +89,4 @@ public class PrimUtilsTest extends LuceneTestCase {
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/util/UtilsToolTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/UtilsToolTest.java b/solr/core/src/test/org/apache/solr/util/UtilsToolTest.java
index 0ca65ed..4272ad7 100644
--- a/solr/core/src/test/org/apache/solr/util/UtilsToolTest.java
+++ b/solr/core/src/test/org/apache/solr/util/UtilsToolTest.java
@@ -186,4 +186,4 @@ public class UtilsToolTest extends SolrTestCaseJ4 {
CommandLine cli = parseCmdLine(args, tool.getOptions());
return tool.runTool(cli);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/util/hll/BitVectorTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/hll/BitVectorTest.java b/solr/core/src/test/org/apache/solr/util/hll/BitVectorTest.java
index c21e5ca..0107af1 100644
--- a/solr/core/src/test/org/apache/solr/util/hll/BitVectorTest.java
+++ b/solr/core/src/test/org/apache/solr/util/hll/BitVectorTest.java
@@ -165,4 +165,4 @@ public class BitVectorTest extends LuceneTestCase {
assertEquals(vector.getRegister(i), 17/*arbitrary*/);
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/util/hll/ExplicitHLLTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/hll/ExplicitHLLTest.java b/solr/core/src/test/org/apache/solr/util/hll/ExplicitHLLTest.java
index 7e98771..02f9a46 100644
--- a/solr/core/src/test/org/apache/solr/util/hll/ExplicitHLLTest.java
+++ b/solr/core/src/test/org/apache/solr/util/hll/ExplicitHLLTest.java
@@ -231,4 +231,4 @@ public class ExplicitHLLTest extends LuceneTestCase {
private static HLL newHLL(final int explicitThreshold) {
return new HLL(11/*log2m, unused*/, 5/*regwidth, unused*/, explicitThreshold, 256/*sparseThreshold, arbitrary, unused*/, HLLType.EXPLICIT);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/util/hll/FullHLLTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/util/hll/FullHLLTest.java b/solr/core/src/test/org/apache/solr/util/hll/FullHLLTest.java
index 95cc6eb..aef4838 100644
--- a/solr/core/src/test/org/apache/solr/util/hll/FullHLLTest.java
+++ b/solr/core/src/test/org/apache/solr/util/hll/FullHLLTest.java
@@ -337,4 +337,4 @@ public class FullHLLTest extends LuceneTestCase {
assertFalse(iterA.hasNext());
assertFalse(iterB.hasNext());
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-replication1.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-replication1.xml b/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-replication1.xml
index b647fa2..eeb51bd 100644
--- a/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-replication1.xml
+++ b/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-replication1.xml
@@ -30,7 +30,7 @@
<fieldType name="integer" class="solr.TrieIntField" precisionStep="0"/>
<fieldType name="string" class="solr.StrField" sortMissingLast="true"/>
- <field name="id" type="integer" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="name" type="string" indexed="true" stored="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-sql.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-sql.xml b/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-sql.xml
index da9ad08..f3187ec 100644
--- a/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-sql.xml
+++ b/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema-sql.xml
@@ -436,7 +436,7 @@
-->
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="signatureField" type="string" indexed="true" stored="false"/>
<field name="s_multi" type="string" indexed="true" stored="true" docValues="true" multiValued="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema.xml b/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema.xml
index cd1422b..1886681 100644
--- a/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema.xml
+++ b/solr/solrj/src/test-files/solrj/solr/collection1/conf/schema.xml
@@ -411,7 +411,7 @@
-->
- <field name="id" type="int" indexed="true" stored="true" multiValued="false" required="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false" required="false"/>
<field name="signatureField" type="string" indexed="true" stored="false"/>
<field name="uuid" type="uuid" stored="true"/>
<field name="name" type="nametext" indexed="true" stored="true"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/solrj/src/test-files/solrj/solr/crazy-path-to-schema.xml
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test-files/solrj/solr/crazy-path-to-schema.xml b/solr/solrj/src/test-files/solrj/solr/crazy-path-to-schema.xml
index 6901cd8..6954fc6 100644
--- a/solr/solrj/src/test-files/solrj/solr/crazy-path-to-schema.xml
+++ b/solr/solrj/src/test-files/solrj/solr/crazy-path-to-schema.xml
@@ -28,7 +28,7 @@ that just finds leaf <fieldType> and <field> nodes and there's no reason to brea
-->
<schema name="test" version="1.0">
<types> <!-- Intentionally left in. see comment above -->
- <fieldType name="int" class="solr.TrieIntField" precisionStep="0"/>
+ <fieldType name="string" class="solr.StrField" />
<fieldType name="text" class="solr.TextField">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
@@ -42,7 +42,7 @@ that just finds leaf <fieldType> and <field> nodes and there's no reason to brea
<fields> <!-- Intentionally left in. see comment above -->
- <field name="id" type="int" indexed="true" stored="true" multiValued="false"/>
+ <field name="id" type="string" indexed="true" stored="true" multiValued="false"/>
<field name="subject" type="text" indexed="true" stored="true"/>
</fields>
[6/7] lucene-solr:master: SOLR-10834: Fixed tests and test configs to
stop using numeric uniqueKey fields
Posted by ho...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/CursorPagingTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/CursorPagingTest.java b/solr/core/src/test/org/apache/solr/CursorPagingTest.java
index eb1c6bc..dfaddea 100644
--- a/solr/core/src/test/org/apache/solr/CursorPagingTest.java
+++ b/solr/core/src/test/org/apache/solr/CursorPagingTest.java
@@ -191,17 +191,17 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==9"
,"/response/start==0"
- ,"/response/docs==[{'id':9},{'id':8},{'id':7},{'id':6}]"
+ ,"/response/docs==[{'id':'9'},{'id':'8'},{'id':'7'},{'id':'6'}]"
);
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==9"
,"/response/start==0"
- ,"/response/docs==[{'id':5},{'id':3},{'id':2},{'id':1}]"
+ ,"/response/docs==[{'id':'5'},{'id':'3'},{'id':'2'},{'id':'1'}]"
);
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==9"
,"/response/start==0"
- ,"/response/docs==[{'id':0}]"
+ ,"/response/docs==[{'id':'0'}]"
);
// no more, so no change to cursorMark, and no new docs
assertEquals(cursorMark,
@@ -223,13 +223,13 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==7"
,"/response/start==0"
- ,"/response/docs==[{'id':6},{'id':1},{'id':8},{'id':5}]"
+ ,"/response/docs==[{'id':'6'},{'id':'1'},{'id':'8'},{'id':'5'}]"
,"/facet_counts/facet_fields/str=={'a':4,'b':3,'c':0}"
);
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==7"
,"/response/start==0"
- ,"/response/docs==[{'id':4},{'id':3},{'id':0}]"
+ ,"/response/docs==[{'id':'4'},{'id':'3'},{'id':'0'}]"
,"/facet_counts/facet_fields/str=={'a':4,'b':3,'c':0}"
);
// no more, so no change to cursorMark, and no new docs
@@ -253,19 +253,19 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==8"
,"/response/start==0"
- ,"/response/docs==[{'id':7},{'id':0},{'id':3}]"
+ ,"/response/docs==[{'id':'7'},{'id':'0'},{'id':'3'}]"
,"/facet_counts/facet_fields/str=={'a':4,'b':1,'c':3}"
);
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==8"
,"/response/start==0"
- ,"/response/docs==[{'id':4},{'id':1},{'id':6}]"
+ ,"/response/docs==[{'id':'4'},{'id':'1'},{'id':'6'}]"
,"/facet_counts/facet_fields/str=={'a':4,'b':1,'c':3}"
);
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==8"
,"/response/start==0"
- ,"/response/docs==[{'id':9},{'id':2}]"
+ ,"/response/docs==[{'id':'9'},{'id':'2'}]"
,"/facet_counts/facet_fields/str=={'a':4,'b':1,'c':3}"
);
// no more, so no change to cursorMark, and no new docs
@@ -287,17 +287,17 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==8"
,"/response/start==0"
- ,"/response/docs==[{'id':3},{'id':7},{'id':0}]"
+ ,"/response/docs==[{'id':'3'},{'id':'7'},{'id':'0'}]"
);
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==8"
,"/response/start==0"
- ,"/response/docs==[{'id':4},{'id':1},{'id':6}]"
+ ,"/response/docs==[{'id':'4'},{'id':'1'},{'id':'6'}]"
);
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==8"
,"/response/start==0"
- ,"/response/docs==[{'id':9},{'id':2}]"
+ ,"/response/docs==[{'id':'9'},{'id':'2'}]"
);
// no more, so no change to cursorMark, and no new docs
assertEquals(cursorMark,
@@ -317,17 +317,17 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==8"
,"/response/start==0"
- ,"/response/docs==[{'id':7},{'id':0},{'id':4}]"
+ ,"/response/docs==[{'id':'7'},{'id':'0'},{'id':'4'}]"
);
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==8"
,"/response/start==0"
- ,"/response/docs==[{'id':1},{'id':6},{'id':9}]"
+ ,"/response/docs==[{'id':'1'},{'id':'6'},{'id':'9'}]"
);
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==8"
,"/response/start==0"
- ,"/response/docs==[{'id':2},{'id':3}]"
+ ,"/response/docs==[{'id':'2'},{'id':'3'}]"
);
// no more, so no change to cursorMark, and no new docs
assertEquals(cursorMark,
@@ -346,12 +346,12 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==10"
,"/response/start==0"
- ,"/response/docs==[{'id':6},{'id':4},{'id':3},{'id':1},{'id':8},{'id':5}]"
+ ,"/response/docs==[{'id':'6'},{'id':'4'},{'id':'3'},{'id':'1'},{'id':'8'},{'id':'5'}]"
);
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==10"
,"/response/start==0"
- ,"/response/docs==[{'id':0},{'id':9},{'id':7},{'id':2}]"
+ ,"/response/docs==[{'id':'0'},{'id':'9'},{'id':'7'},{'id':'2'}]"
);
// no more, so no change to cursorMark, and no new docs
assertEquals(cursorMark,
@@ -370,27 +370,27 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==10"
,"/response/start==0"
- ,"/response/docs==[{'id':2},{'id':9}]"
+ ,"/response/docs==[{'id':'2'},{'id':'9'}]"
);
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==10"
,"/response/start==0"
- ,"/response/docs==[{'id':7},{'id':4}]"
+ ,"/response/docs==[{'id':'7'},{'id':'4'}]"
);
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==10"
,"/response/start==0"
- ,"/response/docs==[{'id':3},{'id':8}]"
+ ,"/response/docs==[{'id':'3'},{'id':'8'}]"
);
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==10"
,"/response/start==0"
- ,"/response/docs==[{'id':5},{'id':6}]"
+ ,"/response/docs==[{'id':'5'},{'id':'6'}]"
);
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==10"
,"/response/start==0"
- ,"/response/docs==[{'id':1},{'id':0}]"
+ ,"/response/docs==[{'id':'1'},{'id':'0'}]"
);
// we've exactly exhausted all the results, but solr had no way of know that
// no more, so no change to cursorMark, and no new docs
@@ -410,7 +410,7 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==2"
,"/response/start==0"
- ,"/response/docs==[{'id':7},{'id':3}]"
+ ,"/response/docs==[{'id':'7'},{'id':'3'}]"
);
// no more, so no change to cursorMark, and no new docs
assertEquals(cursorMark,
@@ -455,7 +455,7 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==10"
,"/response/start==0"
- ,"/response/docs==[{'id':1},{'id':3}]"
+ ,"/response/docs==[{'id':'1'},{'id':'3'}]"
);
// delete the last guy we got
assertU(delI("3"));
@@ -463,7 +463,7 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==9"
,"/response/start==0"
- ,"/response/docs==[{'id':4},{'id':6}]"
+ ,"/response/docs==[{'id':'4'},{'id':'6'}]"
);
// delete the next guy we expect
assertU(delI("0"));
@@ -471,7 +471,7 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==8"
,"/response/start==0"
- ,"/response/docs==[{'id':5},{'id':8}]"
+ ,"/response/docs==[{'id':'5'},{'id':'8'}]"
);
// update a doc we've already seen so it repeats
assertU(adoc("id", "5", "str", "c"));
@@ -479,7 +479,7 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==8"
,"/response/start==0"
- ,"/response/docs==[{'id':2},{'id':5}]"
+ ,"/response/docs==[{'id':'2'},{'id':'5'}]"
);
// update the next doc we expect so it's now in the past
assertU(adoc("id", "7", "str", "a"));
@@ -487,7 +487,7 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
cursorMark = assertCursor(req(params, CURSOR_MARK_PARAM, cursorMark)
,"/response/numFound==8"
,"/response/start==0"
- ,"/response/docs==[{'id':9}]"
+ ,"/response/docs==[{'id':'9'}]"
);
// no more, so no change to cursorMark, and no new docs
assertEquals(cursorMark,
@@ -684,7 +684,7 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
cursorMark, nextCursorMark);
}
for (Map<Object,Object> doc : docs) {
- int id = ((Long)doc.get("id")).intValue();
+ int id = Integer.parseInt(doc.get("id").toString());
assertFalse("walk already seen: " + id, ids.exists(id));
ids.put(id);
assertFalse("id set bigger then max allowed ("+maxSize+"): " + ids.size(),
@@ -773,7 +773,7 @@ public class CursorPagingTest extends SolrTestCaseJ4 {
cursorMark, nextCursorMark);
}
for (Map<Object,Object> doc : docs) {
- int id = ((Long)doc.get("id")).intValue();
+ int id = Integer.parseInt(doc.get("id").toString());
assertFalse("walk already seen: " + id, ids.exists(id));
ids.put(id);
assertFalse("id set bigger then max allowed ("+maxSize+"): " + ids.size(),
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/DisMaxRequestHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/DisMaxRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/DisMaxRequestHandlerTest.java
index 8d1b758..faf67b4 100644
--- a/solr/core/src/test/org/apache/solr/DisMaxRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/DisMaxRequestHandlerTest.java
@@ -85,9 +85,9 @@ public class DisMaxRequestHandlerTest extends SolrTestCaseJ4 {
assertQ("basic cross field matching, boost on same field matching",
req("cool stuff")
,"//*[@numFound='3']"
- ,"//result/doc[1]/int[@name='id'][.='42']"
- ,"//result/doc[2]/int[@name='id'][.='666']"
- ,"//result/doc[3]/int[@name='id'][.='8675309']"
+ ,"//result/doc[1]/str[@name='id'][.='42']"
+ ,"//result/doc[2]/str[@name='id'][.='666']"
+ ,"//result/doc[3]/str[@name='id'][.='8675309']"
);
assertQ("multi qf",
@@ -112,9 +112,9 @@ public class DisMaxRequestHandlerTest extends SolrTestCaseJ4 {
,"bq", "subject:hell^400"
)
,"//*[@numFound='3']"
- ,"//result/doc[1]/int[@name='id'][.='666']"
- ,"//result/doc[2]/int[@name='id'][.='42']"
- ,"//result/doc[3]/int[@name='id'][.='8675309']"
+ ,"//result/doc[1]/str[@name='id'][.='666']"
+ ,"//result/doc[2]/str[@name='id'][.='42']"
+ ,"//result/doc[3]/str[@name='id'][.='8675309']"
);
assertQ("multi boost query",
@@ -126,16 +126,16 @@ public class DisMaxRequestHandlerTest extends SolrTestCaseJ4 {
, CommonParams.DEBUG_QUERY, "true"
)
,"//*[@numFound='3']"
- ,"//result/doc[1]/int[@name='id'][.='666']"
- ,"//result/doc[2]/int[@name='id'][.='8675309']"
- ,"//result/doc[3]/int[@name='id'][.='42']"
+ ,"//result/doc[1]/str[@name='id'][.='666']"
+ ,"//result/doc[2]/str[@name='id'][.='8675309']"
+ ,"//result/doc[3]/str[@name='id'][.='42']"
);
assertQ("minimum mm is three",
req("cool stuff traveling")
,"//*[@numFound='2']"
- ,"//result/doc[1]/int[@name='id'][. ='42']"
- ,"//result/doc[2]/int[@name='id'][. ='666']"
+ ,"//result/doc[1]/str[@name='id'][. ='42']"
+ ,"//result/doc[2]/str[@name='id'][. ='666']"
);
assertQ("at 4 mm allows one missing ",
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/SampleTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/SampleTest.java b/solr/core/src/test/org/apache/solr/SampleTest.java
index cea23ee..244272f 100644
--- a/solr/core/src/test/org/apache/solr/SampleTest.java
+++ b/solr/core/src/test/org/apache/solr/SampleTest.java
@@ -61,7 +61,7 @@ public class SampleTest extends SolrTestCaseJ4 {
assertQ("couldn't find subject hoss",
req("subject:Hoss")
,"//result[@numFound=1]"
- ,"//int[@name='id'][.='4055']"
+ ,"//str[@name='id'][.='4055']"
);
}
@@ -94,7 +94,7 @@ public class SampleTest extends SolrTestCaseJ4 {
assertQ("couldn't find subject hoss",
req
,"//result[@numFound=1]"
- ,"//int[@name='id'][.='4055']"
+ ,"//str[@name='id'][.='4055']"
);
/* make your own LocalRequestFactory to build a request
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java b/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
index ca7f9ee..d187da8 100644
--- a/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
+++ b/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
@@ -264,23 +264,23 @@ public class TestDistributedGrouping extends BaseDistributedSearchTestCase {
// We validate distributed grouping with scoring as first sort.
// note: this 'q' matches all docs and returns the 'id' as the score, which is unique and so our results should be deterministic.
handle.put("maxScore", SKIP);// TODO see SOLR-6612
- query("q", "{!func}id", "rows", 100, "fl", "score,id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " desc", "group.sort", "score desc"); // SOLR-2955
- query("q", "{!func}id", "rows", 100, "fl", "score,id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", "score desc, _docid_ asc, id asc");
- query("q", "{!func}id", "rows", 100, "fl", "score,id," + i1, "group", "true", "group.field", i1, "group.limit", -1);
+ query("q", "{!func}id_i1", "rows", 100, "fl", "score,id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", i1 + " desc", "group.sort", "score desc"); // SOLR-2955
+ query("q", "{!func}id_i1", "rows", 100, "fl", "score,id," + i1, "group", "true", "group.field", i1, "group.limit", -1, "sort", "score desc, _docid_ asc, id asc");
+ query("q", "{!func}id_i1", "rows", 100, "fl", "score,id," + i1, "group", "true", "group.field", i1, "group.limit", -1);
// some explicit checks of non default sorting, and sort/group.sort with diff clauses
- query("q", "{!func}id", "rows", 100, "fl", tlong + ",id," + i1, "group", "true",
+ query("q", "{!func}id_i1", "rows", 100, "fl", tlong + ",id," + i1, "group", "true",
"group.field", i1, "group.limit", -1,
"sort", tlong+" asc, id desc");
- query("q", "{!func}id", "rows", 100, "fl", tlong + ",id," + i1, "group", "true",
+ query("q", "{!func}id_i1", "rows", 100, "fl", tlong + ",id," + i1, "group", "true",
"group.field", i1, "group.limit", -1,
"sort", "id asc",
"group.sort", tlong+" asc, id desc");
- query("q", "{!func}id", "rows", 100, "fl", tlong + ",id," + i1, "group", "true",
+ query("q", "{!func}id_i1", "rows", 100, "fl", tlong + ",id," + i1, "group", "true",
"group.field", i1, "group.limit", -1,
"sort", tlong+" asc, id desc",
"group.sort", "id asc");
- rsp = query("q", "{!func}id", "fq", oddField+":[* TO *]",
+ rsp = query("q", "{!func}id_i1", "fq", oddField+":[* TO *]",
"rows", 100, "fl", tlong + ",id," + i1, "group", "true",
"group.field", i1, "group.limit", -1,
"sort", tlong+" asc",
@@ -293,8 +293,8 @@ public class TestDistributedGrouping extends BaseDistributedSearchTestCase {
assertEquals(rsp.toString(), 232, nl.get("groupValue"));
SolrDocumentList docs = (SolrDocumentList) nl.get("doclist");
assertEquals(docs.toString(), 5, docs.getNumFound());
- assertEquals(docs.toString(), 22, docs.get(0).getFirstValue("id"));
- assertEquals(docs.toString(), 21, docs.get(4).getFirstValue("id"));
+ assertEquals(docs.toString(), "22", docs.get(0).getFirstValue("id"));
+ assertEquals(docs.toString(), "21", docs.get(4).getFirstValue("id"));
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/TestDistributedMissingSort.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/TestDistributedMissingSort.java b/solr/core/src/test/org/apache/solr/TestDistributedMissingSort.java
index 7a91c83..378ad0d 100644
--- a/solr/core/src/test/org/apache/solr/TestDistributedMissingSort.java
+++ b/solr/core/src/test/org/apache/solr/TestDistributedMissingSort.java
@@ -104,13 +104,13 @@ public class TestDistributedMissingSort extends BaseDistributedSearchTestCase {
// sint1_ml desc sort pos: 7 8 10 11 3 12 6 2 9 1 13 4 5
QueryResponse rsp = query("q","*:*", "sort", sint1_ml + " desc", "rows", "13");
- assertFieldValues(rsp.getResults(), id, 10, 8, 5, 12, 13, 7, 1, 2, 9, 3, 4, 6, 11);
+ assertFieldValues(rsp.getResults(), "id_i", 10, 8, 5, 12, 13, 7, 1, 2, 9, 3, 4, 6, 11);
rsp = query("q","*:*", "sort", sint1_ml + " asc", "rows", "13");
- assertFieldValues(rsp.getResults(), id, 11, 6, 4, 3, 9, 2, 1, 7, 13, 12, 5, 8, 10);
+ assertFieldValues(rsp.getResults(), "id_i", 11, 6, 4, 3, 9, 2, 1, 7, 13, 12, 5, 8, 10);
- rsp = query("q","*:*", "sort", sint1_ml + " desc," + id + " asc", "rows", "200");
- assertFieldValues(rsp.getResults(), id,
+ rsp = query("q","*:*", "sort", sint1_ml + " desc, id_i asc", "rows", "200");
+ assertFieldValues(rsp.getResults(), "id_i",
10, 8, 5, 12, 13, 7, 1, 2, 9, 3, 4, 6, 11,
14, 15, 16, 17,
100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
@@ -119,8 +119,8 @@ public class TestDistributedMissingSort extends BaseDistributedSearchTestCase {
130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
140, 141, 142, 143, 144, 145, 146, 147, 148, 149);
- rsp = query("q","*:*", "sort", sint1_ml + " asc," + id + " desc", "rows", "200");
- assertFieldValues(rsp.getResults(), id,
+ rsp = query("q","*:*", "sort", sint1_ml + " asc, id_i desc", "rows", "200");
+ assertFieldValues(rsp.getResults(), "id_i",
11, 6, 4, 3, 9, 2, 1, 7, 13, 12, 5, 8, 10,
149, 148, 147, 146, 145, 144, 143, 142, 141, 140,
139, 138, 137, 136, 135, 134, 133, 132, 131, 130,
@@ -135,13 +135,13 @@ public class TestDistributedMissingSort extends BaseDistributedSearchTestCase {
// long1_ml desc sort pos: 7 8 10 11 3 12 6 2 9 1 13 4 5
rsp = query("q","*:*", "sort", long1_ml + " desc", "rows", "13");
- assertFieldValues(rsp.getResults(), id, 10, 8, 5, 12, 13, 7, 1, 2, 9, 3, 4, 6, 11);
+ assertFieldValues(rsp.getResults(), "id_i", 10, 8, 5, 12, 13, 7, 1, 2, 9, 3, 4, 6, 11);
rsp = query("q","*:*", "sort", long1_ml + " asc", "rows", "13");
- assertFieldValues(rsp.getResults(), id, 11, 6, 4, 3, 9, 2, 1, 7, 13, 12, 5, 8, 10);
+ assertFieldValues(rsp.getResults(), "id_i", 11, 6, 4, 3, 9, 2, 1, 7, 13, 12, 5, 8, 10);
- rsp = query("q","*:*", "sort", long1_ml + " desc," + id + " asc", "rows", "200");
- assertFieldValues(rsp.getResults(), id,
+ rsp = query("q","*:*", "sort", long1_ml + " desc, id_i asc", "rows", "200");
+ assertFieldValues(rsp.getResults(), "id_i",
10, 8, 5, 12, 13, 7, 1, 2, 9, 3, 4, 6, 11,
14, 15, 16, 17,
100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
@@ -150,8 +150,8 @@ public class TestDistributedMissingSort extends BaseDistributedSearchTestCase {
130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
140, 141, 142, 143, 144, 145, 146, 147, 148, 149);
- rsp = query("q","*:*", "sort", long1_ml + " asc," + id + " desc", "rows", "200");
- assertFieldValues(rsp.getResults(), id,
+ rsp = query("q","*:*", "sort", long1_ml + " asc, id_i desc", "rows", "200");
+ assertFieldValues(rsp.getResults(), "id_i",
11, 6, 4, 3, 9, 2, 1, 7, 13, 12, 5, 8, 10,
149, 148, 147, 146, 145, 144, 143, 142, 141, 140,
139, 138, 137, 136, 135, 134, 133, 132, 131, 130,
@@ -167,13 +167,13 @@ public class TestDistributedMissingSort extends BaseDistributedSearchTestCase {
// string1_ml desc sort pos: 12 13 10 9 1 3 8 5 6 7 2 4 11
rsp = query("q","*:*", "sort", string1_ml + " desc", "rows", "13");
- assertFieldValues(rsp.getResults(), id, 5, 11, 6, 12, 8, 9, 10, 7, 4, 3, 13, 1, 2);
+ assertFieldValues(rsp.getResults(), "id_i", 5, 11, 6, 12, 8, 9, 10, 7, 4, 3, 13, 1, 2);
rsp = query("q","*:*", "sort", string1_ml + " asc", "rows", "13");
- assertFieldValues(rsp.getResults(), id, 2, 1, 13, 3, 4, 7, 10, 9, 8, 12, 6, 11, 5);
+ assertFieldValues(rsp.getResults(), "id_i", 2, 1, 13, 3, 4, 7, 10, 9, 8, 12, 6, 11, 5);
- rsp = query("q","*:*", "sort", string1_ml + " desc," + id + " asc", "rows", "200");
- assertFieldValues(rsp.getResults(), id,
+ rsp = query("q","*:*", "sort", string1_ml + " desc, id_i asc", "rows", "200");
+ assertFieldValues(rsp.getResults(), "id_i",
5, 11, 6, 12, 8, 9, 10, 7, 4, 3, 13, 1, 2,
// missing field string1_ml="a_s1", ascending id sort
14, 15, 16, 17,
@@ -183,8 +183,8 @@ public class TestDistributedMissingSort extends BaseDistributedSearchTestCase {
130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
140, 141, 142, 143, 144, 145, 146, 147, 148, 149);
- rsp = query("q","*:*", "sort", string1_ml + " asc," + id + " desc", "rows", "200");
- assertFieldValues(rsp.getResults(), id,
+ rsp = query("q","*:*", "sort", string1_ml + " asc, id_i desc", "rows", "200");
+ assertFieldValues(rsp.getResults(), "id_i",
2, 1, 13, 3, 4, 7, 10, 9, 8, 12, 6, 11, 5,
// missing field string1_ml="a_s1", descending id sort
149, 148, 147, 146, 145, 144, 143, 142, 141, 140,
@@ -201,8 +201,8 @@ public class TestDistributedMissingSort extends BaseDistributedSearchTestCase {
// sint1_mf asc sort pos: 7 6 4 3 11 2 8 12 5 13 1 10 9
// sint1_mf desc sort pos: 7 8 10 11 3 12 6 2 9 1 13 4 5
- QueryResponse rsp = query("q","*:*", "sort", sint1_mf + " desc," + id + " asc", "rows", "200");
- assertFieldValues(rsp.getResults(), id,
+ QueryResponse rsp = query("q","*:*", "sort", sint1_mf + " desc, id_i asc", "rows", "200");
+ assertFieldValues(rsp.getResults(), "id_i",
14, 15, 16, 17,
100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
@@ -211,8 +211,8 @@ public class TestDistributedMissingSort extends BaseDistributedSearchTestCase {
140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
10, 8, 5, 12, 13, 7, 1, 2, 9, 3, 4, 6, 11);
- rsp = query("q","*:*", "sort", sint1_mf + " asc," + id + " desc", "rows", "200");
- assertFieldValues(rsp.getResults(), id,
+ rsp = query("q","*:*", "sort", sint1_mf + " asc, id_i desc", "rows", "200");
+ assertFieldValues(rsp.getResults(), "id_i",
149, 148, 147, 146, 145, 144, 143, 142, 141, 140,
139, 138, 137, 136, 135, 134, 133, 132, 131, 130,
129, 128, 127, 126, 125, 124, 123, 122, 121, 120,
@@ -227,8 +227,8 @@ public class TestDistributedMissingSort extends BaseDistributedSearchTestCase {
// long1_mf asc sort pos: 7 6 4 3 11 2 8 12 5 13 1 10 9
// long1_mf desc sort pos: 7 8 10 11 3 12 6 2 9 1 13 4 5
- rsp = query("q","*:*", "sort", long1_mf + " desc," + id + " asc", "rows", "200");
- assertFieldValues(rsp.getResults(), id,
+ rsp = query("q","*:*", "sort", long1_mf + " desc, id_i asc", "rows", "200");
+ assertFieldValues(rsp.getResults(), "id_i",
14, 15, 16, 17,
100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
@@ -237,8 +237,8 @@ public class TestDistributedMissingSort extends BaseDistributedSearchTestCase {
140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
10, 8, 5, 12, 13, 7, 1, 2, 9, 3, 4, 6, 11);
- rsp = query("q","*:*", "sort", long1_mf + " asc," + id + " desc", "rows", "200");
- assertFieldValues(rsp.getResults(), id,
+ rsp = query("q","*:*", "sort", long1_mf + " asc, id_i desc", "rows", "200");
+ assertFieldValues(rsp.getResults(), "id_i",
149, 148, 147, 146, 145, 144, 143, 142, 141, 140,
139, 138, 137, 136, 135, 134, 133, 132, 131, 130,
129, 128, 127, 126, 125, 124, 123, 122, 121, 120,
@@ -253,8 +253,8 @@ public class TestDistributedMissingSort extends BaseDistributedSearchTestCase {
// string1_mf asc sort pos: 2 1 4 5 13 11 6 9 8 7 12 10 3
// string1_mf desc sort pos: 12 13 10 9 1 3 8 5 6 7 2 4 11
- rsp = query("q","*:*", "sort", string1_mf + " desc," + id + " asc", "rows", "200");
- assertFieldValues(rsp.getResults(), id,
+ rsp = query("q","*:*", "sort", string1_mf + " desc, id_i asc", "rows", "200");
+ assertFieldValues(rsp.getResults(), "id_i",
// missing field string1_mf="a_s1_mf", ascending id sort
14, 15, 16, 17,
100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
@@ -264,8 +264,8 @@ public class TestDistributedMissingSort extends BaseDistributedSearchTestCase {
140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
5, 11, 6, 12, 8, 9, 10, 7, 4, 3, 13, 1, 2);
- rsp = query("q","*:*", "sort", string1_mf + " asc," + id + " desc", "rows", "200");
- assertFieldValues(rsp.getResults(), id,
+ rsp = query("q","*:*", "sort", string1_mf + " asc, id_i desc", "rows", "200");
+ assertFieldValues(rsp.getResults(), "id_i",
// missing field string1_mf="a_s1_mf", descending id sort
149, 148, 147, 146, 145, 144, 143, 142, 141, 140,
139, 138, 137, 136, 135, 134, 133, 132, 131, 130,
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/TestDistributedSearch.java b/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
index fc48847..cde3296 100644
--- a/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
+++ b/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
@@ -242,7 +242,7 @@ public class TestDistributedSearch extends BaseDistributedSearchTestCase {
"facet.field", tdate_b, "facet.field", tdate_a);
assertEquals(2, rsp.getFacetFields().size());
- String facetQuery = "id:[1 TO 15]";
+ String facetQuery = "id_i1:[1 TO 15]";
// simple range facet on one field
query("q",facetQuery, "rows",100, "facet","true",
@@ -390,7 +390,7 @@ public class TestDistributedSearch extends BaseDistributedSearchTestCase {
// we want a random query and not just *:* so we'll get zero counts in facets also
// TODO: do a better random query
- String q = random().nextBoolean() ? "*:*" : "id:(1 3 5 7 9 11 13) OR id:[100 TO " + random().nextInt(50) + "]";
+ String q = random().nextBoolean() ? "*:*" : "id:(1 3 5 7 9 11 13) OR id_i1:[100 TO " + random().nextInt(50) + "]";
int nolimit = random().nextBoolean() ? -1 : 10000; // these should be equivalent
@@ -412,7 +412,7 @@ public class TestDistributedSearch extends BaseDistributedSearchTestCase {
,"facet.field","{!key=other ex=b}"+t1
,"facet.field","{!key=again ex=a,b}"+t1
,"facet.field",t1
- ,"fq","{!tag=a}id:[1 TO 7]", "fq","{!tag=b}id:[3 TO 9]"
+ ,"fq","{!tag=a}id_i1:[1 TO 7]", "fq","{!tag=b}id_i1:[3 TO 9]"
);
queryAndCompareUIF("q", "*:*", "facet", "true", "facet.field", "{!ex=t1}SubjectTerms_mfacet", "fq", "{!tag=t1}SubjectTerms_mfacet:(test 1)", "facet.limit", "10", "facet.mincount", "1");
@@ -522,7 +522,7 @@ public class TestDistributedSearch extends BaseDistributedSearchTestCase {
"stats.field", "{!key=special_key}stats_dt");
query("q","*:*", "sort",i1+" desc", "stats", "true",
"f.stats_dt.stats.calcdistinct", "true",
- "fq", "{!tag=xxx}id:[3 TO 9]",
+ "fq", "{!tag=xxx}id_i1:[3 TO 9]",
"stats.field", "{!key=special_key}stats_dt",
"stats.field", "{!ex=xxx}stats_dt");
@@ -920,20 +920,20 @@ public class TestDistributedSearch extends BaseDistributedSearchTestCase {
handle.put("time", SKIPVAL);
handle.put("track", SKIP); //track is not included in single node search
query("q","now their fox sat had put","fl","*,score",CommonParams.DEBUG_QUERY, "true");
- query("q", "id:[1 TO 5]", CommonParams.DEBUG_QUERY, "true");
- query("q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.TIMING);
- query("q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.RESULTS);
- query("q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.QUERY);
+ query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG_QUERY, "true");
+ query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.TIMING);
+ query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.RESULTS);
+ query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.QUERY);
// SOLR-6545, wild card field list
indexr(id, "19", "text", "d", "cat_a_sS", "1" ,t1, "2");
commit();
rsp = query("q", "id:19", "fl", "id", "fl", "*a_sS");
- assertFieldValues(rsp.getResults(), "id", 19);
+ assertFieldValues(rsp.getResults(), "id", "19");
rsp = query("q", "id:19", "fl", "id," + t1 + ",cat*");
- assertFieldValues(rsp.getResults(), "id", 19);
+ assertFieldValues(rsp.getResults(), "id", "19");
// Check Info is added to for each shard
ModifiableSolrParams q = new ModifiableSolrParams();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/TestTolerantSearch.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/TestTolerantSearch.java b/solr/core/src/test/org/apache/solr/TestTolerantSearch.java
index cb485d0..ec1f16c 100644
--- a/solr/core/src/test/org/apache/solr/TestTolerantSearch.java
+++ b/solr/core/src/test/org/apache/solr/TestTolerantSearch.java
@@ -150,7 +150,7 @@ public class TestTolerantSearch extends SolrJettyTestBase {
}
}
assertTrue(foundError);
- assertEquals(1, response.getResults().get(0).getFieldValue("id"));
+ assertEquals("1", response.getResults().get(0).getFieldValue("id"));
assertEquals("batman", response.getResults().get(0).getFirstValue("subject"));
unIgnoreException("Dummy exception in BadResponseWriter");
}
@@ -199,7 +199,7 @@ public class TestTolerantSearch extends SolrJettyTestBase {
}
assertTrue(foundError);
- assertEquals(1, response.getResults().get(0).getFieldValue("id"));
+ assertEquals("1", response.getResults().get(0).getFieldValue("id"));
assertEquals("batman", response.getResults().get(0).getFirstValue("subject"));
unIgnoreException("Dummy exception in BadResponseWriter");
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/analysis/PathHierarchyTokenizerFactoryTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/analysis/PathHierarchyTokenizerFactoryTest.java b/solr/core/src/test/org/apache/solr/analysis/PathHierarchyTokenizerFactoryTest.java
index d079166..ded7f18 100644
--- a/solr/core/src/test/org/apache/solr/analysis/PathHierarchyTokenizerFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/analysis/PathHierarchyTokenizerFactoryTest.java
@@ -54,21 +54,21 @@ public class PathHierarchyTokenizerFactoryTest extends SolrTestCaseJ4 {
assertQ(req("{!field f=cat_path}Books/NonFic")
,"//*[@numFound='4']"
- ,"//int[@name='id' and .='40']"
- ,"//int[@name='id' and .='41']"
- ,"//int[@name='id' and .='42']"
- ,"//int[@name='id' and .='43']"
+ ,"//str[@name='id' and .='40']"
+ ,"//str[@name='id' and .='41']"
+ ,"//str[@name='id' and .='42']"
+ ,"//str[@name='id' and .='43']"
);
assertQ(req("{!field f=cat_path}Books/NonFic/Law")
,"//*[@numFound='2']"
- ,"//int[@name='id' and .='41']"
- ,"//int[@name='id' and .='42']"
+ ,"//str[@name='id' and .='41']"
+ ,"//str[@name='id' and .='42']"
);
assertQ(req("{!field f=cat_path}Books/NonFic/Science")
,"//*[@numFound='2']"
- ,"//int[@name='id' and .='42']"
- ,"//int[@name='id' and .='43']"
+ ,"//str[@name='id' and .='42']"
+ ,"//str[@name='id' and .='43']"
);
}
@@ -76,21 +76,21 @@ public class PathHierarchyTokenizerFactoryTest extends SolrTestCaseJ4 {
assertQ(req("{!field f=cat_ancestor}Books/NonFic/Science")
,"//*[@numFound='2']"
- ,"//int[@name='id' and .='40']"
- ,"//int[@name='id' and .='42']"
+ ,"//str[@name='id' and .='40']"
+ ,"//str[@name='id' and .='42']"
);
assertQ(req("{!field f=cat_ancestor}Books/NonFic/Law")
,"//*[@numFound='3']"
- ,"//int[@name='id' and .='40']"
- ,"//int[@name='id' and .='41']"
- ,"//int[@name='id' and .='42']"
+ ,"//str[@name='id' and .='40']"
+ ,"//str[@name='id' and .='41']"
+ ,"//str[@name='id' and .='42']"
);
assertQ(req("{!field f=cat_ancestor}Books/NonFic/Science/Physics")
,"//*[@numFound='3']"
- ,"//int[@name='id' and .='40']"
- ,"//int[@name='id' and .='42']"
- ,"//int[@name='id' and .='43']"
+ ,"//str[@name='id' and .='40']"
+ ,"//str[@name='id' and .='42']"
+ ,"//str[@name='id' and .='43']"
);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/analysis/TestCharFilters.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/analysis/TestCharFilters.java b/solr/core/src/test/org/apache/solr/analysis/TestCharFilters.java
index 984ad12..646bdbb 100644
--- a/solr/core/src/test/org/apache/solr/analysis/TestCharFilters.java
+++ b/solr/core/src/test/org/apache/solr/analysis/TestCharFilters.java
@@ -46,12 +46,12 @@ public class TestCharFilters extends SolrTestCaseJ4 {
assertQ("Query analysis: ",
req("fl", "id", "q", "content:ab", "sort", "id asc"),
"//*[@numFound='1']",
- "//result/doc[1]/int[@name='id'][.=1]"
+ "//result/doc[1]/str[@name='id'][.=1]"
);
assertQ("Query analysis: ",
req("fl", "id", "q", "content:aba", "sort", "id asc"),
"//*[@numFound='1']",
- "//result/doc[1]/int[@name='id'][.=2]"
+ "//result/doc[1]/str[@name='id'][.=2]"
);
}
@@ -65,12 +65,12 @@ public class TestCharFilters extends SolrTestCaseJ4 {
assertQ("Index analysis: ",
req("fl", "id", "q", "content2:aab", "sort", "id asc"),
"//*[@numFound='1']",
- "//result/doc[1]/int[@name='id'][.=3]"
+ "//result/doc[1]/str[@name='id'][.=3]"
);
assertQ("Index analysis: ",
req("fl", "id", "q", "content2:aabaa", "sort", "id asc"),
"//*[@numFound='1']",
- "//result/doc[1]/int[@name='id'][.=4]"
+ "//result/doc[1]/str[@name='id'][.=4]"
);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
index c8e92fc..02692a0 100644
--- a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
+++ b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
@@ -463,10 +463,10 @@ public class BasicDistributedZk2Test extends AbstractFullDistribZkTestBase {
handle.put("track", SKIP);
query("q", "now their fox sat had put", "fl", "*,score",
CommonParams.DEBUG_QUERY, "true");
- query("q", "id:[1 TO 5]", CommonParams.DEBUG_QUERY, "true");
- query("q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.TIMING);
- query("q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.RESULTS);
- query("q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.QUERY);
+ query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG_QUERY, "true");
+ query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.TIMING);
+ query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.RESULTS);
+ query("q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.QUERY);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
index 18caa58..3ed6f74 100644
--- a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
@@ -271,7 +271,7 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase {
,"facet.field","{!key=other ex=b}"+t1
,"facet.field","{!key=again ex=a,b}"+t1
,"facet.field",t1
- ,"fq","{!tag=a}id:[1 TO 7]", "fq","{!tag=b}id:[3 TO 9]"}
+ ,"fq","{!tag=a}id_i1:[1 TO 7]", "fq","{!tag=b}id_i1:[3 TO 9]"}
);
query(false, new Object[] {"q", "*:*", "facet", "true", "facet.field", "{!ex=t1}SubjectTerms_mfacet", "fq", "{!tag=t1}SubjectTerms_mfacet:(test 1)", "facet.limit", "10", "facet.mincount", "1"});
@@ -321,10 +321,10 @@ public class BasicDistributedZkTest extends AbstractFullDistribZkTestBase {
handle.put("time", SKIPVAL);
handle.put("track", SKIP);
query(false, new Object[] {"q","now their fox sat had put","fl","*,score",CommonParams.DEBUG_QUERY, "true"});
- query(false, new Object[] {"q", "id:[1 TO 5]", CommonParams.DEBUG_QUERY, "true"});
- query(false, new Object[] {"q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.TIMING});
- query(false, new Object[] {"q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.RESULTS});
- query(false, new Object[] {"q", "id:[1 TO 5]", CommonParams.DEBUG, CommonParams.QUERY});
+ query(false, new Object[] {"q", "id_i1:[1 TO 5]", CommonParams.DEBUG_QUERY, "true"});
+ query(false, new Object[] {"q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.TIMING});
+ query(false, new Object[] {"q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.RESULTS});
+ query(false, new Object[] {"q", "id_i1:[1 TO 5]", CommonParams.DEBUG, CommonParams.QUERY});
// try add commitWithin
long before = cloudClient.query(new SolrQuery("*:*")).getResults().getNumFound();
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java b/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java
index f48f76b..7a9dbdb 100644
--- a/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java
@@ -70,10 +70,10 @@ public class BasicZkTest extends AbstractZkTestCase {
assertU("does commit work?", commit());
assertQ("backslash escaping semicolon", request("id:42 AND val_s:aa\\;bb"),
- "//*[@numFound='1']", "//int[@name='id'][.='42']");
+ "//*[@numFound='1']", "//str[@name='id'][.='42']");
assertQ("quote escaping semicolon", request("id:42 AND val_s:\"aa;bb\""),
- "//*[@numFound='1']", "//int[@name='id'][.='42']");
+ "//*[@numFound='1']", "//str[@name='id'][.='42']");
assertQ("no escaping semicolon", request("id:42 AND val_s:aa"),
"//*[@numFound='0']");
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/cloud/DistribCursorPagingTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/DistribCursorPagingTest.java b/solr/core/src/test/org/apache/solr/cloud/DistribCursorPagingTest.java
index 0742ac7..5de766f 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DistribCursorPagingTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DistribCursorPagingTest.java
@@ -556,7 +556,7 @@ public class DistribCursorPagingTest extends AbstractFullDistribZkTestBase {
if (ids.size() < numInitialDocs) {
message.append("Missing doc(s): ");
for (SolrInputDocument doc : initialDocs) {
- int id = ((Integer)doc.get("id").getValue()).intValue();
+ int id = Integer.parseInt(doc.getFieldValue("id").toString());
if ( ! ids.exists(id)) {
QueryResponse rsp = cloudClient.query(params("q", "id:" + id,
"rows", "1"));
@@ -664,12 +664,12 @@ public class DistribCursorPagingTest extends AbstractFullDistribZkTestBase {
* "id" of the list of documents returned matches the expected list
* @see org.apache.solr.client.solrj.SolrClient#query
*/
- private void assertDocList(QueryResponse rsp, Object... ids) {
+ private void assertDocList(QueryResponse rsp, int... ids) {
SolrDocumentList docs = extractDocList(rsp);
assertEquals("Wrong number of docs in response", ids.length, docs.size());
int i = 0;
- for (Object id : ids) {
- assertEquals(rsp.toString(), id, docs.get(i).get("id"));
+ for (int id : ids) {
+ assertEquals(rsp.toString(), ""+id, docs.get(i).get("id"));
i++;
}
}
@@ -730,7 +730,7 @@ public class DistribCursorPagingTest extends AbstractFullDistribZkTestBase {
}
for (SolrDocument doc : docs) {
- int id = ((Integer)doc.get("id")).intValue();
+ int id = Integer.parseInt(doc.getFieldValue("id").toString());
if (ids.exists(id)) {
String msg = "(" + p + ") walk already seen: " + id;
try {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/cloud/DistribJoinFromCollectionTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/DistribJoinFromCollectionTest.java b/solr/core/src/test/org/apache/solr/cloud/DistribJoinFromCollectionTest.java
index cfebef2..383c1ae 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DistribJoinFromCollectionTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DistribJoinFromCollectionTest.java
@@ -62,7 +62,7 @@ public class DistribJoinFromCollectionTest extends SolrCloudTestCase{
private static String toColl = "to_2x2";
private static String fromColl = "from_1x4";
- private static Integer toDocId;
+ private static String toDocId;
@BeforeClass
public static void setupCluster() throws Exception {
@@ -140,7 +140,7 @@ public class DistribJoinFromCollectionTest extends SolrCloudTestCase{
log.info("DistribJoinFromCollectionTest succeeded ... shutting down now!");
}
- private void testJoins(String toColl, String fromColl, Integer toDocId, boolean isScoresTest)
+ private void testJoins(String toColl, String fromColl, String toDocId, boolean isScoresTest)
throws SolrServerException, IOException {
// verify the join with fromIndex works
final String fromQ = "match_s:c^2";
@@ -219,12 +219,12 @@ public class DistribJoinFromCollectionTest extends SolrCloudTestCase{
}
}
- protected static Integer indexDoc(String collection, int id, String joinField, String matchField, String getField) throws Exception {
+ protected static String indexDoc(String collection, int id, String joinField, String matchField, String getField) throws Exception {
UpdateRequest up = new UpdateRequest();
up.setCommitWithin(50);
up.setParam("collection", collection);
SolrInputDocument doc = new SolrInputDocument();
- Integer docId = new Integer(id);
+ String docId = "" + id;
doc.addField("id", docId);
doc.addField("join_s", joinField);
if (matchField != null)
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/cloud/FullThrottleStoppableIndexingThread.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/FullThrottleStoppableIndexingThread.java b/solr/core/src/test/org/apache/solr/cloud/FullThrottleStoppableIndexingThread.java
index b9e177a..909f39a 100644
--- a/solr/core/src/test/org/apache/solr/cloud/FullThrottleStoppableIndexingThread.java
+++ b/solr/core/src/test/org/apache/solr/cloud/FullThrottleStoppableIndexingThread.java
@@ -153,4 +153,4 @@ class FullThrottleStoppableIndexingThread extends StoppableIndexingThread {
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java b/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java
index 6c7de88..2f2ccb4 100644
--- a/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java
@@ -598,7 +598,7 @@ public class HttpPartitionTest extends AbstractFullDistribZkTestBase {
@SuppressWarnings("rawtypes")
protected void assertDocExists(HttpSolrClient solr, String coll, String docId) throws Exception {
NamedList rsp = realTimeGetDocId(solr, docId);
- String match = JSONTestUtil.matchObj("/id", rsp.get("doc"), new Integer(docId));
+ String match = JSONTestUtil.matchObj("/id", rsp.get("doc"), docId);
assertTrue("Doc with id=" + docId + " not found in " + solr.getBaseURL()
+ " due to: " + match + "; rsp="+rsp, match == null);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/cloud/SegmentTerminateEarlyTestState.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/SegmentTerminateEarlyTestState.java b/solr/core/src/test/org/apache/solr/cloud/SegmentTerminateEarlyTestState.java
index 9824e3d..118d5ed 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SegmentTerminateEarlyTestState.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SegmentTerminateEarlyTestState.java
@@ -106,8 +106,10 @@ class SegmentTerminateEarlyTestState {
// check correctness of the first result
if (rsp.getResults().getNumFound() > 0) {
final SolrDocument solrDocument0 = rsp.getResults().get(0);
- TestMiniSolrCloudCluster.assertTrue(KEY_FIELD +" of ("+solrDocument0+") is not in maxTimestampDocKeys("+maxTimestampDocKeys+")",
- maxTimestampDocKeys.contains(solrDocument0.getFieldValue(KEY_FIELD)));
+ final Integer idAsInt = Integer.parseInt(solrDocument0.getFieldValue(KEY_FIELD).toString());
+ TestMiniSolrCloudCluster.assertTrue
+ (KEY_FIELD +"="+idAsInt+" of ("+solrDocument0+") is not in maxTimestampDocKeys("+maxTimestampDocKeys+")",
+ maxTimestampDocKeys.contains(idAsInt));
TestMiniSolrCloudCluster.assertEquals(ODD_FIELD, oddFieldValue, solrDocument0.getFieldValue(ODD_FIELD));
}
// check segmentTerminatedEarly flag
@@ -136,8 +138,10 @@ class SegmentTerminateEarlyTestState {
// check correctness of the first result
if (rsp.getResults().getNumFound() > 0) {
final SolrDocument solrDocument0 = rsp.getResults().get(0);
- TestMiniSolrCloudCluster.assertTrue(KEY_FIELD +" of ("+solrDocument0+") is not in maxTimestampDocKeys("+maxTimestampDocKeys+")",
- maxTimestampDocKeys.contains(solrDocument0.getFieldValue(KEY_FIELD)));
+ final Integer idAsInt = Integer.parseInt(solrDocument0.getFieldValue(KEY_FIELD).toString());
+ TestMiniSolrCloudCluster.assertTrue
+ (KEY_FIELD +"="+idAsInt+" of ("+solrDocument0+") is not in maxTimestampDocKeys("+maxTimestampDocKeys+")",
+ maxTimestampDocKeys.contains(idAsInt));
TestMiniSolrCloudCluster.assertEquals(ODD_FIELD, oddFieldValue, rsp.getResults().get(0).getFieldValue(ODD_FIELD));
}
// check segmentTerminatedEarly flag
@@ -182,8 +186,10 @@ class SegmentTerminateEarlyTestState {
// check correctness of the first result
if (rsp.getResults().getNumFound() > 0) {
final SolrDocument solrDocument0 = rsp.getResults().get(0);
- TestMiniSolrCloudCluster.assertTrue(KEY_FIELD +" of ("+solrDocument0+") is not in maxTimestampDocKeys("+maxTimestampDocKeys+")",
- maxTimestampDocKeys.contains(solrDocument0.getFieldValue(KEY_FIELD)));
+ final Integer idAsInt = Integer.parseInt(solrDocument0.getFieldValue(KEY_FIELD).toString());
+ TestMiniSolrCloudCluster.assertTrue
+ (KEY_FIELD +"="+idAsInt+" of ("+solrDocument0+") is not in maxTimestampDocKeys("+maxTimestampDocKeys+")",
+ maxTimestampDocKeys.contains(idAsInt));
TestMiniSolrCloudCluster.assertEquals(ODD_FIELD, oddFieldValue, rsp.getResults().get(0).getFieldValue(ODD_FIELD));
}
// check segmentTerminatedEarly flag
@@ -226,8 +232,10 @@ class SegmentTerminateEarlyTestState {
// check correctness of the first result
if (rsp.getGroupResponse().getValues().get(0).getMatches() > 0) {
final SolrDocument solrDocument = rsp.getGroupResponse().getValues().get(0).getValues().get(0).getResult().get(0);
- TestMiniSolrCloudCluster.assertTrue(KEY_FIELD +" of ("+solrDocument+") is not in maxTimestampDocKeys("+maxTimestampDocKeys+")",
- maxTimestampDocKeys.contains(solrDocument.getFieldValue(KEY_FIELD)));
+ final Integer idAsInt = Integer.parseInt(solrDocument.getFieldValue(KEY_FIELD).toString());
+ TestMiniSolrCloudCluster.assertTrue
+ (KEY_FIELD +"="+idAsInt+" of ("+solrDocument+") is not in maxTimestampDocKeys("+maxTimestampDocKeys+")",
+ maxTimestampDocKeys.contains(idAsInt));
TestMiniSolrCloudCluster.assertEquals(ODD_FIELD, oddFieldValue, solrDocument.getFieldValue(ODD_FIELD));
}
// check segmentTerminatedEarly flag
@@ -251,8 +259,10 @@ class SegmentTerminateEarlyTestState {
// check correctness of the first result
if (rsp.getResults().getNumFound() > 0) {
final SolrDocument solrDocument0 = rsp.getResults().get(0);
- TestMiniSolrCloudCluster.assertTrue(KEY_FIELD +" of ("+solrDocument0+") is not in minTimestampDocKeys("+minTimestampDocKeys+")",
- minTimestampDocKeys.contains(solrDocument0.getFieldValue(KEY_FIELD)));
+ final Integer idAsInt = Integer.parseInt(solrDocument0.getFieldValue(KEY_FIELD).toString());
+ TestMiniSolrCloudCluster.assertTrue
+ (KEY_FIELD +"="+idAsInt+" of ("+solrDocument0+") is not in minTimestampDocKeys("+minTimestampDocKeys+")",
+ minTimestampDocKeys.contains(idAsInt));
TestMiniSolrCloudCluster.assertEquals(ODD_FIELD, oddFieldValue, solrDocument0.getFieldValue(ODD_FIELD));
}
// check segmentTerminatedEarly flag
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
index 7bf4616..830bef2 100644
--- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java
@@ -335,4 +335,4 @@ public class AutoScalingHandlerTest extends SolrCloudTestCase {
return null;
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/core/HelloStream.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/HelloStream.java b/solr/core/src/test/org/apache/solr/core/HelloStream.java
index d1c5ced..be285e5 100644
--- a/solr/core/src/test/org/apache/solr/core/HelloStream.java
+++ b/solr/core/src/test/org/apache/solr/core/HelloStream.java
@@ -97,4 +97,4 @@ public class HelloStream extends TupleStream implements Expressible{
.withExpressionType(Explanation.ExpressionType.STREAM_SOURCE)
.withExpression("--non-expressible--");
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/core/MockInfoBean.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/MockInfoBean.java b/solr/core/src/test/org/apache/solr/core/MockInfoBean.java
index dfa94ae..a4334bc 100644
--- a/solr/core/src/test/org/apache/solr/core/MockInfoBean.java
+++ b/solr/core/src/test/org/apache/solr/core/MockInfoBean.java
@@ -68,4 +68,4 @@ class MockInfoBean implements SolrInfoBean, SolrMetricProducer {
});
manager.registerGauge(this, registryName, metricsMap, true, getClass().getSimpleName(), getCategory().toString(), scope);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/core/SOLR749Test.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/SOLR749Test.java b/solr/core/src/test/org/apache/solr/core/SOLR749Test.java
index 446c506..2eda77d 100644
--- a/solr/core/src/test/org/apache/solr/core/SOLR749Test.java
+++ b/solr/core/src/test/org/apache/solr/core/SOLR749Test.java
@@ -52,29 +52,29 @@ public class SOLR749Test extends SolrTestCaseJ4 {
// NOTE: we can't rely on the default lucene syntax because "FooQParser" is registered as "lucene"
assertQ(req("q","{!notfoo}*:*"), "//result[@numFound=100]");
- assertQ(req("q","{!notfoo}id:[* TO 49]"), "//result[@numFound=50]");
+ assertQ(req("q","{!notfoo}id_i1:[* TO 49]"), "//result[@numFound=50]");
try {
assertQ("query wrapped in boost func should only eval func for query matches",
- req("q","{!boost b=$boostFunc defType=notfoo}id:[* TO 49]",
+ req("q","{!boost b=$boostFunc defType=notfoo}id_i1:[* TO 49]",
"boostFunc", "countUsage('boost_func',3.4)"),
"//result[@numFound=50]");
assertEquals(50, CountUsageValueSourceParser.getAndClearCount("boost_func"));
assertQ("func query that is filtered should be evaled only for filtered docs",
- req("q","{!func}product(id,countUsage('func_q',4.5))",
- "fq", "{!notfoo}id:[30 TO 59]"),
+ req("q","{!func}product(id_i1,countUsage('func_q',4.5))",
+ "fq", "{!notfoo}id_i1:[30 TO 59]"),
"//result[@numFound=30]");
assertEquals(30, CountUsageValueSourceParser.getAndClearCount("func_q"));
assertQ("func query that wraps a query which is also used as a should be evaled only for filtered docs",
req("q","{!func}product(query($qq),countUsage('func_q_wrapping_fq',4.5))",
- "qq", "{!notfoo}id:[20 TO 39]",
+ "qq", "{!notfoo}id_i1:[20 TO 39]",
"fq", "{!query v=$qq}"),
"//result[@numFound=20]");
assertEquals(20, CountUsageValueSourceParser.getAndClearCount("func_q_wrapping_fq"));
assertQ("frange in complex bq w/ other mandatory clauses to check skipping",
- req("q","{!notfoo}(+id:[20 TO 39] -id:25 +{!frange l=4.5 u=4.5 v='countUsage(frange_in_bq,4.5)'})"),
+ req("q","{!notfoo}(+id_i1:[20 TO 39] -id:25 +{!frange l=4.5 u=4.5 v='countUsage(frange_in_bq,4.5)'})"),
"//result[@numFound=19]");
// don't assume specific clause evaluation ordering.
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/core/TestJmxIntegration.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/TestJmxIntegration.java b/solr/core/src/test/org/apache/solr/core/TestJmxIntegration.java
index db941f7..70df3c5 100644
--- a/solr/core/src/test/org/apache/solr/core/TestJmxIntegration.java
+++ b/solr/core/src/test/org/apache/solr/core/TestJmxIntegration.java
@@ -197,4 +197,4 @@ public class TestJmxIntegration extends AbstractSolrTestCase {
log.info("After Reload: Size of infoRegistry: " + registrySize + " MBeans: " + newNumberOfObjects);
assertEquals("Number of registered MBeans is not the same as info registry size", registrySize, newNumberOfObjects);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCloudSnapshots.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCloudSnapshots.java b/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCloudSnapshots.java
index 592200d..b65863e 100644
--- a/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCloudSnapshots.java
+++ b/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCloudSnapshots.java
@@ -305,4 +305,4 @@ public class TestSolrCloudSnapshots extends SolrCloudTestCase {
}
return result;
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCoreSnapshots.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCoreSnapshots.java b/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCoreSnapshots.java
index 7a9b0bb..d508050 100644
--- a/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCoreSnapshots.java
+++ b/solr/core/src/test/org/apache/solr/core/snapshots/TestSolrCoreSnapshots.java
@@ -309,4 +309,4 @@ public class TestSolrCoreSnapshots extends SolrCloudTestCase {
return Collections.emptyList();
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java
index 8e9c170..6da06b1 100644
--- a/solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/MoreLikeThisHandlerTest.java
@@ -86,19 +86,19 @@ public class MoreLikeThisHandlerTest extends SolrTestCaseJ4 {
SolrQueryRequest mltreq = new LocalSolrQueryRequest( core, params);
assertQ("morelikethis - tom cruise",mltreq
- ,"//result/doc[1]/int[@name='id'][.='46']"
- ,"//result/doc[2]/int[@name='id'][.='43']");
+ ,"//result/doc[1]/str[@name='id'][.='46']"
+ ,"//result/doc[2]/str[@name='id'][.='43']");
params.set(MoreLikeThisParams.BOOST, "true");
mltreq.close(); mltreq = new LocalSolrQueryRequest( core, params);
assertQ("morelikethis - tom cruise",mltreq
- ,"//result/doc[1]/int[@name='id'][.='46']"
- ,"//result/doc[2]/int[@name='id'][.='43']");
+ ,"//result/doc[1]/str[@name='id'][.='46']"
+ ,"//result/doc[2]/str[@name='id'][.='43']");
params.set(CommonParams.Q, "id:44");
mltreq.close(); mltreq = new LocalSolrQueryRequest(h.getCore(), params);
assertQ("morelike this - harrison ford",mltreq
- ,"//result/doc[1]/int[@name='id'][.='45']");
+ ,"//result/doc[1]/str[@name='id'][.='45']");
// test MoreLikeThis debug
params.set(CommonParams.DEBUG_QUERY, "true");
@@ -115,14 +115,14 @@ public class MoreLikeThisHandlerTest extends SolrTestCaseJ4 {
params.set(CommonParams.Q, "{!field f=id}44");
mltreq.close(); mltreq = new LocalSolrQueryRequest(h.getCore(), params);
assertQ(mltreq
- ,"//result/doc[1]/int[@name='id'][.='45']");
+ ,"//result/doc[1]/str[@name='id'][.='45']");
params.set(CommonParams.Q, "id:42");
params.set(MoreLikeThisParams.QF,"name^5.0 subword^0.1");
mltreq.close(); mltreq = new LocalSolrQueryRequest(h.getCore(), params);
assertQ("morelikethis with weights",mltreq
- ,"//result/doc[1]/int[@name='id'][.='43']"
- ,"//result/doc[2]/int[@name='id'][.='46']");
+ ,"//result/doc[1]/str[@name='id'][.='43']"
+ ,"//result/doc[2]/str[@name='id'][.='46']");
// test that qparser plugins work w/ the MoreLikeThisHandler
@@ -130,14 +130,14 @@ public class MoreLikeThisHandlerTest extends SolrTestCaseJ4 {
params.set(CommonParams.Q, "{!field f=id}44");
mltreq.close(); mltreq = new LocalSolrQueryRequest(h.getCore(), params);
assertQ(mltreq
- ,"//result/doc[1]/int[@name='id'][.='45']");
+ ,"//result/doc[1]/str[@name='id'][.='45']");
// test that debugging works (test for MoreLikeThis*Handler*)
params.set(CommonParams.QT, "/mlt");
params.set(CommonParams.DEBUG_QUERY, "true");
mltreq.close(); mltreq = new LocalSolrQueryRequest(h.getCore(), params);
assertQ(mltreq
- ,"//result/doc[1]/int[@name='id'][.='45']"
+ ,"//result/doc[1]/str[@name='id'][.='45']"
,"//lst[@name='debug']/lst[@name='explain']"
);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/handler/StandardRequestHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/StandardRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/StandardRequestHandlerTest.java
index 82e8cde..668fefd 100644
--- a/solr/core/src/test/org/apache/solr/handler/StandardRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/StandardRequestHandlerTest.java
@@ -49,16 +49,16 @@ public class StandardRequestHandlerTest extends AbstractSolrTestCase {
assertQ(req("q", "title:test", "sort","val_s1 asc")
,"//*[@numFound='3']"
- ,"//result/doc[1]/int[@name='id'][.='10']"
- ,"//result/doc[2]/int[@name='id'][.='11']"
- ,"//result/doc[3]/int[@name='id'][.='12']"
+ ,"//result/doc[1]/str[@name='id'][.='10']"
+ ,"//result/doc[2]/str[@name='id'][.='11']"
+ ,"//result/doc[3]/str[@name='id'][.='12']"
);
assertQ(req("q", "title:test", "sort","val_s1 desc")
,"//*[@numFound='3']"
- ,"//result/doc[1]/int[@name='id'][.='12']"
- ,"//result/doc[2]/int[@name='id'][.='11']"
- ,"//result/doc[3]/int[@name='id'][.='10']"
+ ,"//result/doc[1]/str[@name='id'][.='12']"
+ ,"//result/doc[2]/str[@name='id'][.='11']"
+ ,"//result/doc[3]/str[@name='id'][.='10']"
);
// Make sure score parsing works
@@ -73,16 +73,16 @@ public class StandardRequestHandlerTest extends AbstractSolrTestCase {
// Using legacy ';' param
assertQ(req("q", "title:test; val_s1 desc", "defType","lucenePlusSort")
,"//*[@numFound='3']"
- ,"//result/doc[1]/int[@name='id'][.='12']"
- ,"//result/doc[2]/int[@name='id'][.='11']"
- ,"//result/doc[3]/int[@name='id'][.='10']"
+ ,"//result/doc[1]/str[@name='id'][.='12']"
+ ,"//result/doc[2]/str[@name='id'][.='11']"
+ ,"//result/doc[3]/str[@name='id'][.='10']"
);
assertQ(req("q", "title:test; val_s1 asc", "defType","lucenePlusSort")
,"//*[@numFound='3']"
- ,"//result/doc[1]/int[@name='id'][.='10']"
- ,"//result/doc[2]/int[@name='id'][.='11']"
- ,"//result/doc[3]/int[@name='id'][.='12']"
+ ,"//result/doc[1]/str[@name='id'][.='10']"
+ ,"//result/doc[2]/str[@name='id'][.='11']"
+ ,"//result/doc[3]/str[@name='id'][.='12']"
);
}
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/handler/TestSQLHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/TestSQLHandler.java b/solr/core/src/test/org/apache/solr/handler/TestSQLHandler.java
index 4889c90..78bdbe0 100644
--- a/solr/core/src/test/org/apache/solr/handler/TestSQLHandler.java
+++ b/solr/core/src/test/org/apache/solr/handler/TestSQLHandler.java
@@ -172,7 +172,7 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
assert(tuple.get("str_s").equals("a"));
//Assert field order
- assertResponseContains(clients.get(0), sParams, "{\"docs\":[{\"id\":8,\"field_i\":60,\"str_s\":\"c\"}");
+ assertResponseContains(clients.get(0), sParams, "{\"docs\":[{\"id\":\"8\",\"field_i\":60,\"str_s\":\"c\"}");
//Test unlimited unsorted result. Should sort on _version_ desc
sParams = mapParams(CommonParams.QT, "/sql", "stmt", "select id, field_i, str_s from collection1 where text='XXXX'");
@@ -375,7 +375,7 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
assertEquals(1, tuples.size());
Tuple tuple = tuples.get(0);
- assertEquals(1L, tuple.get("id"));
+ assertEquals("1", tuple.get("id"));
// Not Equals <>
sParams = mapParams(CommonParams.QT, "/sql",
@@ -387,19 +387,19 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
assertEquals(7, tuples.size());
tuple = tuples.get(0);
- assertEquals(2L, tuple.get("id"));
+ assertEquals("2", tuple.get("id"));
tuple = tuples.get(1);
- assertEquals(3L, tuple.get("id"));
+ assertEquals("3", tuple.get("id"));
tuple = tuples.get(2);
- assertEquals(4L, tuple.get("id"));
+ assertEquals("4", tuple.get("id"));
tuple = tuples.get(3);
- assertEquals(5L, tuple.get("id"));
+ assertEquals("5", tuple.get("id"));
tuple = tuples.get(4);
- assertEquals(6L, tuple.get("id"));
+ assertEquals("6", tuple.get("id"));
tuple = tuples.get(5);
- assertEquals(7L, tuple.get("id"));
+ assertEquals("7", tuple.get("id"));
tuple = tuples.get(6);
- assertEquals(8L, tuple.get("id"));
+ assertEquals("8", tuple.get("id"));
// TODO requires different Calcite SQL conformance level
// Not Equals !=
@@ -436,7 +436,7 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
assertEquals(1, tuples.size());
tuple = tuples.get(0);
- assertEquals(1L, tuple.get("id"));
+ assertEquals("1", tuple.get("id"));
// Less than equal
sParams = mapParams(CommonParams.QT, "/sql",
@@ -448,9 +448,9 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
assertEquals(2, tuples.size());
tuple = tuples.get(0);
- assertEquals(1L, tuple.get("id"));
+ assertEquals("1", tuple.get("id"));
tuple = tuples.get(1);
- assertEquals(2L, tuple.get("id"));
+ assertEquals("2", tuple.get("id"));
// Greater than
sParams = mapParams(CommonParams.QT, "/sql",
@@ -462,7 +462,7 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
assertEquals(1, tuples.size());
tuple = tuples.get(0);
- assertEquals(8L, tuple.get("id"));
+ assertEquals("8", tuple.get("id"));
// Greater than equal
sParams = mapParams(CommonParams.QT, "/sql",
@@ -474,9 +474,9 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
assertEquals(2, tuples.size());
tuple = tuples.get(0);
- assertEquals(7L, tuple.get("id"));
+ assertEquals("7", tuple.get("id"));
tuple = tuples.get(1);
- assertEquals(8L, tuple.get("id"));
+ assertEquals("8", tuple.get("id"));
} finally {
delete();
@@ -511,7 +511,7 @@ public class TestSQLHandler extends AbstractFullDistribZkTestBase {
assert(tuples.size() == 8);
Tuple tuple;
-
+
tuple = tuples.get(0);
assert(tuple.getLong("id") == 8);
assert(tuple.getLong("Field_i") == 60);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/handler/XsltUpdateRequestHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/XsltUpdateRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/XsltUpdateRequestHandlerTest.java
index 7062b43..fb7bd19 100644
--- a/solr/core/src/test/org/apache/solr/handler/XsltUpdateRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/XsltUpdateRequestHandlerTest.java
@@ -90,7 +90,7 @@ public class XsltUpdateRequestHandlerTest extends SolrTestCaseJ4 {
assertQ("test document was correctly committed", req("q","*:*")
, "//result[@numFound='1']"
- , "//int[@name='id'][.='12345']"
+ , "//str[@name='id'][.='12345']"
);
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/handler/admin/MBeansHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/MBeansHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/MBeansHandlerTest.java
index c7622f6..40d7821 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/MBeansHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/MBeansHandlerTest.java
@@ -96,4 +96,4 @@ public class MBeansHandlerTest extends SolrTestCaseJ4 {
assertTrue("external entity ignored properly", true);
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/handler/admin/PropertiesRequestHandlerTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/PropertiesRequestHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/PropertiesRequestHandlerTest.java
index 1a959a4..34ab7eb 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/PropertiesRequestHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/PropertiesRequestHandlerTest.java
@@ -70,4 +70,4 @@ public class PropertiesRequestHandlerTest extends SolrTestCaseJ4 {
return (NamedList<NamedList<NamedList<Object>>>)
parser.processResponse(new StringReader(xml)).get("system.properties");
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java
index 5ca527f..5633c46 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedExpandComponentTest.java
@@ -102,10 +102,10 @@ public class DistributedExpandComponentTest extends BaseDistributedSearchTestCas
QueryResponse rsp = queryServer(params);
Map<String, SolrDocumentList> results = rsp.getExpandedResults();
assertExpandGroups(results, "group1","group2", "group3", "group4");
- assertExpandGroupCountAndOrder("group1", 2, results, "1.0", "7.0");
- assertExpandGroupCountAndOrder("group2", 2, results, "5.0", "8.0");
- assertExpandGroupCountAndOrder("group3", 2, results, "11.0", "9.0");
- assertExpandGroupCountAndOrder("group4", 2, results, "12.0", "14.0");
+ assertExpandGroupCountAndOrder("group1", 2, results, "1", "7");
+ assertExpandGroupCountAndOrder("group2", 2, results, "5", "8");
+ assertExpandGroupCountAndOrder("group3", 2, results, "11", "9");
+ assertExpandGroupCountAndOrder("group4", 2, results, "12", "14");
//Test expand.sort
@@ -121,10 +121,10 @@ public class DistributedExpandComponentTest extends BaseDistributedSearchTestCas
rsp = queryServer(params);
results = rsp.getExpandedResults();
assertExpandGroups(results, "group1","group2", "group3", "group4");
- assertExpandGroupCountAndOrder("group1", 2, results, "7.0", "1.0");
- assertExpandGroupCountAndOrder("group2", 2, results, "8.0", "5.0");
- assertExpandGroupCountAndOrder("group3", 2, results, "9.0", "11.0");
- assertExpandGroupCountAndOrder("group4", 2, results, "14.0", "12.0");
+ assertExpandGroupCountAndOrder("group1", 2, results, "7", "1");
+ assertExpandGroupCountAndOrder("group2", 2, results, "8", "5");
+ assertExpandGroupCountAndOrder("group3", 2, results, "9", "11");
+ assertExpandGroupCountAndOrder("group4", 2, results, "14", "12");
//Test expand.rows
@@ -141,10 +141,10 @@ public class DistributedExpandComponentTest extends BaseDistributedSearchTestCas
rsp = queryServer(params);
results = rsp.getExpandedResults();
assertExpandGroups(results, "group1","group2", "group3", "group4");
- assertExpandGroupCountAndOrder("group1", 1, results, "7.0");
- assertExpandGroupCountAndOrder("group2", 1, results, "8.0");
- assertExpandGroupCountAndOrder("group3", 1, results, "9.0");
- assertExpandGroupCountAndOrder("group4", 1, results, "14.0");
+ assertExpandGroupCountAndOrder("group1", 1, results, "7");
+ assertExpandGroupCountAndOrder("group2", 1, results, "8");
+ assertExpandGroupCountAndOrder("group3", 1, results, "9");
+ assertExpandGroupCountAndOrder("group4", 1, results, "14");
//Test key-only fl
@@ -161,10 +161,10 @@ public class DistributedExpandComponentTest extends BaseDistributedSearchTestCas
rsp = queryServer(params);
results = rsp.getExpandedResults();
assertExpandGroups(results, "group1","group2", "group3", "group4");
- assertExpandGroupCountAndOrder("group1", 2, results, "1.0", "7.0");
- assertExpandGroupCountAndOrder("group2", 2, results, "5.0", "8.0");
- assertExpandGroupCountAndOrder("group3", 2, results, "11.0", "9.0");
- assertExpandGroupCountAndOrder("group4", 2, results, "12.0", "14.0");
+ assertExpandGroupCountAndOrder("group1", 2, results, "1", "7");
+ assertExpandGroupCountAndOrder("group2", 2, results, "5", "8");
+ assertExpandGroupCountAndOrder("group3", 2, results, "11", "9");
+ assertExpandGroupCountAndOrder("group4", 2, results, "12", "14");
//Test distrib.singlePass true
@@ -180,10 +180,10 @@ public class DistributedExpandComponentTest extends BaseDistributedSearchTestCas
rsp = queryServer(params);
results = rsp.getExpandedResults();
assertExpandGroups(results, "group1","group2", "group3", "group4");
- assertExpandGroupCountAndOrder("group1", 2, results, "1.0", "7.0");
- assertExpandGroupCountAndOrder("group2", 2, results, "5.0", "8.0");
- assertExpandGroupCountAndOrder("group3", 2, results, "11.0", "9.0");
- assertExpandGroupCountAndOrder("group4", 2, results, "12.0", "14.0");
+ assertExpandGroupCountAndOrder("group1", 2, results, "1", "7");
+ assertExpandGroupCountAndOrder("group2", 2, results, "5", "8");
+ assertExpandGroupCountAndOrder("group3", 2, results, "11", "9");
+ assertExpandGroupCountAndOrder("group4", 2, results, "12", "14");
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f1e2be64/solr/core/src/test/org/apache/solr/handler/component/DistributedMLTComponentTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedMLTComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedMLTComponentTest.java
index 10116b9..157d6a7 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/DistributedMLTComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedMLTComponentTest.java
@@ -140,28 +140,28 @@ public class DistributedMLTComponentTest extends BaseDistributedSearchTestCase {
// we ask for an mlt.count of 20 to ensure both include all results
query("q", "lowerfilt:moon", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 2,
- MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
+ MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id_i1 desc", "mlt", "true",
"mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
requestHandlerName, "mlt.count", "20");
query("q", "lowerfilt:fox", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 1,
- MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
+ MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id_i1 desc", "mlt", "true",
"mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
requestHandlerName, "mlt.count", "20");
query("q", "lowerfilt:the red fox", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 1,
- MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
+ MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id_i1 desc", "mlt", "true",
"mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
requestHandlerName, "mlt.count", "20");
query("q", "lowerfilt:blue moon", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 1,
- MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
+ MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id_i1 desc", "mlt", "true",
"mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
requestHandlerName, "mlt.count", "20");
// let's query by specifying multiple mlt.fl as comma-separated values
QueryResponse response = query("q", "lowerfilt:moon", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 2,
- MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
+ MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id_i1 desc", "mlt", "true",
"mlt.fl", "lowerfilt1,lowerfilt", "qt", requestHandlerName, "shards.qt",
requestHandlerName, "mlt.count", "20");
NamedList<Object> moreLikeThis = (NamedList<Object>) response.getResponse().get("moreLikeThis");
@@ -173,7 +173,7 @@ public class DistributedMLTComponentTest extends BaseDistributedSearchTestCase {
// let's query by specifying multiple mlt.fl as multiple request parameters
response = query("q", "lowerfilt:moon", "fl", id, MoreLikeThisParams.MIN_TERM_FREQ, 2,
- MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id desc", "mlt", "true",
+ MoreLikeThisParams.MIN_DOC_FREQ, 1, "sort", "id_i1 desc", "mlt", "true",
"mlt.fl", "lowerfilt1", "mlt.fl", "lowerfilt", "qt", requestHandlerName, "shards.qt",
requestHandlerName, "mlt.count", "20");
moreLikeThis = (NamedList<Object>) response.getResponse().get("moreLikeThis");