Apache Lucene open-source search software
merge from r1467413
Erik Hatcherdfd50b74388c
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex e366a964f56..0d3407d2907 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -180,6 +180,12 @@ Bug Fixes* SOLR-4695: Fix core admin SPLIT action to be useful with non-cloud setups (shalin)+* SOLR-4680: Correct example spellcheck configuration's queryAnalyzerFieldType and+ use "text" field instead of narrower "name" field (ehatcher, Mark Bennett)++* SOLR-4702: Fix example /browse "Did you mean?" suggestion feature. (ehatcher, Mark Bennett)++Optimizations----------------------diff --git a/solr/example/solr/collection1/conf/solrconfig.xml b/solr/example/solr/collection1/conf/solrconfig.xmlindex 1e6b1b670d9..ea7ce7e86ff 100755--- a/solr/example/solr/collection1/conf/solrconfig.xml+++ b/solr/example/solr/collection1/conf/solrconfig.xml@@ -1236,7 +1236,7 @@--><searchComponent name="spellcheck" class="solr.SpellCheckComponent">- <str name="queryAnalyzerFieldType">textSpell</str>+ <str name="queryAnalyzerFieldType">text_general</str><!-- Multiple "Spell Checkers" can be declared and used by thiscomponent@@ -1245,7 +1245,7 @@<!-- a spellchecker built from a field of the main index --><lst name="spellchecker"><str name="name">default</str>- <str name="field">name</str>+ <str name="field">text</str><str name="classname">solr.DirectSolrSpellChecker</str><!-- the spellcheck distance measure used, the default is the internal levenshtein --><str name="distanceMeasure">internal</str>diff --git a/solr/example/solr/collection1/conf/velocity/browse.vm b/solr/example/solr/collection1/conf/velocity/browse.vmindex b31df9be3ae..0cd9199b2eb 100644--- a/solr/example/solr/collection1/conf/velocity/browse.vm+++ b/solr/example/solr/collection1/conf/velocity/browse.vm@@ -4,9 +4,7 @@#set($mltResults = $response.response.get("moreLikeThis"))#set($annotate = $params.get("annotateBrowse"))#parse('query.vm')-#if($response.response.spellcheck.suggestions and $response.response.spellcheck.suggestions.size() > 0)- Did you mean <a href="#url_for_home?q=$esc.url($response.response.spellcheck.suggestions.collation)#if($list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end#debug">$response.response.spellcheck.suggestions.collation</a>?-#end+#parse('did_you_mean.vm')<div class="navigators">#parse("facets.vm")diff --git a/solr/example/solr/collection1/conf/velocity/did_you_mean.vm b/solr/example/solr/collection1/conf/velocity/did_you_mean.vmnew file mode 100644index 00000000000..ae69b131558--- /dev/null+++ b/solr/example/solr/collection1/conf/velocity/did_you_mean.vm@@ -0,0 +1,4 @@+#set($dym = $response.response.spellcheck.suggestions.collation.collationQuery)+#if($dym)+ Did you mean <a href="#{url_for_home}#{lensNoQ}&q=$esc.url($dym)">$esc.html($dym)</a>?+#end\ No newline at end of file