You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2012/03/05 15:40:20 UTC
svn commit: r1297074 [2/2] - in /lucene/dev/branches/branch_3x: ./ lucene/
lucene/contrib/analyzers/common/src/test/org/apache/lucene/analysis/shingle/
lucene/contrib/analyzers/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/
lucene/contrib/g...
Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/schema/LatLonType.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/schema/LatLonType.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/schema/LatLonType.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/schema/LatLonType.java Mon Mar 5 14:40:17 2012
@@ -349,8 +349,8 @@ class SpatialDistanceQuery extends Query
public SpatialWeight(Searcher searcher) throws IOException {
this.searcher = searcher;
- this.latContext = latSource.newContext();
- this.lonContext = lonSource.newContext();
+ this.latContext = ValueSource.newContext();
+ this.lonContext = ValueSource.newContext();
latSource.createWeight(latContext, searcher);
lonSource.createWeight(lonContext, searcher);
}
Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParserPlugin.java Mon Mar 5 14:40:17 2012
@@ -105,25 +105,25 @@ class ExtendedDismaxQParser extends QPar
SolrParams solrParams = SolrParams.wrapDefaults(localParams, params);
- queryFields = U.parseFieldBoosts(solrParams.getParams(DMP.QF));
+ queryFields = SolrPluginUtils.parseFieldBoosts(solrParams.getParams(DisMaxParams.QF));
if (0 == queryFields.size()) {
queryFields.put(req.getSchema().getDefaultSearchFieldName(), 1.0f);
}
// Boosted phrase of the full query string
Map<String,Float> phraseFields =
- U.parseFieldBoosts(solrParams.getParams(DMP.PF));
+ SolrPluginUtils.parseFieldBoosts(solrParams.getParams(DisMaxParams.PF));
// Boosted Bi-Term Shingles from the query string
Map<String,Float> phraseFields2 =
- U.parseFieldBoosts(solrParams.getParams("pf2"));
+ SolrPluginUtils.parseFieldBoosts(solrParams.getParams("pf2"));
// Boosted Tri-Term Shingles from the query string
Map<String,Float> phraseFields3 =
- U.parseFieldBoosts(solrParams.getParams("pf3"));
+ SolrPluginUtils.parseFieldBoosts(solrParams.getParams("pf3"));
- float tiebreaker = solrParams.getFloat(DMP.TIE, 0.0f);
+ float tiebreaker = solrParams.getFloat(DisMaxParams.TIE, 0.0f);
- int pslop = solrParams.getInt(DMP.PS, 0);
- int qslop = solrParams.getInt(DMP.QS, 0);
+ int pslop = solrParams.getInt(DisMaxParams.PS, 0);
+ int qslop = solrParams.getInt(DisMaxParams.QS, 0);
// remove stopwords from mandatory "matching" component?
boolean stopwords = solrParams.getBool("stopwords", true);
@@ -139,7 +139,7 @@ class ExtendedDismaxQParser extends QPar
altUserQuery = null;
if( userQuery == null || userQuery.length() < 1 ) {
// If no query is specified, we may have an alternate
- String altQ = solrParams.get( DMP.ALTQ );
+ String altQ = solrParams.get( DisMaxParams.ALTQ );
if (altQ != null) {
altQParser = subQuery(altQ, null);
altUserQuery = altQParser.getQuery();
@@ -248,9 +248,9 @@ class ExtendedDismaxQParser extends QPar
}
if (parsedUserQuery != null && doMinMatched) {
- String minShouldMatch = solrParams.get(DMP.MM, "100%");
+ String minShouldMatch = solrParams.get(DisMaxParams.MM, "100%");
if (parsedUserQuery instanceof BooleanQuery) {
- U.setMinShouldMatch((BooleanQuery)parsedUserQuery, minShouldMatch);
+ SolrPluginUtils.setMinShouldMatch((BooleanQuery)parsedUserQuery, minShouldMatch);
}
}
@@ -286,12 +286,12 @@ class ExtendedDismaxQParser extends QPar
parsedUserQuery = up.parse(escapedUserQuery);
// Only do minimum-match logic
- String minShouldMatch = solrParams.get(DMP.MM, "100%");
+ String minShouldMatch = solrParams.get(DisMaxParams.MM, "100%");
if (parsedUserQuery instanceof BooleanQuery) {
BooleanQuery t = new BooleanQuery();
- U.flattenBooleanQuery(t, (BooleanQuery)parsedUserQuery);
- U.setMinShouldMatch(t, minShouldMatch);
+ SolrPluginUtils.flattenBooleanQuery(t, (BooleanQuery)parsedUserQuery);
+ SolrPluginUtils.setMinShouldMatch(t, minShouldMatch);
parsedUserQuery = t;
}
}
@@ -331,7 +331,7 @@ class ExtendedDismaxQParser extends QPar
/* * * Boosting Query * * */
- boostParams = solrParams.getParams(DMP.BQ);
+ boostParams = solrParams.getParams(DisMaxParams.BQ);
//List<Query> boostQueries = U.parseQueryStrings(req, boostParams);
boostQueries=null;
if (boostParams!=null && boostParams.length>0) {
@@ -350,7 +350,7 @@ class ExtendedDismaxQParser extends QPar
/* * * Boosting Functions * * */
- String[] boostFuncs = solrParams.getParams(DMP.BF);
+ String[] boostFuncs = solrParams.getParams(DisMaxParams.BF);
if (null != boostFuncs && 0 != boostFuncs.length) {
for (String boostFunc : boostFuncs) {
if(null == boostFunc || "".equals(boostFunc)) continue;
Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/function/BoostedQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/function/BoostedQuery.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/function/BoostedQuery.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/function/BoostedQuery.java Mon Mar 5 14:40:17 2012
@@ -68,7 +68,7 @@ public class BoostedQuery extends Query
public BoostedWeight(Searcher searcher) throws IOException {
this.searcher = searcher;
this.qWeight = q.createWeight(searcher);
- this.context = boostVal.newContext();
+ this.context = ValueSource.newContext();
boostVal.createWeight(context,searcher);
}
Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/function/FunctionQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/function/FunctionQuery.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/function/FunctionQuery.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/function/FunctionQuery.java Mon Mar 5 14:40:17 2012
@@ -65,7 +65,7 @@ public class FunctionQuery extends Query
public FunctionWeight(Searcher searcher) throws IOException {
this.searcher = searcher;
- this.context = func.newContext();
+ this.context = ValueSource.newContext();
func.createWeight(context, searcher);
}
Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java Mon Mar 5 14:40:17 2012
@@ -23,6 +23,7 @@ import org.apache.lucene.search.grouping
import org.apache.lucene.util.OpenBitSet;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.search.*;
+import org.apache.solr.search.QueryUtils;
import org.apache.solr.search.grouping.distributed.shardresultserializer.ShardResultTransformer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler.java Mon Mar 5 14:40:17 2012
@@ -135,8 +135,8 @@ public class DirectUpdateHandler extends
try {
Term term = new Term(idField.getName(), indexedId);
num = ir.deleteDocuments(term);
- if (core.log.isTraceEnabled()) {
- core.log.trace( core.getLogId()+"deleted " + num + " docs matching id " + idFieldType.indexedToReadable(indexedId));
+ if (SolrCore.log.isTraceEnabled()) {
+ SolrCore.log.trace( core.getLogId()+"deleted " + num + " docs matching id " + idFieldType.indexedToReadable(indexedId));
}
} finally {
try { if (tdocs != null) tdocs.close(); } catch (Exception e) {}
@@ -205,8 +205,8 @@ public class DirectUpdateHandler extends
totDeleted = deleter.deleted;
}
- if (core.log.isDebugEnabled()) {
- core.log.debug(core.getLogId()+"docs deleted:" + totDeleted);
+ if (SolrCore.log.isDebugEnabled()) {
+ SolrCore.log.debug(core.getLogId()+"docs deleted:" + totDeleted);
}
}
Modified: lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java Mon Mar 5 14:40:17 2012
@@ -160,7 +160,7 @@ public class DirectUpdateHandler2 extend
// must only be called when iwCommit lock held
private void deleteAll() throws IOException {
- core.log.info(core.getLogId()+"REMOVING ALL DOCUMENTS FROM INDEX");
+ SolrCore.log.info(core.getLogId()+"REMOVING ALL DOCUMENTS FROM INDEX");
closeWriter();
writer = createMainIndexWriter("DirectUpdateHandler2", true);
}
Modified: lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/analysis/TestWordDelimiterFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/analysis/TestWordDelimiterFilter.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/analysis/TestWordDelimiterFilter.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/analysis/TestWordDelimiterFilter.java Mon Mar 5 14:40:17 2012
@@ -18,6 +18,7 @@
package org.apache.solr.analysis;
import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.BaseTokenStreamTestCase;
import org.apache.lucene.analysis.CharArraySet;
import org.apache.lucene.analysis.ReusableAnalyzerBase;
import org.apache.lucene.analysis.StopFilter;
@@ -298,12 +299,12 @@ public class TestWordDelimiterFilter ext
TokenStream ts = factoryDefault.create(
new WhitespaceTokenizer(BaseTokenTestCase.DEFAULT_VERSION, new StringReader(testText)));
- BaseTokenTestCase.assertTokenStreamContents(ts,
+ BaseTokenStreamTestCase.assertTokenStreamContents(ts,
new String[] { "I", "borrowed", "5", "400", "00", "540000", "at", "25", "interest", "rate", "interestrate" });
ts = factoryDefault.create(
new WhitespaceTokenizer(BaseTokenTestCase.DEFAULT_VERSION, new StringReader("foo\u200Dbar")));
- BaseTokenTestCase.assertTokenStreamContents(ts,
+ BaseTokenStreamTestCase.assertTokenStreamContents(ts,
new String[] { "foo", "bar", "foobar" });
@@ -316,13 +317,13 @@ public class TestWordDelimiterFilter ext
ts = factoryCustom.create(
new WhitespaceTokenizer(BaseTokenTestCase.DEFAULT_VERSION, new StringReader(testText)));
- BaseTokenTestCase.assertTokenStreamContents(ts,
+ BaseTokenStreamTestCase.assertTokenStreamContents(ts,
new String[] { "I", "borrowed", "$5,400.00", "at", "25%", "interest", "rate", "interestrate" });
/* test custom behavior with a char > 0x7F, because we had to make a larger byte[] */
ts = factoryCustom.create(
new WhitespaceTokenizer(BaseTokenTestCase.DEFAULT_VERSION, new StringReader("foo\u200Dbar")));
- BaseTokenTestCase.assertTokenStreamContents(ts,
+ BaseTokenStreamTestCase.assertTokenStreamContents(ts,
new String[] { "foo\u200Dbar" });
}
Modified: lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/core/TestArbitraryIndexDir.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/core/TestArbitraryIndexDir.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/core/TestArbitraryIndexDir.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/core/TestArbitraryIndexDir.java Mon Mar 5 14:40:17 2012
@@ -50,7 +50,7 @@ public class TestArbitraryIndexDir exten
+ System.getProperty("file.separator") + "data");
dataDir.mkdirs();
- solrConfig = h.createConfig("solrconfig.xml");
+ solrConfig = TestHarness.createConfig("solrconfig.xml");
h = new TestHarness( dataDir.getAbsolutePath(),
solrConfig,
"schema12.xml");
Modified: lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java Mon Mar 5 14:40:17 2012
@@ -37,6 +37,7 @@ import org.apache.lucene.search.MatchAll
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.SimpleFSDirectory;
+import org.apache.solr.BaseDistributedSearchTestCase;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.TestDistributedSearch;
import org.apache.solr.client.solrj.SolrServer;
@@ -337,7 +338,7 @@ public class TestReplicationHandler exte
assertEquals(nDocs, slaveQueryResult.getNumFound());
//compare results
- String cmp = TestDistributedSearch.compare(masterQueryResult, slaveQueryResult, 0, null);
+ String cmp = BaseDistributedSearchTestCase.compare(masterQueryResult, slaveQueryResult, 0, null);
assertEquals(null, cmp);
//start config files replication test
@@ -395,7 +396,7 @@ public class TestReplicationHandler exte
assertEquals(nDocs, slaveQueryResult.getNumFound());
//compare results
- String cmp = TestDistributedSearch.compare(masterQueryResult, slaveQueryResult, 0, null);
+ String cmp = BaseDistributedSearchTestCase.compare(masterQueryResult, slaveQueryResult, 0, null);
assertEquals(null, cmp);
// start stop polling test
@@ -475,7 +476,7 @@ public class TestReplicationHandler exte
SolrDocumentList slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");
assertEquals(nDocs, slaveQueryResult.getNumFound());
//compare results
- String cmp = TestDistributedSearch.compare(masterQueryResult, slaveQueryResult, 0, null);
+ String cmp = BaseDistributedSearchTestCase.compare(masterQueryResult, slaveQueryResult, 0, null);
assertEquals(null, cmp);
// NOTE: at this point, the slave is not polling any more
@@ -524,7 +525,7 @@ public class TestReplicationHandler exte
assertEquals(nDocs, slaveQueryResult.getNumFound());
//compare results
- String cmp = TestDistributedSearch.compare(masterQueryResult, slaveQueryResult, 0, null);
+ String cmp = BaseDistributedSearchTestCase.compare(masterQueryResult, slaveQueryResult, 0, null);
assertEquals(null, cmp);
// NOTE: the master only replicates after startup now!
@@ -564,7 +565,7 @@ public class TestReplicationHandler exte
assertEquals(nDocs, slaveQueryResult.getNumFound());
//compare results
- String cmp = TestDistributedSearch.compare(masterQueryResult, slaveQueryResult, 0, null);
+ String cmp = BaseDistributedSearchTestCase.compare(masterQueryResult, slaveQueryResult, 0, null);
assertEquals(null, cmp);
//start config files replication test
Modified: lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/component/DistributedSpellCheckComponentTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/component/DistributedSpellCheckComponentTest.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/component/DistributedSpellCheckComponentTest.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/component/DistributedSpellCheckComponentTest.java Mon Mar 5 14:40:17 2012
@@ -17,12 +17,14 @@ package org.apache.solr.handler.componen
* limitations under the License.
*/
+import junit.framework.Assert;
import junit.framework.TestCase;
import org.apache.solr.BaseDistributedSearchTestCase;
import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.params.ModifiableSolrParams;
+import org.apache.solr.common.params.SpellingParams;
import org.apache.solr.common.util.NamedList;
/**
@@ -81,7 +83,7 @@ public class DistributedSpellCheckCompon
NamedList sc = (NamedList) nl.get("spellcheck");
NamedList sug = (NamedList) sc.get("suggestions");
if(sug.size()==0) {
- TestCase.fail("Control data did not return any suggestions.");
+ Assert.fail("Control data did not return any suggestions.");
}
}
@@ -119,15 +121,15 @@ public class DistributedSpellCheckCompon
handle.put("maxScore", SKIPVAL);
// we care only about the spellcheck results
handle.put("response", SKIP);
- q("q", "*:*", "spellcheck", "true", SpellCheckComponent.SPELLCHECK_BUILD, "true", "qt", "spellCheckCompRH", "shards.qt", "spellCheckCompRH");
+ q("q", "*:*", "spellcheck", "true", SpellingParams.SPELLCHECK_BUILD, "true", "qt", "spellCheckCompRH", "shards.qt", "spellCheckCompRH");
query("q", "*:*", "fl", "id,lowerfilt", "spellcheck.q","toyata", "spellcheck", "true", "qt", "spellCheckCompRH", "shards.qt", "spellCheckCompRH");
- query("q", "*:*", "fl", "id,lowerfilt", "spellcheck.q","toyata", "spellcheck", "true", "qt", "spellCheckCompRH", "shards.qt", "spellCheckCompRH", SpellCheckComponent.SPELLCHECK_EXTENDED_RESULTS, "true");
- query("q", "*:*", "fl", "id,lowerfilt", "spellcheck.q","bluo", "spellcheck", "true", "qt", "spellCheckCompRH", "shards.qt", "spellCheckCompRH", SpellCheckComponent.SPELLCHECK_EXTENDED_RESULTS, "true", SpellCheckComponent.SPELLCHECK_COUNT, "4");
- query("q", "The quick reb fox jumped over the lazy brown dogs", "fl", "id,lowerfilt", "spellcheck", "true", "qt", "spellCheckCompRH", "shards.qt", "spellCheckCompRH", SpellCheckComponent.SPELLCHECK_EXTENDED_RESULTS, "true", SpellCheckComponent.SPELLCHECK_COUNT, "4", SpellCheckComponent.SPELLCHECK_COLLATE, "true");
-
- query("q", "lowerfilt:(+quock +reb)", "fl", "id,lowerfilt", "spellcheck", "true", "qt", "spellCheckCompRH", "shards.qt", "spellCheckCompRH", SpellCheckComponent.SPELLCHECK_EXTENDED_RESULTS, "true", SpellCheckComponent.SPELLCHECK_COUNT, "10", SpellCheckComponent.SPELLCHECK_COLLATE, "true", SpellCheckComponent.SPELLCHECK_MAX_COLLATION_TRIES, "10", SpellCheckComponent.SPELLCHECK_MAX_COLLATIONS, "10", SpellCheckComponent.SPELLCHECK_COLLATE_EXTENDED_RESULTS, "true");
- query("q", "lowerfilt:(+quock +reb)", "fl", "id,lowerfilt", "spellcheck", "true", "qt", "spellCheckCompRH", "shards.qt", "spellCheckCompRH", SpellCheckComponent.SPELLCHECK_EXTENDED_RESULTS, "true", SpellCheckComponent.SPELLCHECK_COUNT, "10", SpellCheckComponent.SPELLCHECK_COLLATE, "true", SpellCheckComponent.SPELLCHECK_MAX_COLLATION_TRIES, "10", SpellCheckComponent.SPELLCHECK_MAX_COLLATIONS, "10", SpellCheckComponent.SPELLCHECK_COLLATE_EXTENDED_RESULTS, "false");
- query("q", "lowerfilt:(+quock +reb)", "fl", "id,lowerfilt", "spellcheck", "true", "qt", "spellCheckCompRH", "shards.qt", "spellCheckCompRH", SpellCheckComponent.SPELLCHECK_EXTENDED_RESULTS, "true", SpellCheckComponent.SPELLCHECK_COUNT, "10", SpellCheckComponent.SPELLCHECK_COLLATE, "true", SpellCheckComponent.SPELLCHECK_MAX_COLLATION_TRIES, "0", SpellCheckComponent.SPELLCHECK_MAX_COLLATIONS, "1", SpellCheckComponent.SPELLCHECK_COLLATE_EXTENDED_RESULTS, "false");
+ query("q", "*:*", "fl", "id,lowerfilt", "spellcheck.q","toyata", "spellcheck", "true", "qt", "spellCheckCompRH", "shards.qt", "spellCheckCompRH", SpellingParams.SPELLCHECK_EXTENDED_RESULTS, "true");
+ query("q", "*:*", "fl", "id,lowerfilt", "spellcheck.q","bluo", "spellcheck", "true", "qt", "spellCheckCompRH", "shards.qt", "spellCheckCompRH", SpellingParams.SPELLCHECK_EXTENDED_RESULTS, "true", SpellingParams.SPELLCHECK_COUNT, "4");
+ query("q", "The quick reb fox jumped over the lazy brown dogs", "fl", "id,lowerfilt", "spellcheck", "true", "qt", "spellCheckCompRH", "shards.qt", "spellCheckCompRH", SpellingParams.SPELLCHECK_EXTENDED_RESULTS, "true", SpellingParams.SPELLCHECK_COUNT, "4", SpellingParams.SPELLCHECK_COLLATE, "true");
+
+ query("q", "lowerfilt:(+quock +reb)", "fl", "id,lowerfilt", "spellcheck", "true", "qt", "spellCheckCompRH", "shards.qt", "spellCheckCompRH", SpellingParams.SPELLCHECK_EXTENDED_RESULTS, "true", SpellingParams.SPELLCHECK_COUNT, "10", SpellingParams.SPELLCHECK_COLLATE, "true", SpellingParams.SPELLCHECK_MAX_COLLATION_TRIES, "10", SpellingParams.SPELLCHECK_MAX_COLLATIONS, "10", SpellingParams.SPELLCHECK_COLLATE_EXTENDED_RESULTS, "true");
+ query("q", "lowerfilt:(+quock +reb)", "fl", "id,lowerfilt", "spellcheck", "true", "qt", "spellCheckCompRH", "shards.qt", "spellCheckCompRH", SpellingParams.SPELLCHECK_EXTENDED_RESULTS, "true", SpellingParams.SPELLCHECK_COUNT, "10", SpellingParams.SPELLCHECK_COLLATE, "true", SpellingParams.SPELLCHECK_MAX_COLLATION_TRIES, "10", SpellingParams.SPELLCHECK_MAX_COLLATIONS, "10", SpellingParams.SPELLCHECK_COLLATE_EXTENDED_RESULTS, "false");
+ query("q", "lowerfilt:(+quock +reb)", "fl", "id,lowerfilt", "spellcheck", "true", "qt", "spellCheckCompRH", "shards.qt", "spellCheckCompRH", SpellingParams.SPELLCHECK_EXTENDED_RESULTS, "true", SpellingParams.SPELLCHECK_COUNT, "10", SpellingParams.SPELLCHECK_COLLATE, "true", SpellingParams.SPELLCHECK_MAX_COLLATION_TRIES, "0", SpellingParams.SPELLCHECK_MAX_COLLATIONS, "1", SpellingParams.SPELLCHECK_COLLATE_EXTENDED_RESULTS, "false");
}
}
Modified: lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java Mon Mar 5 14:40:17 2012
@@ -32,6 +32,7 @@ import org.apache.solr.request.SolrQuery
import org.apache.solr.request.SolrRequestHandler;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.spelling.AbstractLuceneSpellChecker;
+import org.apache.solr.spelling.SolrSpellChecker;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -76,12 +77,12 @@ public class SpellCheckComponentTest ext
@Test
public void testExtendedResultsCount() throws Exception {
- assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellCheckComponent.SPELLCHECK_BUILD, "true", "q","bluo", SpellCheckComponent.SPELLCHECK_COUNT,"5", SpellCheckComponent.SPELLCHECK_EXTENDED_RESULTS,"false")
+ assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellingParams.SPELLCHECK_BUILD, "true", "q","bluo", SpellingParams.SPELLCHECK_COUNT,"5", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"false")
,"/spellcheck/suggestions/[0]=='bluo'"
,"/spellcheck/suggestions/[1]/numFound==5"
);
- assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","bluo", SpellCheckComponent.SPELLCHECK_COUNT,"3", SpellCheckComponent.SPELLCHECK_EXTENDED_RESULTS,"true")
+ assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","bluo", SpellingParams.SPELLCHECK_COUNT,"3", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"true")
,"/spellcheck/suggestions/[1]/suggestion==[{'word':'blud','freq':1}, {'word':'blue','freq':1}, {'word':'blee','freq':1}]"
);
}
@@ -96,7 +97,7 @@ public class SpellCheckComponentTest ext
@Test
public void testPerDictionary() throws Exception {
- assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellCheckComponent.SPELLCHECK_BUILD, "true", "q","documemt"
+ assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellingParams.SPELLCHECK_BUILD, "true", "q","documemt"
, SpellingParams.SPELLCHECK_DICT, "perDict", SpellingParams.SPELLCHECK_PREFIX + ".perDict.foo", "bar", SpellingParams.SPELLCHECK_PREFIX + ".perDict.bar", "foo")
,"/spellcheck/suggestions/bar=={'numFound':1, 'startOffset':0, 'endOffset':1, 'suggestion':['foo']}"
,"/spellcheck/suggestions/foo=={'numFound':1, 'startOffset':2, 'endOffset':3, 'suggestion':['bar']}"
@@ -105,16 +106,16 @@ public class SpellCheckComponentTest ext
@Test
public void testCollate() throws Exception {
- assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellCheckComponent.SPELLCHECK_BUILD, "true", "q","documemt", SpellCheckComponent.SPELLCHECK_COLLATE, "true")
+ assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", SpellingParams.SPELLCHECK_BUILD, "true", "q","documemt", SpellingParams.SPELLCHECK_COLLATE, "true")
,"/spellcheck/suggestions/collation=='document'"
);
- assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","documemt lowerfilt:broen^4", SpellCheckComponent.SPELLCHECK_COLLATE, "true")
+ assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","documemt lowerfilt:broen^4", SpellingParams.SPELLCHECK_COLLATE, "true")
,"/spellcheck/suggestions/collation=='document lowerfilt:brown^4'"
);
- assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","documemtsss broens", SpellCheckComponent.SPELLCHECK_COLLATE, "true")
+ assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","documemtsss broens", SpellingParams.SPELLCHECK_COLLATE, "true")
,"/spellcheck/suggestions/collation=='document brown'"
);
- assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","pixma", SpellCheckComponent.SPELLCHECK_COLLATE, "true")
+ assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","pixma", SpellingParams.SPELLCHECK_COLLATE, "true")
,"/spellcheck/suggestions/collation=='pixmaa'"
);
}
@@ -123,10 +124,10 @@ public class SpellCheckComponentTest ext
@Test
public void testCorrectSpelling() throws Exception {
// Make sure correct spellings are signaled in the response
- assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","lowerfilt:lazy lowerfilt:brown", SpellCheckComponent.SPELLCHECK_EXTENDED_RESULTS, "true")
+ assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","lowerfilt:lazy lowerfilt:brown", SpellingParams.SPELLCHECK_EXTENDED_RESULTS, "true")
,"/spellcheck/suggestions=={'correctlySpelled':true}"
);
- assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","lakkle", SpellCheckComponent.SPELLCHECK_EXTENDED_RESULTS, "true")
+ assertJQ(req("json.nl","map", "qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","lakkle", SpellingParams.SPELLCHECK_EXTENDED_RESULTS, "true")
,"/spellcheck/suggestions/correctlySpelled==false"
);
}
@@ -156,7 +157,7 @@ public class SpellCheckComponentTest ext
NamedList args = new NamedList();
NamedList spellchecker = new NamedList();
- spellchecker.add(AbstractLuceneSpellChecker.DICTIONARY_NAME, "default");
+ spellchecker.add(SolrSpellChecker.DICTIONARY_NAME, "default");
spellchecker.add(AbstractLuceneSpellChecker.FIELD, "lowerfilt");
spellchecker.add(AbstractLuceneSpellChecker.INDEX_DIR, "spellchecker1");
args.add("spellchecker", spellchecker);
@@ -201,7 +202,7 @@ public class SpellCheckComponentTest ext
//So with a threshold of 29%, "another" is absent from the dictionary
//while "document" is present.
- assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","documenq", SpellCheckComponent.SPELLCHECK_DICT, "threshold", SpellCheckComponent.SPELLCHECK_COUNT,"5", SpellCheckComponent.SPELLCHECK_EXTENDED_RESULTS,"true")
+ assertJQ(req("qt",rh, SpellCheckComponent.COMPONENT_NAME, "true", "q","documenq", SpellingParams.SPELLCHECK_DICT, "threshold", SpellingParams.SPELLCHECK_COUNT,"5", SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"true")
,"/spellcheck/suggestions/[1]/suggestion==[{'word':'document','freq':2}]"
);
@@ -212,9 +213,9 @@ public class SpellCheckComponentTest ext
ModifiableSolrParams params = new ModifiableSolrParams();
params.add(SpellCheckComponent.COMPONENT_NAME, "true");
- params.add(SpellCheckComponent.SPELLCHECK_COUNT, "10");
- params.add(SpellCheckComponent.SPELLCHECK_DICT, "threshold");
- params.add(SpellCheckComponent.SPELLCHECK_EXTENDED_RESULTS,"true");
+ params.add(SpellingParams.SPELLCHECK_COUNT, "10");
+ params.add(SpellingParams.SPELLCHECK_DICT, "threshold");
+ params.add(SpellingParams.SPELLCHECK_EXTENDED_RESULTS,"true");
params.add(CommonParams.Q, "anotheq");
SolrRequestHandler handler = core.getRequestHandler("spellCheckCompRH");
Modified: lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/spelling/FileBasedSpellCheckerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/spelling/FileBasedSpellCheckerTest.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/spelling/FileBasedSpellCheckerTest.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/spelling/FileBasedSpellCheckerTest.java Mon Mar 5 14:40:17 2012
@@ -66,11 +66,11 @@ public class FileBasedSpellCheckerTest e
spellchecker.add(SolrSpellChecker.DICTIONARY_NAME, "external");
spellchecker.add(AbstractLuceneSpellChecker.LOCATION, "spellings.txt");
- spellchecker.add(IndexBasedSpellChecker.FIELD, "teststop");
+ spellchecker.add(AbstractLuceneSpellChecker.FIELD, "teststop");
spellchecker.add(FileBasedSpellChecker.SOURCE_FILE_CHAR_ENCODING, "UTF-8");
File indexDir = new File(TEMP_DIR, "spellingIdx" + new Date().getTime());
indexDir.mkdirs();
- spellchecker.add(FileBasedSpellChecker.INDEX_DIR, indexDir.getAbsolutePath());
+ spellchecker.add(AbstractLuceneSpellChecker.INDEX_DIR, indexDir.getAbsolutePath());
SolrCore core = h.getCore();
String dictName = checker.init(spellchecker, core);
assertTrue(dictName + " is not equal to " + "external", dictName.equals("external") == true);
@@ -102,12 +102,12 @@ public class FileBasedSpellCheckerTest e
spellchecker.add("classname", FileBasedSpellChecker.class.getName());
spellchecker.add(SolrSpellChecker.DICTIONARY_NAME, "external");
spellchecker.add(AbstractLuceneSpellChecker.LOCATION, "spellings.txt");
- spellchecker.add(IndexBasedSpellChecker.FIELD, "teststop");
+ spellchecker.add(AbstractLuceneSpellChecker.FIELD, "teststop");
spellchecker.add(FileBasedSpellChecker.SOURCE_FILE_CHAR_ENCODING, "UTF-8");
File indexDir = new File(TEMP_DIR, "spellingIdx" + new Date().getTime());
indexDir.mkdirs();
- spellchecker.add(FileBasedSpellChecker.INDEX_DIR, indexDir.getAbsolutePath());
- spellchecker.add(FileBasedSpellChecker.FIELD_TYPE, "teststop");
+ spellchecker.add(AbstractLuceneSpellChecker.INDEX_DIR, indexDir.getAbsolutePath());
+ spellchecker.add(SolrSpellChecker.FIELD_TYPE, "teststop");
spellchecker.add(AbstractLuceneSpellChecker.SPELLCHECKER_ARG_NAME, spellchecker);
SolrCore core = h.getCore();
String dictName = checker.init(spellchecker, core);
@@ -149,8 +149,8 @@ public class FileBasedSpellCheckerTest e
spellchecker.add(SolrSpellChecker.DICTIONARY_NAME, "external");
spellchecker.add(AbstractLuceneSpellChecker.LOCATION, "spellings.txt");
spellchecker.add(FileBasedSpellChecker.SOURCE_FILE_CHAR_ENCODING, "UTF-8");
- spellchecker.add(IndexBasedSpellChecker.FIELD, "teststop");
- spellchecker.add(FileBasedSpellChecker.FIELD_TYPE, "teststop");
+ spellchecker.add(AbstractLuceneSpellChecker.FIELD, "teststop");
+ spellchecker.add(SolrSpellChecker.FIELD_TYPE, "teststop");
spellchecker.add(AbstractLuceneSpellChecker.SPELLCHECKER_ARG_NAME, spellchecker);
SolrCore core = h.getCore();
Modified: lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/spelling/IndexBasedSpellCheckerTest.java Mon Mar 5 14:40:17 2012
@@ -109,7 +109,7 @@ public class IndexBasedSpellCheckerTest
File indexDir = new File(TEMP_DIR, "spellingIdx" + new Date().getTime());
indexDir.mkdirs();
spellchecker.add(AbstractLuceneSpellChecker.INDEX_DIR, indexDir.getAbsolutePath());
- spellchecker.add(IndexBasedSpellChecker.FIELD, "title");
+ spellchecker.add(AbstractLuceneSpellChecker.FIELD, "title");
spellchecker.add(AbstractLuceneSpellChecker.SPELLCHECKER_ARG_NAME, spellchecker);
SolrCore core = h.getCore();
@@ -185,7 +185,7 @@ public class IndexBasedSpellCheckerTest
File indexDir = new File(TEMP_DIR, "spellingIdx" + new Date().getTime());
indexDir.mkdirs();
spellchecker.add(AbstractLuceneSpellChecker.INDEX_DIR, indexDir.getAbsolutePath());
- spellchecker.add(IndexBasedSpellChecker.FIELD, "title");
+ spellchecker.add(AbstractLuceneSpellChecker.FIELD, "title");
spellchecker.add(AbstractLuceneSpellChecker.SPELLCHECKER_ARG_NAME, spellchecker);
SolrCore core = h.getCore();
String dictName = checker.init(spellchecker, core);
@@ -242,7 +242,7 @@ public class IndexBasedSpellCheckerTest
File indexDir = new File(TEMP_DIR, "spellingIdx" + new Date().getTime());
indexDir.mkdirs();
spellchecker.add(AbstractLuceneSpellChecker.INDEX_DIR, indexDir.getAbsolutePath());
- spellchecker.add(IndexBasedSpellChecker.FIELD, "title");
+ spellchecker.add(AbstractLuceneSpellChecker.FIELD, "title");
spellchecker.add(AbstractLuceneSpellChecker.SPELLCHECKER_ARG_NAME, spellchecker);
spellchecker.add(AbstractLuceneSpellChecker.STRING_DISTANCE, JaroWinklerDistance.class.getName());
SolrCore core = h.getCore();
@@ -297,7 +297,7 @@ public class IndexBasedSpellCheckerTest
indexDir.mkdirs();
spellchecker.add(AbstractLuceneSpellChecker.INDEX_DIR, indexDir.getAbsolutePath());
spellchecker.add(AbstractLuceneSpellChecker.LOCATION, altIndexDir.getAbsolutePath());
- spellchecker.add(IndexBasedSpellChecker.FIELD, "title");
+ spellchecker.add(AbstractLuceneSpellChecker.FIELD, "title");
spellchecker.add(AbstractLuceneSpellChecker.SPELLCHECKER_ARG_NAME, spellchecker);
SolrCore core = h.getCore();
String dictName = checker.init(spellchecker, core);
Modified: lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/spelling/SpellCheckCollatorTest.java Mon Mar 5 14:40:17 2012
@@ -23,6 +23,7 @@ import java.util.Set;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.ModifiableSolrParams;
+import org.apache.solr.common.params.SpellingParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
import org.apache.solr.core.SolrCore;
@@ -58,9 +59,9 @@ public class SpellCheckCollatorTest exte
ModifiableSolrParams params = new ModifiableSolrParams();
params.add(SpellCheckComponent.COMPONENT_NAME, "true");
- params.add(SpellCheckComponent.SPELLCHECK_BUILD, "true");
- params.add(SpellCheckComponent.SPELLCHECK_COUNT, "10");
- params.add(SpellCheckComponent.SPELLCHECK_COLLATE, "true");
+ params.add(SpellingParams.SPELLCHECK_BUILD, "true");
+ params.add(SpellingParams.SPELLCHECK_COUNT, "10");
+ params.add(SpellingParams.SPELLCHECK_COLLATE, "true");
params.add(CommonParams.Q, "lowerfilt:(hypenated-wotd)");
{
@@ -110,11 +111,11 @@ public class SpellCheckCollatorTest exte
ModifiableSolrParams params = new ModifiableSolrParams();
params.add(SpellCheckComponent.COMPONENT_NAME, "true");
- params.add(SpellCheckComponent.SPELLCHECK_BUILD, "true");
- params.add(SpellCheckComponent.SPELLCHECK_COUNT, "10");
- params.add(SpellCheckComponent.SPELLCHECK_COLLATE, "true");
- params.add(SpellCheckComponent.SPELLCHECK_MAX_COLLATION_TRIES, "10");
- params.add(SpellCheckComponent.SPELLCHECK_MAX_COLLATIONS, "10");
+ params.add(SpellingParams.SPELLCHECK_BUILD, "true");
+ params.add(SpellingParams.SPELLCHECK_COUNT, "10");
+ params.add(SpellingParams.SPELLCHECK_COLLATE, "true");
+ params.add(SpellingParams.SPELLCHECK_MAX_COLLATION_TRIES, "10");
+ params.add(SpellingParams.SPELLCHECK_MAX_COLLATIONS, "10");
params.add(CommonParams.Q, "lowerfilt:(+fauth +home +loane)");
params.add(CommonParams.FQ, "NOT(id:1)");
@@ -145,12 +146,12 @@ public class SpellCheckCollatorTest exte
ModifiableSolrParams params = new ModifiableSolrParams();
params.add(SpellCheckComponent.COMPONENT_NAME, "true");
- params.add(SpellCheckComponent.SPELLCHECK_DICT, "multipleFields");
- params.add(SpellCheckComponent.SPELLCHECK_BUILD, "true");
- params.add(SpellCheckComponent.SPELLCHECK_COUNT, "10");
- params.add(SpellCheckComponent.SPELLCHECK_COLLATE, "true");
- params.add(SpellCheckComponent.SPELLCHECK_MAX_COLLATION_TRIES, "1");
- params.add(SpellCheckComponent.SPELLCHECK_MAX_COLLATIONS, "1");
+ params.add(SpellingParams.SPELLCHECK_DICT, "multipleFields");
+ params.add(SpellingParams.SPELLCHECK_BUILD, "true");
+ params.add(SpellingParams.SPELLCHECK_COUNT, "10");
+ params.add(SpellingParams.SPELLCHECK_COLLATE, "true");
+ params.add(SpellingParams.SPELLCHECK_MAX_COLLATION_TRIES, "1");
+ params.add(SpellingParams.SPELLCHECK_MAX_COLLATIONS, "1");
params.add(CommonParams.Q, "peac");
//SpellCheckCompRH has no "qf" defined. It will not find "peace" from "peac" despite it being in the dictionary
@@ -169,7 +170,7 @@ public class SpellCheckCollatorTest exte
//SpellCheckCompRH1 has "lowerfilt1" defined in the "qf" param. It will find "peace" from "peac" because
//requrying field "lowerfilt1" returns the hit.
- params.remove(SpellCheckComponent.SPELLCHECK_BUILD);
+ params.remove(SpellingParams.SPELLCHECK_BUILD);
handler = core.getRequestHandler("spellCheckCompRH1");
rsp = new SolrQueryResponse();
rsp.add("responseHeader", new SimpleOrderedMap());
@@ -192,11 +193,11 @@ public class SpellCheckCollatorTest exte
ModifiableSolrParams params = new ModifiableSolrParams();
params.add(CommonParams.QT, "spellCheckCompRH");
params.add(CommonParams.Q, "lowerfilt:(+fauth +home +loane)");
- params.add(SpellCheckComponent.SPELLCHECK_EXTENDED_RESULTS, "true");
+ params.add(SpellingParams.SPELLCHECK_EXTENDED_RESULTS, "true");
params.add(SpellCheckComponent.COMPONENT_NAME, "true");
- params.add(SpellCheckComponent.SPELLCHECK_BUILD, "true");
- params.add(SpellCheckComponent.SPELLCHECK_COUNT, "10");
- params.add(SpellCheckComponent.SPELLCHECK_COLLATE, "true");
+ params.add(SpellingParams.SPELLCHECK_BUILD, "true");
+ params.add(SpellingParams.SPELLCHECK_COUNT, "10");
+ params.add(SpellingParams.SPELLCHECK_COLLATE, "true");
// Testing backwards-compatible behavior.
// Returns 1 collation as a single string.
@@ -216,9 +217,9 @@ public class SpellCheckCollatorTest exte
// Testing backwards-compatible response format but will only return a
// collation that would return results.
- params.remove(SpellCheckComponent.SPELLCHECK_BUILD);
- params.add(SpellCheckComponent.SPELLCHECK_MAX_COLLATION_TRIES, "5");
- params.add(SpellCheckComponent.SPELLCHECK_MAX_COLLATIONS, "1");
+ params.remove(SpellingParams.SPELLCHECK_BUILD);
+ params.add(SpellingParams.SPELLCHECK_MAX_COLLATION_TRIES, "5");
+ params.add(SpellingParams.SPELLCHECK_MAX_COLLATIONS, "1");
handler = core.getRequestHandler("spellCheckCompRH");
rsp = new SolrQueryResponse();
rsp.add("responseHeader", new SimpleOrderedMap());
@@ -233,10 +234,10 @@ public class SpellCheckCollatorTest exte
// Testing returning multiple collations if more than one valid
// combination exists.
- params.remove(SpellCheckComponent.SPELLCHECK_MAX_COLLATION_TRIES);
- params.remove(SpellCheckComponent.SPELLCHECK_MAX_COLLATIONS);
- params.add(SpellCheckComponent.SPELLCHECK_MAX_COLLATION_TRIES, "10");
- params.add(SpellCheckComponent.SPELLCHECK_MAX_COLLATIONS, "2");
+ params.remove(SpellingParams.SPELLCHECK_MAX_COLLATION_TRIES);
+ params.remove(SpellingParams.SPELLCHECK_MAX_COLLATIONS);
+ params.add(SpellingParams.SPELLCHECK_MAX_COLLATION_TRIES, "10");
+ params.add(SpellingParams.SPELLCHECK_MAX_COLLATIONS, "2");
handler = core.getRequestHandler("spellCheckCompRH");
rsp = new SolrQueryResponse();
rsp.add("responseHeader", new SimpleOrderedMap());
@@ -255,7 +256,7 @@ public class SpellCheckCollatorTest exte
// Testing return multiple collations with expanded collation response
// format.
- params.add(SpellCheckComponent.SPELLCHECK_COLLATE_EXTENDED_RESULTS, "true");
+ params.add(SpellingParams.SPELLCHECK_COLLATE_EXTENDED_RESULTS, "true");
handler = core.getRequestHandler("spellCheckCompRH");
rsp = new SolrQueryResponse();
rsp.add("responseHeader", new SimpleOrderedMap());
Modified: lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/util/DateMathParserTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/util/DateMathParserTest.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/util/DateMathParserTest.java (original)
+++ lucene/dev/branches/branch_3x/solr/core/src/test/org/apache/solr/util/DateMathParserTest.java Mon Mar 5 14:40:17 2012
@@ -167,7 +167,8 @@ public class DateMathParserTest extends
Date trash = p.parseMath("+7YEARS");
trash = p.parseMath("/MONTH");
trash = p.parseMath("-5DAYS+20MINUTES");
- Thread.currentThread().sleep(5);
+ Thread.currentThread();
+ Thread.sleep(5);
String a = fmt.format(p.parseMath(""));
assertEquals("State of DateMathParser changed", e, a);
Modified: lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java (original)
+++ lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java Mon Mar 5 14:40:17 2012
@@ -240,7 +240,7 @@ public class TestLBHttpSolrServer extend
}
public void setUp() throws Exception {
- File home = new File(SolrTestCaseJ4.TEMP_DIR,
+ File home = new File(LuceneTestCase.TEMP_DIR,
getClass().getName() + "-" + System.currentTimeMillis());
Modified: lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java (original)
+++ lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/JettyWebappTest.java Mon Mar 5 14:40:17 2012
@@ -56,7 +56,7 @@ public class JettyWebappTest extends Luc
super.setUp();
System.setProperty("solr.solr.home", ExternalPaths.EXAMPLE_HOME);
- File dataDir = new File(SolrTestCaseJ4.TEMP_DIR,
+ File dataDir = new File(LuceneTestCase.TEMP_DIR,
getClass().getName() + "-" + System.currentTimeMillis());
dataDir.mkdirs();
System.setProperty("solr.data.dir", dataDir.getCanonicalPath());
Modified: lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/common/util/TestFastInputStream.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/common/util/TestFastInputStream.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/common/util/TestFastInputStream.java (original)
+++ lucene/dev/branches/branch_3x/solr/solrj/src/test/org/apache/solr/common/util/TestFastInputStream.java Mon Mar 5 14:40:17 2012
@@ -38,7 +38,7 @@ public class TestFastInputStream extends
String ss = "Helloooooooooooooooooooo";
writeChars(gzos, ss, 0, ss.length());
gzos.close();
- NamedListCodec.writeVInt(10, fos);
+ JavaBinCodec.writeVInt(10, fos);
fos.flushBuffer();
GZIPInputStream gzis = new GZIPInputStream(new ByteArrayInputStream(b.toByteArray(), 0, b.size()));
char[] cbuf = new char[ss.length()];
Modified: lucene/dev/branches/branch_3x/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java (original)
+++ lucene/dev/branches/branch_3x/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java Mon Mar 5 14:40:17 2012
@@ -17,6 +17,7 @@ package org.apache.solr;
* limitations under the License.
*/
+import junit.framework.Assert;
import junit.framework.TestCase;
import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.SolrServerException;
@@ -539,7 +540,7 @@ public abstract class BaseDistributedSea
cmp = compare(a.getResponse(), b.getResponse(), flags, handle);
if (cmp != null) {
log.info("Mismatched responses:\n" + a + "\n" + b);
- TestCase.fail(cmp);
+ Assert.fail(cmp);
}
}
Modified: lucene/dev/branches/branch_3x/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java (original)
+++ lucene/dev/branches/branch_3x/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java Mon Mar 5 14:40:17 2012
@@ -280,7 +280,7 @@ public abstract class SolrTestCaseJ4 ext
String configFile = getSolrConfigFile();
if (configFile != null) {
- solrConfig = h.createConfig(getSolrConfigFile());
+ solrConfig = TestHarness.createConfig(getSolrConfigFile());
h = new TestHarness( dataDir.getAbsolutePath(),
solrConfig,
getSchemaFile());
@@ -524,13 +524,13 @@ public abstract class SolrTestCaseJ4 ext
* @see TestHarness#optimize
*/
public static String optimize(String... args) {
- return h.optimize(args);
+ return TestHarness.optimize(args);
}
/**
* @see TestHarness#commit
*/
public static String commit(String... args) {
- return h.commit(args);
+ return TestHarness.commit(args);
}
/**
@@ -595,7 +595,7 @@ public abstract class SolrTestCaseJ4 ext
* @see TestHarness#deleteById
*/
public static String delI(String id) {
- return h.deleteById(id);
+ return TestHarness.deleteById(id);
}
/**
* Generates a <delete>... XML string for an query
@@ -603,7 +603,7 @@ public abstract class SolrTestCaseJ4 ext
* @see TestHarness#deleteByQuery
*/
public static String delQ(String q) {
- return h.deleteByQuery(q);
+ return TestHarness.deleteByQuery(q);
}
/**
@@ -614,7 +614,7 @@ public abstract class SolrTestCaseJ4 ext
*/
public static XmlDoc doc(String... fieldsAndValues) {
XmlDoc d = new XmlDoc();
- d.xml = h.makeSimpleDoc(fieldsAndValues).toString();
+ d.xml = TestHarness.makeSimpleDoc(fieldsAndValues).toString();
return d;
}
Modified: lucene/dev/branches/branch_3x/solr/test-framework/src/java/org/apache/solr/util/AbstractSolrTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/solr/test-framework/src/java/org/apache/solr/util/AbstractSolrTestCase.java?rev=1297074&r1=1297073&r2=1297074&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/solr/test-framework/src/java/org/apache/solr/util/AbstractSolrTestCase.java (original)
+++ lucene/dev/branches/branch_3x/solr/test-framework/src/java/org/apache/solr/util/AbstractSolrTestCase.java Mon Mar 5 14:40:17 2012
@@ -154,7 +154,7 @@ public abstract class AbstractSolrTestCa
System.setProperty("solr.solr.home", getSolrHome());
if (configFile != null) {
- solrConfig = h.createConfig(getSolrConfigFile());
+ solrConfig = TestHarness.createConfig(getSolrConfigFile());
h = new TestHarness( dataDir.getAbsolutePath(),
solrConfig,
getSchemaFile());
@@ -312,13 +312,13 @@ public abstract class AbstractSolrTestCa
* @see TestHarness#optimize
*/
public String optimize(String... args) {
- return h.optimize(args);
+ return TestHarness.optimize(args);
}
/**
* @see TestHarness#commit
*/
public String commit(String... args) {
- return h.commit(args);
+ return TestHarness.commit(args);
}
/**
@@ -397,7 +397,7 @@ public abstract class AbstractSolrTestCa
* @see TestHarness#deleteById
*/
public String delI(String id, String... args) {
- return h.deleteById(id, args);
+ return TestHarness.deleteById(id, args);
}
/**
@@ -406,7 +406,7 @@ public abstract class AbstractSolrTestCa
* @see TestHarness#deleteByQuery
*/
public String delQ(String q, String... args) {
- return h.deleteByQuery(q, args);
+ return TestHarness.deleteByQuery(q, args);
}
/**
@@ -417,7 +417,7 @@ public abstract class AbstractSolrTestCa
*/
public Doc doc(String... fieldsAndValues) {
Doc d = new Doc();
- d.xml = h.makeSimpleDoc(fieldsAndValues).toString();
+ d.xml = TestHarness.makeSimpleDoc(fieldsAndValues).toString();
return d;
}