mirror of https://github.com/apache/lucene.git
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
This commit is contained in:
parent
abc393dbfd
commit
f1e2be6451
|
@ -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
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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]"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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]"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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]"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
|
||||
|
|
|
@ -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.-->
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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>
|
||||
</schema>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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"/>
|
||||
|
||||
|
|
|
@ -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 -->
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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 ",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"));
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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']"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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]"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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']");
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -153,4 +153,4 @@ class FullThrottleStoppableIndexingThread extends StoppableIndexingThread {
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -335,4 +335,4 @@ public class AutoScalingHandlerTest extends SolrCloudTestCase {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,4 +97,4 @@ public class HelloStream extends TupleStream implements Expressible{
|
|||
.withExpressionType(Explanation.ExpressionType.STREAM_SOURCE)
|
||||
.withExpression("--non-expressible--");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,4 +68,4 @@ class MockInfoBean implements SolrInfoBean, SolrMetricProducer {
|
|||
});
|
||||
manager.registerGauge(this, registryName, metricsMap, true, getClass().getSimpleName(), getCategory().toString(), scope);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -305,4 +305,4 @@ public class TestSolrCloudSnapshots extends SolrCloudTestCase {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -309,4 +309,4 @@ public class TestSolrCoreSnapshots extends SolrCloudTestCase {
|
|||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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']"
|
||||
);
|
||||
|
||||
|
|
|
@ -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']"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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']"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -96,4 +96,4 @@ public class MBeansHandlerTest extends SolrTestCaseJ4 {
|
|||
|
||||
assertTrue("external entity ignored properly", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,4 +70,4 @@ public class PropertiesRequestHandlerTest extends SolrTestCaseJ4 {
|
|||
return (NamedList<NamedList<NamedList<Object>>>)
|
||||
parser.processResponse(new StringReader(xml)).get("system.properties");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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]"));
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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_",
|
||||
|
|
|
@ -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']"
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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] + "'"};
|
||||
|
||||
|
|
|
@ -277,4 +277,4 @@ public class TestRestManager extends SolrRestletTestBase {
|
|||
String resourceId = RestManager.ManagedEndpoint.resolveResourceId(testRequest);
|
||||
assertEquals(resourceId, "/schema/analysis/synonyms/de/Ändern");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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']");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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']");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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']");
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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]",
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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]"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue