Apache Lucene open-source search software
only spellchecker tests need create spellcheck indexes
Robert Muir91a60c381893
diff --git a/solr/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java b/solr/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.javaindex 6c500016e9a..0367bd9be1d 100644--- a/solr/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java+++ b/solr/src/test/org/apache/solr/handler/component/SpellCheckComponentTest.java@@ -42,7 +42,7 @@ public class SpellCheckComponentTest extends SolrTestCaseJ4 {@BeforeClasspublic static void beforeClass() throws Exception {- initCore("solrconfig.xml","schema.xml");+ initCore("solrconfig-spellcheckcomponent.xml","schema.xml");assertU(adoc("id", "0", "lowerfilt", "This is a title"));assertU((adoc("id", "1", "lowerfilt","The quick reb fox jumped over the lazy brown dogs.")));diff --git a/solr/src/test/test-files/solr/conf/solrconfig-spellcheckcomponent.xml b/solr/src/test/test-files/solr/conf/solrconfig-spellcheckcomponent.xmlnew file mode 100644index 00000000000..b0009882875--- /dev/null+++ b/solr/src/test/test-files/solr/conf/solrconfig-spellcheckcomponent.xml@@ -0,0 +1,130 @@+<?xml version="1.0" ?>++<!--+ Licensed to the Apache Software Foundation (ASF) under one or more+ contributor license agreements. See the NOTICE file distributed with+ this work for additional information regarding copyright ownership.+ The ASF licenses this file to You under the Apache License, Version 2.0+ (the "License"); you may not use this file except in compliance with+ the License. You may obtain a copy of the License at++ http://www.apache.org/licenses/LICENSE-2.0++ Unless required by applicable law or agreed to in writing, software+ distributed under the License is distributed on an "AS IS" BASIS,+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ See the License for the specific language governing permissions and+ limitations under the License.+-->++<!-- $Id: solrconfig.xml 382610 2006-03-03 01:43:03Z yonik $+ $Source$+ $Name$++Config for testing spellcheck component+ -->++<config>++ <requestHandler name="standard"+ class="solr.StandardRequestHandler"></requestHandler>++ <!-- Used to specify an alternate directory to hold all index data.+ It defaults to "index" if not present, and should probably+ not be changed if replication is in use. -->+ <dataDir>${solr.data.dir:./solr/data}</dataDir>++ <!-- The DirectoryFactory to use for indexes.+ solr.StandardDirectoryFactory, the default, is filesystem based.+ solr.RAMDirectoryFactory is memory based and not persistent. -->+ <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>++ <searchComponent name="spellcheck" class="org.apache.solr.handler.component.SpellCheckComponent">+ <!-- This is slightly different from the field value so we can test dealing with token offset changes -->+ <str name="queryAnalyzerFieldType">lowerpunctfilt</str>++ <lst name="spellchecker">+ <str name="name">default</str>+ <str name="field">lowerfilt</str>+ <str name="spellcheckIndexDir">spellchecker1</str>+ <str name="buildOnCommit">true</str>+ </lst>+ <lst name="spellchecker">+ <str name="name">multipleFields</str>+ <str name="field">lowerfilt1and2</str>+ <str name="spellcheckIndexDir">spellcheckerMultipleFields</str>+ <str name="buildOnCommit">true</str>+ </lst>+ <!-- Example of using different distance measure -->+ <lst name="spellchecker">+ <str name="name">jarowinkler</str>+ <str name="field">lowerfilt</str>+ <!-- Use a different Distance Measure -->+ <str name="distanceMeasure">org.apache.lucene.search.spell.JaroWinklerDistance</str>+ <str name="spellcheckIndexDir">spellchecker2</str>++ </lst>+ <lst name="spellchecker">+ <str name="classname">solr.FileBasedSpellChecker</str>+ <str name="name">external</str>+ <str name="sourceLocation">spellings.txt</str>+ <str name="characterEncoding">UTF-8</str>+ <str name="spellcheckIndexDir">spellchecker3</str>+ </lst>+ <!-- Comparator -->+ <lst name="spellchecker">+ <str name="name">freq</str>+ <str name="field">lowerfilt</str>+ <str name="spellcheckIndexDir">spellcheckerFreq</str>+ <!-- comparatorClass be one of:+ 1. score (default)+ 2. freq (Frequency first, then score)+ 3. A fully qualified class name+ -->+ <str name="comparatorClass">freq</str>+ <str name="buildOnCommit">true</str>+ </lst>+ <lst name="spellchecker">+ <str name="name">fqcn</str>+ <str name="field">lowerfilt</str>+ <str name="spellcheckIndexDir">spellcheckerFQCN</str>+ <str name="comparatorClass">org.apache.solr.spelling.SampleComparator</str>+ <str name="buildOnCommit">true</str>+ </lst>+ <lst name="spellchecker">+ <str name="name">perDict</str>+ <str name="classname">org.apache.solr.handler.component.DummyCustomParamSpellChecker</str>+ <str name="field">lowerfilt</str>+ </lst>+ </searchComponent>++ <!--+ The SpellingQueryConverter to convert raw (CommonParams.Q) queries into tokens. Uses a simple regular expression+ to strip off field markup, boosts, ranges, etc. but it is not guaranteed to match an exact parse from the query parser.+ -->+ <queryConverter name="queryConverter" class="org.apache.solr.spelling.SpellingQueryConverter"/>++ <requestHandler name="spellCheckCompRH" class="org.apache.solr.handler.component.SearchHandler">+ <lst name="defaults">+ <!-- omp = Only More Popular -->+ <str name="spellcheck.onlyMorePopular">false</str>+ <!-- exr = Extended Results -->+ <str name="spellcheck.extendedResults">false</str>+ <!-- The number of suggestions to return -->+ <str name="spellcheck.count">1</str>+ </lst>+ <arr name="last-components">+ <str>spellcheck</str>+ </arr>+ </requestHandler>+ <requestHandler name="spellCheckCompRH1" class="org.apache.solr.handler.component.SearchHandler">+ <lst name="defaults">+ <str name="defType">dismax</str>+ <str name="qf">lowerfilt1^1</str>+ </lst>+ <arr name="last-components">+ <str>spellcheck</str>+ </arr>+ </requestHandler>++</config>diff --git a/solr/src/test/test-files/solr/conf/solrconfig.xml b/solr/src/test/test-files/solr/conf/solrconfig.xmlindex 25ac9aef2c6..81e6a075f66 100644--- a/solr/src/test/test-files/solr/conf/solrconfig.xml+++ b/solr/src/test/test-files/solr/conf/solrconfig.xml@@ -340,13 +340,13 @@<str name="name">default</str><str name="field">lowerfilt</str><str name="spellcheckIndexDir">spellchecker1</str>- <str name="buildOnCommit">true</str>+ <str name="buildOnCommit">false</str></lst><lst name="spellchecker"><str name="name">multipleFields</str><str name="field">lowerfilt1and2</str><str name="spellcheckIndexDir">spellcheckerMultipleFields</str>- <str name="buildOnCommit">true</str>+ <str name="buildOnCommit">false</str></lst><!-- Example of using different distance measure --><lst name="spellchecker">@@ -375,14 +375,14 @@3. A fully qualified class name--><str name="comparatorClass">freq</str>- <str name="buildOnCommit">true</str>+ <str name="buildOnCommit">false</str></lst><lst name="spellchecker"><str name="name">fqcn</str><str name="field">lowerfilt</str><str name="spellcheckIndexDir">spellcheckerFQCN</str><str name="comparatorClass">org.apache.solr.spelling.SampleComparator</str>- <str name="buildOnCommit">true</str>+ <str name="buildOnCommit">false</str></lst><lst name="spellchecker"><str name="name">perDict</str>