SOLR-12879 - added missing test for min_hash qp to QueryEqualityTest

This commit is contained in:
Tommaso Teofili 2018-10-25 09:57:16 +02:00
parent 3e87499d72
commit 26e14986af
2 changed files with 22 additions and 0 deletions

View File

@ -445,6 +445,14 @@
<!-- A specialized field for geospatial search. If indexed, this fieldType must not be multivalued. -->
<fieldType name="location" class="solr.LatLonType" subFieldSuffix="_coordinate"/>
<fieldType name="text_min_hash" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.ICUTokenizerFactory"/>
<filter class="solr.ICUFoldingFilterFactory"/>
<filter class="solr.ShingleFilterFactory" minShingleSize="5" outputUnigrams="false" outputUnigramsIfNoShingles="false" maxShingleSize="5" tokenSeparator=" "/>
<filter class="org.apache.lucene.analysis.minhash.MinHashFilterFactory" bucketCount="512" hashSetSize="1" hashCount="1"/>
</analyzer>
</fieldType>
<field name="id" type="string" indexed="true" stored="true" multiValued="false" required="true"/>
<field name="signatureField" type="string" indexed="true" stored="false"/>
@ -554,6 +562,8 @@
<field name="multi_int_with_docvals" type="tint" multiValued="true" docValues="true" indexed="false"/>
<field name="min_hash_analysed" type="text_min_hash" multiValued="false" indexed="true" stored="false"/>
<dynamicField name="*_coordinate" type="tdouble" indexed="true" stored="false"/>
<dynamicField name="*_sI" type="string" indexed="true" stored="false"/>

View File

@ -327,6 +327,18 @@ public class QueryEqualityTest extends SolrTestCaseJ4 {
}
}
public void testMinHash() throws Exception {
SolrQueryRequest req = req("q","apache lucene is a search library",
"df", "min_hash_analyzed");
try {
assertQueryEquals("min_hash", req,
"{!min_hash field=\"min_hash_analysed\"}apache lucene is a search library");
} finally {
req.close();
}
}
public void testQueryNested() throws Exception {
SolrQueryRequest req = req("df", "foo_s");
try {