You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by to...@apache.org on 2018/10/25 07:57:21 UTC
lucene-solr:master: SOLR-12879 - added missing test for min_hash qp
to QueryEqualityTest
Repository: lucene-solr
Updated Branches:
refs/heads/master 3e87499d7 -> 26e14986a
SOLR-12879 - added missing test for min_hash qp to QueryEqualityTest
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/26e14986
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/26e14986
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/26e14986
Branch: refs/heads/master
Commit: 26e14986af7aa60b72940f611f63b2a50fbb9980
Parents: 3e87499
Author: Tommaso Teofili <te...@adobe.com>
Authored: Thu Oct 25 09:57:16 2018 +0200
Committer: Tommaso Teofili <te...@adobe.com>
Committed: Thu Oct 25 09:57:16 2018 +0200
----------------------------------------------------------------------
.../src/test-files/solr/collection1/conf/schema15.xml | 10 ++++++++++
.../test/org/apache/solr/search/QueryEqualityTest.java | 12 ++++++++++++
2 files changed, 22 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/26e14986/solr/core/src/test-files/solr/collection1/conf/schema15.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema15.xml b/solr/core/src/test-files/solr/collection1/conf/schema15.xml
index 361344f..c8328ac 100644
--- a/solr/core/src/test-files/solr/collection1/conf/schema15.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/schema15.xml
@@ -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"/>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/26e14986/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java b/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java
index be7fe91..cabe497 100644
--- a/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java
+++ b/solr/core/src/test/org/apache/solr/search/QueryEqualityTest.java
@@ -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 {