You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2013/05/30 09:53:46 UTC
svn commit: r1487777 [48/50] - in /lucene/dev/branches/security: ./
dev-tools/ dev-tools/eclipse/dot.settings/ dev-tools/idea/.idea/
dev-tools/idea/.idea/libraries/ dev-tools/idea/lucene/replicator/
dev-tools/maven/ dev-tools/maven/lucene/ dev-tools/ma...
Modified: lucene/dev/branches/security/solr/example/multicore/solr.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/multicore/solr.xml?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/multicore/solr.xml (original)
+++ lucene/dev/branches/security/solr/example/multicore/solr.xml Thu May 30 07:53:18 2013
@@ -28,7 +28,7 @@
adminPath: RequestHandler path to manage cores.
If 'null' (or absent), cores will not be manageable via request handler
-->
- <cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:}">
+ <cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:8983}" hostContext="${hostContext:solr}">
<core name="core0" instanceDir="core0" />
<core name="core1" instanceDir="core1" />
</cores>
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/admin-extra.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/admin-extra.html?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/admin-extra.html (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/admin-extra.html Thu May 30 07:53:18 2013
@@ -15,17 +15,10 @@
limitations under the License.
-->
-<!-- The content of this page will be statically included into the top
-of the admin page. Uncomment this as an example to see there the content
-will show up.
-
-<hr>
-<i>This line will appear before the first table</i>
-<tr>
-<td colspan="2">
-This row will be appended to the end of the first table
-</td>
-</tr>
-<hr>
+<!-- The content of this page will be statically included into the top-
+right box of the cores overview page. Uncomment this as an example to
+see there the content will show up.
+<img src="img/ico/construction.png"> This line will appear at the top-
+right box on collection1's Overview
-->
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/admin-extra.menu-bottom.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/admin-extra.menu-bottom.html?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/admin-extra.menu-bottom.html (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/admin-extra.menu-bottom.html Thu May 30 07:53:18 2013
@@ -1 +1,25 @@
+<!--
+ 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.
+-->
+
<!-- admin-extra.menu-bottom.html -->
+<!--
+<li>
+ <a href="#" style="background-image: url(img/ico/construction.png);">
+ LAST ITEM
+ </a>
+</li>
+-->
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/admin-extra.menu-top.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/admin-extra.menu-top.html?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/admin-extra.menu-top.html (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/admin-extra.menu-top.html Thu May 30 07:53:18 2013
@@ -1 +1,25 @@
+<!--
+ 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.
+-->
+
<!-- admin-extra.menu-top.html -->
+<!--
+<li>
+ <a href="#" style="background-image: url(img/ico/construction.png);">
+ FIRST ITEM
+ </a>
+</li>
+-->
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/lang/stopwords_fr.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/lang/stopwords_fr.txt?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/lang/stopwords_fr.txt (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/lang/stopwords_fr.txt Thu May 30 07:53:18 2013
@@ -167,7 +167,8 @@ eussent
| Later additions (from Jean-Christophe Deschamps)
ceci | this
-celà  | that
+cela | that
+celà | that
cet | this
cette | this
ici | here
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/schema.xml?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/schema.xml (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/schema.xml Thu May 30 07:53:18 2013
@@ -440,7 +440,7 @@
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
<!-- in this example, we will only use synonyms at query time
<filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
-->
@@ -448,7 +448,7 @@
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
@@ -466,13 +466,10 @@
<filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
-->
<!-- Case insensitive stop word removal.
- add enablePositionIncrements=true in both the index and query
- analyzers to leave a 'gap' for more accurate phrase queries.
-->
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="lang/stopwords_en.txt"
- enablePositionIncrements="true"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
@@ -488,7 +485,6 @@
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="lang/stopwords_en.txt"
- enablePositionIncrements="true"
/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.EnglishPossessiveFilterFactory"/>
@@ -516,13 +512,10 @@
<filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
-->
<!-- Case insensitive stop word removal.
- add enablePositionIncrements=true in both the index and query
- analyzers to leave a 'gap' for more accurate phrase queries.
-->
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="lang/stopwords_en.txt"
- enablePositionIncrements="true"
/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
@@ -535,7 +528,6 @@
<filter class="solr.StopFilterFactory"
ignoreCase="true"
words="lang/stopwords_en.txt"
- enablePositionIncrements="true"
/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
@@ -566,7 +558,7 @@
<fieldType name="text_general_rev" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.ReversedWildcardFilterFactory" withOriginal="true"
maxPosAsterisk="3" maxPosQuestion="2" maxFractionAsterisk="0.33"/>
@@ -574,7 +566,7 @@
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
@@ -614,7 +606,7 @@
See the Java Regular Expression documentation for more
information on pattern and replacement string syntax.
- http://java.sun.com/j2se/1.6.0/docs/api/java/util/regex/package-summary.html
+ http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html
-->
<filter class="solr.PatternReplaceFilterFactory"
pattern="([^a-z])" replacement="" replace="all"
@@ -730,7 +722,7 @@
<tokenizer class="solr.StandardTokenizerFactory"/>
<!-- for any non-arabic -->
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ar.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ar.txt" />
<!-- normalizes ﻯ to ﻱ, etc -->
<filter class="solr.ArabicNormalizationFilterFactory"/>
<filter class="solr.ArabicStemFilterFactory"/>
@@ -742,7 +734,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_bg.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_bg.txt" />
<filter class="solr.BulgarianStemFilterFactory"/>
</analyzer>
</fieldType>
@@ -754,7 +746,7 @@
<!-- removes l', etc -->
<filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_ca.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ca.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ca.txt" />
<filter class="solr.SnowballPorterFilterFactory" language="Catalan"/>
</analyzer>
</fieldType>
@@ -776,7 +768,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_cz.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_cz.txt" />
<filter class="solr.CzechStemFilterFactory"/>
</analyzer>
</fieldType>
@@ -786,7 +778,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_da.txt" format="snowball" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_da.txt" format="snowball" />
<filter class="solr.SnowballPorterFilterFactory" language="Danish"/>
</analyzer>
</fieldType>
@@ -796,7 +788,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_de.txt" format="snowball" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_de.txt" format="snowball" />
<filter class="solr.GermanNormalizationFilterFactory"/>
<filter class="solr.GermanLightStemFilterFactory"/>
<!-- less aggressive: <filter class="solr.GermanMinimalStemFilterFactory"/> -->
@@ -810,7 +802,7 @@
<tokenizer class="solr.StandardTokenizerFactory"/>
<!-- greek specific lowercase for sigma -->
<filter class="solr.GreekLowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="false" words="lang/stopwords_el.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="false" words="lang/stopwords_el.txt" />
<filter class="solr.GreekStemFilterFactory"/>
</analyzer>
</fieldType>
@@ -820,7 +812,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_es.txt" format="snowball" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_es.txt" format="snowball" />
<filter class="solr.SpanishLightStemFilterFactory"/>
<!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="Spanish"/> -->
</analyzer>
@@ -831,7 +823,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_eu.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_eu.txt" />
<filter class="solr.SnowballPorterFilterFactory" language="Basque"/>
</analyzer>
</fieldType>
@@ -845,7 +837,7 @@
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.ArabicNormalizationFilterFactory"/>
<filter class="solr.PersianNormalizationFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fa.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fa.txt" />
</analyzer>
</fieldType>
@@ -854,7 +846,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fi.txt" format="snowball" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fi.txt" format="snowball" />
<filter class="solr.SnowballPorterFilterFactory" language="Finnish"/>
<!-- less aggressive: <filter class="solr.FinnishLightStemFilterFactory"/> -->
</analyzer>
@@ -867,7 +859,7 @@
<!-- removes l', etc -->
<filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_fr.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fr.txt" format="snowball" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_fr.txt" format="snowball" />
<filter class="solr.FrenchLightStemFilterFactory"/>
<!-- less aggressive: <filter class="solr.FrenchMinimalStemFilterFactory"/> -->
<!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="French"/> -->
@@ -881,9 +873,9 @@
<!-- removes d', etc -->
<filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_ga.txt"/>
<!-- removes n-, etc. position increments is intentionally false! -->
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/hyphenations_ga.txt" enablePositionIncrements="false"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/hyphenations_ga.txt"/>
<filter class="solr.IrishLowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ga.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ga.txt"/>
<filter class="solr.SnowballPorterFilterFactory" language="Irish"/>
</analyzer>
</fieldType>
@@ -893,7 +885,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_gl.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_gl.txt" />
<filter class="solr.GalicianStemFilterFactory"/>
<!-- less aggressive: <filter class="solr.GalicianMinimalStemFilterFactory"/> -->
</analyzer>
@@ -908,7 +900,7 @@
<filter class="solr.IndicNormalizationFilterFactory"/>
<!-- normalizes variation in spelling -->
<filter class="solr.HindiNormalizationFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hi.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hi.txt" />
<filter class="solr.HindiStemFilterFactory"/>
</analyzer>
</fieldType>
@@ -918,7 +910,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hu.txt" format="snowball" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hu.txt" format="snowball" />
<filter class="solr.SnowballPorterFilterFactory" language="Hungarian"/>
<!-- less aggressive: <filter class="solr.HungarianLightStemFilterFactory"/> -->
</analyzer>
@@ -929,7 +921,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hy.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_hy.txt" />
<filter class="solr.SnowballPorterFilterFactory" language="Armenian"/>
</analyzer>
</fieldType>
@@ -939,7 +931,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_id.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_id.txt" />
<!-- for a less aggressive approach (only inflectional suffixes), set stemDerivational to false -->
<filter class="solr.IndonesianStemFilterFactory" stemDerivational="true"/>
</analyzer>
@@ -952,7 +944,7 @@
<!-- removes l', etc -->
<filter class="solr.ElisionFilterFactory" ignoreCase="true" articles="lang/contractions_it.txt"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_it.txt" format="snowball" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_it.txt" format="snowball" />
<filter class="solr.ItalianLightStemFilterFactory"/>
<!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="Italian"/> -->
</analyzer>
@@ -999,11 +991,11 @@
<!-- Reduces inflected verbs and adjectives to their base/dictionary forms (è¾æ¸å½¢) -->
<filter class="solr.JapaneseBaseFormFilterFactory"/>
<!-- Removes tokens with certain part-of-speech tags -->
- <filter class="solr.JapanesePartOfSpeechStopFilterFactory" tags="lang/stoptags_ja.txt" enablePositionIncrements="true"/>
+ <filter class="solr.JapanesePartOfSpeechStopFilterFactory" tags="lang/stoptags_ja.txt" />
<!-- Normalizes full-width romaji to half-width and half-width kana to full-width (Unicode NFKC subset) -->
<filter class="solr.CJKWidthFilterFactory"/>
<!-- Removes common tokens typically not useful for search, but have a negative effect on ranking -->
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ja.txt" enablePositionIncrements="true" />
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ja.txt" />
<!-- Normalizes common katakana spelling variations by removing any last long sound character (U+30FC) -->
<filter class="solr.JapaneseKatakanaStemFilterFactory" minimumLength="4"/>
<!-- Lower-cases romaji characters -->
@@ -1016,7 +1008,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_lv.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_lv.txt" />
<filter class="solr.LatvianStemFilterFactory"/>
</analyzer>
</fieldType>
@@ -1026,7 +1018,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_nl.txt" format="snowball" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_nl.txt" format="snowball" />
<filter class="solr.StemmerOverrideFilterFactory" dictionary="lang/stemdict_nl.txt" ignoreCase="false"/>
<filter class="solr.SnowballPorterFilterFactory" language="Dutch"/>
</analyzer>
@@ -1037,7 +1029,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_no.txt" format="snowball" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_no.txt" format="snowball" />
<filter class="solr.SnowballPorterFilterFactory" language="Norwegian"/>
<!-- less aggressive: <filter class="solr.NorwegianLightStemFilterFactory"/> -->
<!-- singular/plural: <filter class="solr.NorwegianMinimalStemFilterFactory"/> -->
@@ -1049,7 +1041,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_pt.txt" format="snowball" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_pt.txt" format="snowball" />
<filter class="solr.PortugueseLightStemFilterFactory"/>
<!-- less aggressive: <filter class="solr.PortugueseMinimalStemFilterFactory"/> -->
<!-- more aggressive: <filter class="solr.SnowballPorterFilterFactory" language="Portuguese"/> -->
@@ -1062,7 +1054,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ro.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ro.txt" />
<filter class="solr.SnowballPorterFilterFactory" language="Romanian"/>
</analyzer>
</fieldType>
@@ -1072,7 +1064,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ru.txt" format="snowball" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_ru.txt" format="snowball" />
<filter class="solr.SnowballPorterFilterFactory" language="Russian"/>
<!-- less aggressive: <filter class="solr.RussianLightStemFilterFactory"/> -->
</analyzer>
@@ -1083,7 +1075,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_sv.txt" format="snowball" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_sv.txt" format="snowball" />
<filter class="solr.SnowballPorterFilterFactory" language="Swedish"/>
<!-- less aggressive: <filter class="solr.SwedishLightStemFilterFactory"/> -->
</analyzer>
@@ -1095,7 +1087,7 @@
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.ThaiWordFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_th.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_th.txt" />
</analyzer>
</fieldType>
@@ -1104,7 +1096,7 @@
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.TurkishLowerCaseFilterFactory"/>
- <filter class="solr.StopFilterFactory" ignoreCase="false" words="lang/stopwords_tr.txt" enablePositionIncrements="true"/>
+ <filter class="solr.StopFilterFactory" ignoreCase="false" words="lang/stopwords_tr.txt" />
<filter class="solr.SnowballPorterFilterFactory" language="Turkish"/>
</analyzer>
</fieldType>
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/solrconfig.xml?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/solrconfig.xml (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/solrconfig.xml Thu May 30 07:53:18 2013
@@ -82,9 +82,9 @@
<lib dir="../../../dist/" regex="solr-velocity-\d.*\.jar" />
<!-- If a 'dir' option (with or without a regex) is used and nothing
- is found that matches, it will be ignored
+ is found that matches, a warning will be logged.
-->
- <lib dir="/total/crap/dir/ignored" />
+ <lib dir="/non/existent/dir/yields/warning" />
<!-- an exact 'path' can be used instead of a 'dir' to specify a
specific jar file. This will cause a serious error to be logged
@@ -132,6 +132,28 @@
-->
<codecFactory class="solr.SchemaCodecFactory"/>
+ <!-- To enable dynamic schema REST APIs, use the following for <schemaFactory>:
+
+ <schemaFactory class="ManagedIndexSchemaFactory">
+ <bool name="mutable">true</bool>
+ <str name="managedSchemaResourceName">managed-schema</str>
+ </schemaFactory>
+
+ When ManagedIndexSchemaFactory is specified, Solr will load the schema from
+ he resource named in 'managedSchemaResourceName', rather than from schema.xml.
+ Note that the managed schema resource CANNOT be named schema.xml. If the managed
+ schema does not exist, Solr will create it after reading schema.xml, then rename
+ 'schema.xml' to 'schema.xml.bak'.
+
+ Do NOT hand edit the managed schema - external modifications will be ignored and
+ overwritten as a result of schema modification REST API calls.
+
+ When ManagedIndexSchemaFactory is specified with mutable = true, schema
+ modification REST API calls will be allowed; otherwise, error responses will be
+ sent back for these requests.
+ -->
+ <schemaFactory class="ClassicIndexSchemaFactory"/>
+
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index Config - These settings control low-level behavior of indexing
Most example settings here show the default value, but are commented
@@ -678,6 +700,13 @@
POST. You can use POST to pass request parameters not
fitting into the URL.
+ addHttpRequestToContext - if set to true, it will instruct
+ the requestParsers to include the original HttpServletRequest
+ object in the context map of the SolrQueryRequest under the
+ key "httpRequest". It will not be used by any of the existing
+ Solr components, but may be useful when developing custom
+ plugins.
+
*** WARNING ***
The settings below authorize Solr to fetch remote files, You
should make sure your system has some authentication before
@@ -686,7 +715,8 @@
-->
<requestParsers enableRemoteStreaming="true"
multipartUploadLimitInKB="2048000"
- formdataUploadLimitInKB="2048"/>
+ formdataUploadLimitInKB="2048"
+ addHttpRequestToContext="false"/>
<!-- HTTP Caching
@@ -1214,7 +1244,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 this
component
@@ -1223,7 +1253,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>
@@ -1709,6 +1739,7 @@
<queryResponseWriter name="php" class="solr.PHPResponseWriter"/>
<queryResponseWriter name="phps" class="solr.PHPSerializedResponseWriter"/>
<queryResponseWriter name="csv" class="solr.CSVResponseWriter"/>
+ <queryResponseWriter name="schema.xml" class="solr.SchemaXmlResponseWriter"/>
-->
<queryResponseWriter name="json" class="solr.JSONResponseWriter">
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/VM_global_library.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/VM_global_library.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/VM_global_library.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/VM_global_library.vm Thu May 30 07:53:18 2013
@@ -1,3 +1,8 @@
+#**
+ * Global macros used by other templates.
+ * This file must be named VM_global_library.vm
+ * in order for Velocity to find it.
+ *#
#macro(param $key)$request.params.get($key)#end
@@ -167,4 +172,4 @@ $math.toDouble($math.add($inval,$gapval)
#else
$math.add($inval,$gapval)##
#end
-#end
\ No newline at end of file
+#end
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/browse.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/browse.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/browse.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/browse.vm Thu May 30 07:53:18 2013
@@ -1,52 +1,33 @@
-#set($searcher=$request.searcher)
-#set($params=$request.params)
+#**
+ * Main entry point into the /browse templates
+ *#
+
+#set($searcher = $request.searcher)
+#set($params = $request.params)
#set($clusters = $response.response.clusters)
#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('query_form.vm')
+#parse('did_you_mean.vm')
<div class="navigators">
#parse("facets.vm")
</div>
<div class="pagination">
- #if($response.response.get('grouped'))
- <span><span class="results-found">$response.response.get('grouped').size() group(s)</span> found in ${response.responseHeader.QTime} ms</span>
- #else<span><span class="results-found">$page.results_found</span> results found in ${response.responseHeader.QTime} ms</span>
- Page <span class="page-num">$page.current_page_number</span> of <span
- class="page-count">$page.page_count</span>#end
+ #parse("pagination_top.vm")
</div>
+## Show Error Message, if any
<div class="error">
- #if(${response.response.error.code})
- <h1>ERROR ${response.response.error.code}</h1>
- ${response.response.error.msg}
- #end
+ #parse("error.vm")
</div>
+## Render Results, actual matching docs
<div class="results">
- #if($response.response.get('grouped'))
- #foreach($grouping in $response.response.get('grouped'))
- #parse("hitGrouped.vm")
- #end
- #else
- #foreach($doc in $response.results)
- #parse("hit.vm")
- #end
- #end
+ #parse("results_list.vm")
</div>
<div class="pagination">
- #if($response.response.get('grouped'))
- #else
- #link_to_previous_page("previous")
- <span class="results-found">$page.results_found</span> results found.
- Page <span class="page-num">$page.current_page_number</span> of <span
- class="page-count">$page.page_count</span>
- #link_to_next_page("next")
- #end
- <br/>
+ #parse("pagination_bottom.vm")
</div>
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/cluster.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/cluster.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/cluster.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/cluster.vm Thu May 30 07:53:18 2013
@@ -1,9 +1,19 @@
-<h2 #annTitle("Clusters generated by Carrot2 using the /clustering RequestHandler")>Clusters</h2>
+#**
+ * Check if Clustering is Enabled and then
+ * call cluster_results.vm
+ *#
+
+<h2 #annTitle("Clusters generated by Carrot2 using the /clustering RequestHandler")>
+ Clusters
+</h2>
+
+## Div tag has placeholder text by default
<div id="clusters">
Run Solr with java -Dsolr.clustering.enabled=true -jar start.jar to see results
</div>
-<script type="text/javascript">
+## Replace the div content *if* Carrot^2 is available
+<script type="text/javascript">
$('#clusters').load("#url_for_solr/clustering#lens",
- {'wt':'velocity', 'v.template':"clusterResults"});
+ {'wt':'velocity', 'v.template':"cluster_results"});
</script>
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/debug.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/debug.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/debug.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/debug.vm Thu May 30 07:53:18 2013
@@ -1,17 +1,28 @@
-#if($params.getBool("debugQuery",false))
- <a href="#" onclick='jQuery(this).siblings("pre").toggle(); return false;'>toggle explain</a>
- <pre style="display:none">$response.getExplainMap().get($doc.getFirstValue('id'))</pre>
- <a href="#" onclick='jQuery(this).siblings("pre2").toggle(); return false;'>toggle all fields</a>
+#**
+ * Show Debugging Information, if enabled
+ *#
+
+#if( $params.getBool("debugQuery",false) )
+ <a href="#" onclick='jQuery(this).siblings("pre").toggle(); return false;'>
+ toggle explain</a>
+
+ <pre style="display:none">
+ $response.getExplainMap().get($doc.getFirstValue('id'))
+ </pre>
+
+ <a href="#" onclick='jQuery(this).siblings("pre2").toggle(); return false;'>
+ toggle all fields</a>
+
<pre2 style="display:none">
- #foreach($fieldname in $doc.fieldNames)
- <br>
- <span class="field-name">$fieldname :</span>
- <span>
- #foreach($value in $doc.getFieldValues($fieldname))
- $esc.html($value)
- #end
- </span>
- #end
- </br>
+ #foreach($fieldname in $doc.fieldNames)
+ <br>
+ <span class="field-name">$fieldname :</span>
+ <span>
+ #foreach($value in $doc.getFieldValues($fieldname))
+ $esc.html($value)
+ #end
+ </span>
+ </br>
+ #end
</pre2>
-#end
\ No newline at end of file
+#end
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_fields.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_fields.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_fields.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_fields.vm Thu May 30 07:53:18 2013
@@ -1,15 +1,23 @@
+#**
+ * Display facets based on field values
+ * e.g.: fields specified by &facet.field=
+ *#
+
#if($response.facetFields)
- <h2 #annTitle("Facets generated by adding &facet.field= to the request")>Field Facets</h2>
- #foreach($field in $response.facetFields)
- ## Hide facets without value
- #if($field.values.size() > 0)
+ <h2 #annTitle("Facets generated by adding &facet.field= to the request")>
+ Field Facets
+ </h2>
+ #foreach($field in $response.facetFields)
+ ## Hide facets without value
+ #if($field.values.size() > 0)
<span class="facet-field">$field.name</span>
-
<ul>
#foreach($facet in $field.values)
- <li><a href="#url_for_facet_filter($field.name, $facet.name)">$facet.name</a> ($facet.count)</li>
+ <li>
+ <a href="#url_for_facet_filter($field.name, $facet.name)">$facet.name</a> ($facet.count)
+ </li>
#end
</ul>
- #end
- #end
- #end
\ No newline at end of file
+ #end ## end if > 0
+ #end ## end for each facet field
+#end ## end if response has facet fields
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_pivot.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_pivot.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_pivot.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_pivot.vm Thu May 30 07:53:18 2013
@@ -1,3 +1,12 @@
-<h2 #annTitle("Facets generated by adding &facet.pivot= to the request")>Pivot Facets</h2>
+#**
+ * Display Pivot-Based Facets
+ * e.g.: facets specified by &facet.pivot=
+ *#
+
+<h2 #annTitle("Facets generated by adding &facet.pivot= to the request")>
+ Pivot Facets
+</h2>
+
#set($pivot = $response.response.facet_counts.facet_pivot)
+
#display_facet_pivot($pivot, "")
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_queries.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_queries.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_queries.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_queries.vm Thu May 30 07:53:18 2013
@@ -1,3 +1,12 @@
+#**
+ * Display facets based on specific facet queries
+ * e.g.: facets specified by &facet.query=
+ *#
+
#set($field = $response.response.facet_counts.facet_queries)
-<h2 #annTitle("Facets generated by adding &facet.query= to the request")>Query Facets</h2>
-#display_facet_query($field, "", "")
\ No newline at end of file
+
+<h2 #annTitle("Facets generated by adding &facet.query= to the request")>
+ Query Facets
+</h2>
+
+#display_facet_query($field, "", "")
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_ranges.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_ranges.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_ranges.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facet_ranges.vm Thu May 30 07:53:18 2013
@@ -1,4 +1,12 @@
-<h2 #annTitle("Facets generated by adding &facet.range= to the request")>Range Facets</h2>
+#**
+ * Display facets based on ranges of values, AKA "Bukets"
+ * e.g.: ranges specified by &facet.range=
+ *#
+
+<h2 #annTitle("Facets generated by adding &facet.range= to the request")>
+ Range Facets
+</h2>
+
#foreach ($field in $response.response.facet_counts.facet_ranges)
## Hide facets without value
#if($field.value.counts.size() > 0)
@@ -11,5 +19,5 @@
#set($before = $field.value.before)
#set($after = $field.value.after)
#display_facet_range($f, $display, $name, $start, $end, $gap, $before, $after)
- #end
-#end
\ No newline at end of file
+ #end ## end if has any values
+#end ## end for each facet range
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facets.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facets.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facets.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/facets.vm Thu May 30 07:53:18 2013
@@ -1,5 +1,10 @@
+#**
+ * Overall Facet display block
+ * Invokes the 4 facet and 1 cluster template
+ *#
+
#parse('facet_fields.vm')
#parse('facet_queries.vm')
#parse('facet_ranges.vm')
#parse('facet_pivot.vm')
-#parse('cluster.vm')
\ No newline at end of file
+#parse('cluster.vm')
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/footer.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/footer.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/footer.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/footer.vm Thu May 30 07:53:18 2013
@@ -1,17 +1,43 @@
+#**
+ * Render the bottom section of the page visible to users
+ *#
+
<hr/>
<div>
<span>Options:</span>
+
#if($request.params.get('debugQuery'))
- <a href="#url_for_home?#q#if($list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end">disable debug</a>
+ <a href="#url_for_home?#q#if($list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end">
+ disable debug</a>
#else
- <a href="#url_for_lens&debugQuery=true&fl=*,score">enable debug</a>
+ <a href="#url_for_lens&debugQuery=true&fl=*,score">
+ enable debug</a>
#end
+ -
#if($annotate)
- <a href="#url_for_home?#q#if($list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end#boostPrice">disable annotation</a>
+ <a href="#url_for_home?#q#if($list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end#boostPrice">
+ disable annotation</a>
#else
- <a href="#url_for_lens&annotateBrowse=true">enable annotation</a>
+ <a href="#url_for_lens&annotateBrowse=true">
+ enable annotation</a>
#end
- <a #annTitle("Click to switch to an XML response: &wt=xml") href="#url_for_lens&wt=xml#if($request.params.get('debugQuery'))&debugQuery=true#end">XML</a></div>
-<div>Generated by <a href="http://wiki.apache.org/solr/VelocityResponseWriter">VelocityResponseWriter</a></div>
-<div><span>Documentation: </span> <a href="http://lucene.apache.org/solr">Solr Home Page</a>, <a href="http://wiki.apache.org/solr">Solr Wiki</a></div>
-<div>Disclaimer: The locations displayed in this demonstration are purely fictional. It is more than likely that no store with the items listed actually exists at that location!</div>
\ No newline at end of file
+ -
+ <a #annTitle("Click to switch to an XML response: &wt=xml") href="#url_for_lens&wt=xml#if($request.params.get('debugQuery'))&debugQuery=true#end">
+ XML results</a>
+
+</div>
+
+<div>
+ Generated by <a href="http://wiki.apache.org/solr/VelocityResponseWriter">VelocityResponseWriter</a>
+</div>
+<div>
+ <span>Documentation: </span>
+ <a href="http://lucene.apache.org/solr">Solr Home Page</a>, <a href="http://wiki.apache.org/solr">
+ Solr Wiki</a>
+ </div>
+<div>
+ Disclaimer:
+ The locations displayed in this demonstration are purely fictional.
+ It is more than likely that no store with the items listed actually
+ exists at that location!
+</div>
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/head.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/head.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/head.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/head.vm Thu May 30 07:53:18 2013
@@ -1,7 +1,10 @@
-
- ## An example of using an arbitrary request parameter
- <title>#param('title')</title>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+#**
+ * Provide elements for the <head> section of the HTML document
+ *#
+
+ ## An example of using an arbitrary request parameter
+ <title>#param('title')</title>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="#{url_root}/js/lib/jquery-1.7.2.min.js"></script>
<link rel="stylesheet" type="text/css" href="#{url_for_solr}/admin/file?file=/velocity/main.css&contentType=text/css"/>
@@ -26,7 +29,7 @@
}
});
- // http://localhost:8983/solr/terms?terms.fl=name&terms.prefix=i&terms.sort=count
+ // http://localhost:8983/solr/collection1/terms?terms.fl=name&terms.prefix=i&terms.sort=count&wt=velocity&v.template=suggest
});
- </script>
\ No newline at end of file
+ </script>
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/header.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/header.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/header.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/header.vm Thu May 30 07:53:18 2013
@@ -1,3 +1,7 @@
+#**
+ * Render the top section of the page visible to users
+ *#
+
<div id="head">
<span ><a href="#url_for_home#if($request.params.get('debugQuery'))?debugQuery=true#end"><img src="#{url_root}/img/solr.png" id="logo"/></a></span>
-</div>
\ No newline at end of file
+</div>
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/hit.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/hit.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/hit.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/hit.vm Thu May 30 07:53:18 2013
@@ -1,11 +1,25 @@
+#**
+ * Called for each matching document but then
+ * calls one of product_doc, join_doc or richtext_doc
+ * depending on which fields the doc has
+ *#
+
#set($docId = $doc.getFieldValue('id'))
<div class="result-document">
-#if($doc.getFieldValue('name'))
- #parse("product-doc.vm")
-#elseif($doc.getFieldValue('compName_s'))
- #parse("join-doc.vm")
-#else
- #parse("richtext-doc.vm")
-#end
+
+ ## Has a "name" field ?
+ #if($doc.getFieldValue('name'))
+ #parse("product_doc.vm")
+
+ ## Has a "compName_s" field ?
+ #elseif($doc.getFieldValue('compName_s'))
+ #parse("join_doc.vm")
+
+ ## Fallback to richtext_doc
+ #else
+ #parse("richtext_doc.vm")
+
+ #end
+
</div>
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/layout.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/layout.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/layout.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/layout.vm Thu May 30 07:53:18 2013
@@ -1,3 +1,7 @@
+#**
+ * Overall HTML page layout
+ *#
+
<html>
<head>
#parse("head.vm")
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/main.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/main.css?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/main.css (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/main.css Thu May 30 07:53:18 2013
@@ -49,10 +49,32 @@ a {
position: relative;
}
+.tabs-bar {
+ padding: 5px;
+ width: 100%;
+ border: 1px solid;
+ border-width: 0px 0px 1px 0px;
+}
+.tab {
+ font-weight: bold;
+ padding: 5px;
+ margin: 0px 5px;
+ border: 1px solid;
+ background-color: #dddddd;
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+}
+.tab:hover {
+ background: #FEC293;
+}
+.tab.selected {
+ background-color: #ffffff;
+ border-bottom: 1px solid #ffffff;
+}
+
.navigators h2 {
background: #FEC293;
- border: 1px solid #ce9d77;
- padding: 5px;
+ padding: 2px 5px;
}
.navigators ul {
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/suggest.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/suggest.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/suggest.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/suggest.vm Thu May 30 07:53:18 2013
@@ -1,3 +1,8 @@
+#**
+ * Provides cynamic spelling suggestions
+ * as you type in the search form
+ *#
+
#foreach($t in $response.response.terms.name)
-$t.key
-#end
\ No newline at end of file
+ $t.key
+#end
Modified: lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/tabs.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/tabs.vm?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/tabs.vm (original)
+++ lucene/dev/branches/security/solr/example/solr/collection1/conf/velocity/tabs.vm Thu May 30 07:53:18 2013
@@ -1,6 +1,50 @@
+#**
+ * Provides navigation/access to Advanced search options
+ * Usually displayed near the top of the page
+ *#
+
##TODO: Make some nice tabs here
+
#set($queryOpts = $params.get("queryOpts"))
-<span #annTitle("Click the link to demonstrate various Solr capabilities")><span>Examples: </span><span class="tab">#if($queryOpts && $queryOpts != "")<a href="#url_for_home/?#debug#annotate">Simple</a>#{else}Simple#end</span>
-<span class="tab">#if($queryOpts == "spatial")Spatial#else<a href="#url_for_home?&queryOpts=spatial#debug#annotate">Spatial</a>#end</span>
-<span class="tab">#if($queryOpts == "group")Group By#else<a href="#url_for_home?#debug#annotate&queryOpts=group&group=true&group.field=manu_exact">Group By</a>#end</span></span>
-<hr/>
\ No newline at end of file
+
+<div class="tabs-bar" #annTitle("Click the link to demonstrate various Solr capabilities")>
+
+ <span>Type of Search:</span>
+
+ ##queryOpts=$queryOpts
+
+ ## return to Simple Search
+ ##set( $selected = ($queryOpts && $queryOpts != "") )
+ #set( $selected = ! $queryOpts )
+ <span class="tab #if($selected)selected#end">
+ #if($selected)
+ Simple
+ #else
+ <a href="#url_for_home/?#debug#annotate">
+ Simple</a>
+ #end
+ </span>
+
+ ## GEO-Spatial / Location Based
+ #set( $selected = ($queryOpts == "spatial") )
+ <span class="tab #if($selected)selected#end">
+ #if($selected)
+ Spatial
+ #else
+ <a href="#url_for_home?&queryOpts=spatial#debug#annotate">
+ Spatial</a>
+ #end
+ </span>
+
+ ## Group By Field
+ #set( $selected = ($queryOpts == "group") )
+ <span class="tab #if($selected)selected#end">
+ #if($selected)
+ Group By
+ #else
+ <a href="#url_for_home?#debug#annotate&queryOpts=group&group=true&group.field=manu_exact">
+ Group By</a>
+ #end
+ </span>
+
+</div>
Modified: lucene/dev/branches/security/solr/example/solr/solr.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/example/solr/solr.xml?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/example/solr/solr.xml (original)
+++ lucene/dev/branches/security/solr/example/solr/solr.xml Thu May 30 07:53:18 2013
@@ -26,28 +26,19 @@
http://wiki.apache.org/solr/CoreAdmin
-->
-<!--
- All (relative) paths are relative to the Solr Home Directory
-
- persistent: Save changes made via the API to this file
- sharedLib: path to a lib directory that will be shared across all cores
--->
-<solr persistent="true">
- <!-- by default, this is 50 @ WARN
- <logging enabled="true">
- <watcher size="100" threshold="INFO" />
- </logging>
- -->
+<solr>
+
+ <solrcloud>
+ <str name="host">${host:}</str>
+ <int name="hostPort">${jetty.port:8983}</int>
+ <str name="hostContext">${hostContext:solr}</str>
+ <int name="zkClientTimeout">${zkClientTimeout:15000}</int>
+ </solrcloud>
+
+ <shardHandlerFactory name="shardHandlerFactory"
+ class="HttpShardHandlerFactory">
+ <int name="socketTimeout">${socketTimeout:0}</int>
+ <int name="connTimeout">${connTimeout:0}</int>
+ </shardHandlerFactory>
- <!--
- adminPath: RequestHandler path to manage cores.
- If 'null' (or absent), cores will not be manageable via request handler
- defaultCoreName: (optional) core to use when no core name is specified in an access url
-
- All of the attributes in cores after defaultCoreName only apply when running in SolrCloud mode.
- You can read more about SolrCloud mode at http://wiki.apache.org/solr/SolrCloud
- -->
- <cores adminPath="/admin/cores" defaultCoreName="collection1" host="${host:}" hostPort="${jetty.port:}" hostContext="${hostContext:}" zkClientTimeout="${zkClientTimeout:15000}">
- <core name="collection1" instanceDir="collection1" />
- </cores>
</solr>
Modified: lucene/dev/branches/security/solr/licenses/start.jar.sha1
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/licenses/start.jar.sha1?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/licenses/start.jar.sha1 (original)
+++ lucene/dev/branches/security/solr/licenses/start.jar.sha1 Thu May 30 07:53:18 2013
@@ -1 +1 @@
-5f657368cd61ab70babe98bcd6709e199a4829d9
+8e1a37a8daae3f222d957012f826047497466a56
Modified: lucene/dev/branches/security/solr/site/html/tutorial.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/site/html/tutorial.html?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/site/html/tutorial.html (original)
+++ lucene/dev/branches/security/solr/site/html/tutorial.html Thu May 30 07:53:18 2013
@@ -54,13 +54,13 @@ To follow along with this tutorial, you
</p>
<ol>
-<li>Java 1.6 or greater. Some places you can get it are from
+<li>Java 1.7 or greater. Some places you can get it are from
<a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Oracle</a>,
<a href="http://openjdk.java.net/">Open JDK</a>, or
<a href="http://www.ibm.com/developerworks/java/jdk/">IBM</a>.
<ul>
<li>Running <span class="codefrag">java -version</span> at the command
- line should indicate a version number starting with 1.6.
+ line should indicate a version number starting with 1.7.
</li>
<li>Gnu's GCJ is not supported and does not work with Solr.</li>
</ul>
Modified: lucene/dev/branches/security/solr/site/xsl/index.xsl
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/site/xsl/index.xsl?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/site/xsl/index.xsl (original)
+++ lucene/dev/branches/security/solr/site/xsl/index.xsl Thu May 30 07:53:18 2013
@@ -50,11 +50,11 @@
plugin architecture when more advanced customization is required.</p>
<p>
This is the official documentation for <b><xsl:text>Apache Solr </xsl:text>
- <xsl:value-of select="$version"/></b>. Additional documentation is available in the
- <a href="http://wiki.apache.org/solr">Wiki</a>.
+ <xsl:value-of select="$version"/></b>.
</p>
<h2>Reference Documents</h2>
<ul>
+ <li><a href="http://wiki.apache.org/solr">Wiki</a>: Additional documentation, especially focused on using Solr.</li>
<li><a href="changes/Changes.html">Changes</a>: List of changes in this release.</li>
<li><a href="SYSTEM_REQUIREMENTS.html">System Requirements</a>: Minimum and supported Java versions.</li>
<li><a href="tutorial.html">Solr Tutorial</a>: This document covers the basics of running Solr using an example schema, and some sample data.</li>
Modified: lucene/dev/branches/security/solr/solrj/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/build.xml?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/build.xml (original)
+++ lucene/dev/branches/security/solr/solrj/build.xml Thu May 30 07:53:18 2013
@@ -28,9 +28,10 @@
<!-- Specialized common-solr.test.classpath, to remove the Solr core test output -->
<path id="test.classpath">
<pathelement path="${common-solr.dir}/build/solr-test-framework/classes/java"/>
- <pathelement path="${tests.userdir}"/>
- <path refid="test.base.classpath"/>
- <path refid="solr.base.classpath"/>
+ <pathelement path="${tests.userdir}"/>
+ <path refid="test.base.classpath"/>
+ <path refid="solr.base.classpath"/>
+ <pathelement path="${example}/resources"/>
</path>
<!-- Specialized to depend on nothing -->
Modified: lucene/dev/branches/security/solr/solrj/ivy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/ivy.xml?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/ivy.xml (original)
+++ lucene/dev/branches/security/solr/solrj/ivy.xml Thu May 30 07:53:18 2013
@@ -40,10 +40,13 @@
-->
<dependency org="org.apache.httpcomponents" name="httpcore" rev="4.2.2" transitive="false"/>
<dependency org="commons-io" name="commons-io" rev="${commons-io.version}" transitive="false"/>
- <dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.6.4" transitive="false"/>
<dependency org="org.codehaus.woodstox" name="wstx-asl" rev="3.2.7" transitive="false"/>
- <dependency org="org.slf4j" name="slf4j-api" rev="1.6.4" transitive="false"/>
- <dependency org="org.slf4j" name="slf4j-jdk14" rev="1.6.4" transitive="false"/>
+ <dependency org="org.noggit" name="noggit" rev="0.5" transitive="false"/>
+ <dependency org="log4j" name="log4j" rev="1.2.16" transitive="false"/>
+ <dependency org="org.slf4j" name="slf4j-api" rev="1.6.6" transitive="false"/>
+ <dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.6.6" transitive="false"/>
+ <dependency org="org.slf4j" name="jul-to-slf4j" rev="1.6.6" transitive="false"/>
+ <dependency org="org.slf4j" name="slf4j-log4j12" rev="1.6.6" transitive="false"/>
<exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
</dependencies>
</ivy-module>
Modified: lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java Thu May 30 07:53:18 2013
@@ -114,9 +114,7 @@ public class DocumentObjectBinder {
}
for (AccessibleObject member : members) {
- // TODO: Fix below code to use c.isAnnotationPresent(). It was changed
- // to the null check to work around a bug in JDK 8 b78 (see LUCENE-4808).
- if (member.getAnnotation(Field.class) != null) {
+ if (member.isAnnotationPresent(Field.class)) {
member.setAccessible(true);
fields.add(new DocField(member));
}
Modified: lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java Thu May 30 07:53:18 2013
@@ -19,10 +19,13 @@ package org.apache.solr.client.solrj.imp
import java.io.IOException;
import java.net.MalformedURLException;
+import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
@@ -36,6 +39,8 @@ import org.apache.solr.client.solrj.Solr
import org.apache.solr.client.solrj.request.IsUpdateRequest;
import org.apache.solr.client.solrj.util.ClientUtils;
import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrException.ErrorCode;
+import org.apache.solr.common.cloud.Aliases;
import org.apache.solr.common.cloud.ClusterState;
import org.apache.solr.common.cloud.Slice;
import org.apache.solr.common.cloud.ZkCoreNodeProps;
@@ -183,13 +188,13 @@ public class CloudSolrServer extends Sol
reqParams = new ModifiableSolrParams();
}
List<String> theUrlList = new ArrayList<String>();
- if (request.getPath().equals("/admin/collections")) {
+ if (request.getPath().equals("/admin/collections") || request.getPath().equals("/admin/cores")) {
Set<String> liveNodes = clusterState.getLiveNodes();
for (String liveNode : liveNodes) {
int splitPointBetweenHostPortAndContext = liveNode.indexOf("_");
theUrlList.add("http://"
+ liveNode.substring(0, splitPointBetweenHostPortAndContext) + "/"
- + liveNode.substring(splitPointBetweenHostPortAndContext + 1));
+ + URLDecoder.decode(liveNode, "UTF-8").substring(splitPointBetweenHostPortAndContext + 1));
}
} else {
String collection = reqParams.get("collection", defaultCollection);
@@ -199,9 +204,21 @@ public class CloudSolrServer extends Sol
"No collection param specified on request and no default collection has been set.");
}
- // Extract each comma separated collection name and store in a List.
- List<String> collectionList = StrUtils.splitSmart(collection, ",", true);
+ Set<String> collectionsList = getCollectionList(clusterState, collection);
+ if (collectionsList.size() == 0) {
+ throw new SolrException(ErrorCode.BAD_REQUEST, "Could not find collection: " + collection);
+ }
+ collection = collectionsList.iterator().next();
+ StringBuilder collectionString = new StringBuilder();
+ Iterator<String> it = collectionsList.iterator();
+ for (int i = 0; i < collectionsList.size(); i++) {
+ String col = it.next();
+ collectionString.append(col);
+ if (i < collectionsList.size() - 1) {
+ collectionString.append(",");
+ }
+ }
// TODO: not a big deal because of the caching, but we could avoid looking
// at every shard
// when getting leaders if we tweaked some things
@@ -210,9 +227,12 @@ public class CloudSolrServer extends Sol
// specified,
// add it to the Map of slices.
Map<String,Slice> slices = new HashMap<String,Slice>();
- for (String collectionName : collectionList) {
- ClientUtils.addSlices(slices, collectionName,
- clusterState.getSlices(collectionName), true);
+ for (String collectionName : collectionsList) {
+ Collection<Slice> colSlices = clusterState.getActiveSlices(collectionName);
+ if (colSlices == null) {
+ throw new SolrServerException("Could not find collection:" + collectionName);
+ }
+ ClientUtils.addSlices(slices, collectionName, colSlices, true);
}
Set<String> liveNodes = clusterState.getLiveNodes();
@@ -287,6 +307,30 @@ public class CloudSolrServer extends Sol
return rsp.getResponse();
}
+ private Set<String> getCollectionList(ClusterState clusterState,
+ String collection) {
+ // Extract each comma separated collection name and store in a List.
+ List<String> rawCollectionsList = StrUtils.splitSmart(collection, ",", true);
+ Set<String> collectionsList = new HashSet<String>();
+ // validate collections
+ for (String collectionName : rawCollectionsList) {
+ if (!clusterState.getCollections().contains(collectionName)) {
+ Aliases aliases = zkStateReader.getAliases();
+ String alias = aliases.getCollectionAlias(collectionName);
+ if (alias != null) {
+ List<String> aliasList = StrUtils.splitSmart(alias, ",", true);
+ collectionsList.addAll(aliasList);
+ continue;
+ }
+
+ throw new SolrException(ErrorCode.BAD_REQUEST, "Collection not found: " + collectionName);
+ }
+
+ collectionsList.add(collectionName);
+ }
+ return collectionsList;
+ }
+
@Override
public void shutdown() {
if (zkStateReader != null) {
Modified: lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java Thu May 30 07:53:18 2013
@@ -73,8 +73,7 @@ public class HttpSolrServer extends Solr
/**
* User-Agent String.
*/
- public static final String AGENT = "Solr[" + HttpSolrServer.class.getName()
- + "] 1.0";
+ public static final String AGENT = "Solr[" + HttpSolrServer.class.getName() + "] 1.0";
private static Logger log = LoggerFactory.getLogger(HttpSolrServer.class);
@@ -226,13 +225,22 @@ public class HttpSolrServer extends Solr
else if( SolrRequest.METHOD.POST == request.getMethod() ) {
String url = baseUrl + path;
- boolean isMultipart = ( streams != null && streams.size() > 1 );
+ boolean hasNullStreamName = false;
+ if (streams != null) {
+ for (ContentStream cs : streams) {
+ if (cs.getName() == null) {
+ hasNullStreamName = true;
+ break;
+ }
+ }
+ }
+ boolean isMultipart = (this.useMultiPartPost || ( streams != null && streams.size() > 1 )) && !hasNullStreamName;
LinkedList<NameValuePair> postParams = new LinkedList<NameValuePair>();
if (streams == null || isMultipart) {
HttpPost post = new HttpPost(url);
post.setHeader("Content-Charset", "UTF-8");
- if (!this.useMultiPartPost && !isMultipart) {
+ if (!isMultipart) {
post.addHeader("Content-Type",
"application/x-www-form-urlencoded; charset=UTF-8");
}
@@ -244,7 +252,7 @@ public class HttpSolrServer extends Solr
String[] vals = params.getParams(p);
if (vals != null) {
for (String v : vals) {
- if (this.useMultiPartPost || isMultipart) {
+ if (isMultipart) {
parts.add(new FormBodyPart(p, new StringBody(v, Charset.forName("UTF-8"))));
} else {
postParams.add(new BasicNameValuePair(p, v));
@@ -253,13 +261,17 @@ public class HttpSolrServer extends Solr
}
}
- if (isMultipart) {
+ if (isMultipart && streams != null) {
for (ContentStream content : streams) {
String contentType = content.getContentType();
if(contentType==null) {
contentType = "application/octet-stream"; // default
}
- parts.add(new FormBodyPart(content.getName(),
+ String name = content.getName();
+ if(name==null) {
+ name = "";
+ }
+ parts.add(new FormBodyPart(name,
new InputStreamBody(
content.getStream(),
contentType,
@@ -370,10 +382,9 @@ public class HttpSolrServer extends Solr
}
break;
default:
- throw new SolrException(SolrException.ErrorCode.getErrorCode(httpStatus), "Server at " + getBaseURL()
+ throw new RemoteSolrException(httpStatus, "Server at " + getBaseURL()
+ " returned non ok status:" + httpStatus + ", message:"
- + response.getStatusLine().getReasonPhrase());
-
+ + response.getStatusLine().getReasonPhrase(), null);
}
if (processor == null) {
// no processor specified, return raw stream
@@ -383,6 +394,15 @@ public class HttpSolrServer extends Solr
shouldClose = false;
return rsp;
}
+
+// if(true) {
+// ByteArrayOutputStream copy = new ByteArrayOutputStream();
+// IOUtils.copy(respBody, copy);
+// String val = new String(copy.toByteArray());
+// System.out.println(">RESPONSE>"+val+"<"+val.length());
+// respBody = new ByteArrayInputStream(copy.toByteArray());
+// }
+
String charset = EntityUtils.getContentCharSet(response.getEntity());
NamedList<Object> rsp = processor.processResponse(respBody, charset);
if (httpStatus != HttpStatus.SC_OK) {
@@ -401,8 +421,7 @@ public class HttpSolrServer extends Solr
msg.append("request: " + method.getURI());
reason = java.net.URLDecoder.decode(msg.toString(), UTF_8);
}
- throw new SolrException(
- SolrException.ErrorCode.getErrorCode(httpStatus), reason);
+ throw new RemoteSolrException(httpStatus, reason, null);
}
return rsp;
} catch (ConnectException e) {
@@ -622,4 +641,31 @@ public class HttpSolrServer extends Solr
"Client was created outside of HttpSolrServer");
}
}
+
+ public boolean isUseMultiPartPost() {
+ return useMultiPartPost;
+ }
+
+ /**
+ * Set the multipart connection properties
+ */
+ public void setUseMultiPartPost(boolean useMultiPartPost) {
+ this.useMultiPartPost = useMultiPartPost;
+ }
+
+ /**
+ * Subclass of SolrException that allows us to capture an arbitrary HTTP
+ * status code that may have been returned by the remote server or a
+ * proxy along the way.
+ */
+ protected static class RemoteSolrException extends SolrException {
+ /**
+ * @param code Arbitrary HTTP status code
+ * @param msg Exception Message
+ * @param th Throwable to wrap with this Exception
+ */
+ public RemoteSolrException(int code, String msg, Throwable th) {
+ super(code, msg, th);
+ }
+ }
}
Modified: lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrServer.java?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrServer.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrServer.java Thu May 30 07:53:18 2013
@@ -80,7 +80,7 @@ public class LBHttpSolrServer extends So
private final Map<String, ServerWrapper> aliveServers = new LinkedHashMap<String, ServerWrapper>();
// access to aliveServers should be synchronized on itself
- private final Map<String, ServerWrapper> zombieServers = new ConcurrentHashMap<String, ServerWrapper>();
+ protected final Map<String, ServerWrapper> zombieServers = new ConcurrentHashMap<String, ServerWrapper>();
// changes to aliveServers are reflected in this array, no need to synchronize
private volatile ServerWrapper[] aliveServerList = new ServerWrapper[0];
@@ -99,7 +99,7 @@ public class LBHttpSolrServer extends So
solrQuery.setRows(0);
}
- private static class ServerWrapper {
+ protected static class ServerWrapper {
final HttpSolrServer solrServer;
long lastUsed; // last time used for a real request
@@ -335,8 +335,7 @@ public class LBHttpSolrServer extends So
}
- private Exception addZombie(HttpSolrServer server,
- Exception e) {
+ protected Exception addZombie(HttpSolrServer server, Exception e) {
ServerWrapper wrapper;
Modified: lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java Thu May 30 07:53:18 2013
@@ -57,6 +57,8 @@ public class CoreAdminRequest extends So
private String shardId;
private String roles;
private String coreNodeName;
+ private Boolean loadOnStartup;
+ private Boolean isTransient;
public Create() {
action = CoreAdminAction.CREATE;
@@ -72,7 +74,9 @@ public class CoreAdminRequest extends So
public void setShardId(String shardId) {this.shardId = shardId;}
public void setRoles(String roles) {this.roles = roles;}
public void setCoreNodeName(String coreNodeName) {this.coreNodeName = coreNodeName;}
-
+ public void setIsTransient(Boolean isTransient) { this.isTransient = isTransient; }
+ public void setIsLoadOnStartup(Boolean loadOnStartup) { this.loadOnStartup = loadOnStartup;}
+
public String getInstanceDir() { return instanceDir; }
public String getSchemaName() { return schemaName; }
public String getConfigName() { return configName; }
@@ -82,7 +86,9 @@ public class CoreAdminRequest extends So
public String getShardId() { return shardId; }
public String getRoles() { return roles; }
public String getCoreNodeName() { return coreNodeName; }
-
+ public Boolean getIsLoadOnStartup() { return loadOnStartup; }
+ public Boolean getIsTransient() { return isTransient; }
+
@Override
public SolrParams getParams() {
if( action == null ) {
@@ -123,6 +129,14 @@ public class CoreAdminRequest extends So
if (coreNodeName != null) {
params.set( CoreAdminParams.CORE_NODE_NAME, coreNodeName);
}
+
+ if (isTransient != null) {
+ params.set(CoreAdminParams.TRANSIENT, isTransient);
+ }
+
+ if (loadOnStartup != null) {
+ params.set(CoreAdminParams.LOAD_ON_STARTUP, loadOnStartup);
+ }
return params;
}
@@ -151,11 +165,11 @@ public class CoreAdminRequest extends So
public String getCoreNodeName() {
return coreNodeName;
}
-
+
public void setCoreNodeName(String coreNodeName) {
this.coreNodeName = coreNodeName;
}
-
+
public String getState() {
return state;
}
@@ -335,12 +349,12 @@ public class CoreAdminRequest extends So
params.set(CoreAdminParams.CORE, core);
if (indexDirs != null) {
for (String indexDir : indexDirs) {
- params.set(CoreAdminParams.INDEX_DIR, indexDir);
+ params.add(CoreAdminParams.INDEX_DIR, indexDir);
}
}
if (srcCores != null) {
for (String srcCore : srcCores) {
- params.set(CoreAdminParams.SRC_CORE, srcCore);
+ params.add(CoreAdminParams.SRC_CORE, srcCore);
}
}
return params;
@@ -349,6 +363,7 @@ public class CoreAdminRequest extends So
public static class Unload extends CoreAdminRequest {
protected boolean deleteIndex;
+ private boolean deleteDataDir;
public Unload(boolean deleteIndex) {
action = CoreAdminAction.UNLOAD;
@@ -363,12 +378,18 @@ public class CoreAdminRequest extends So
this.deleteIndex = deleteIndex;
}
+ public void setDeleteDataDir(boolean deleteDataDir) {
+ this.deleteDataDir = deleteDataDir;
+ }
+
@Override
public SolrParams getParams() {
ModifiableSolrParams params = (ModifiableSolrParams) super.getParams();
params.set(CoreAdminParams.DELETE_INDEX, deleteIndex);
+ params.set(CoreAdminParams.DELETE_DATA_DIR, deleteDataDir);
return params;
}
+
}
public CoreAdminRequest()
Modified: lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/request/SolrPing.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/request/SolrPing.java?rev=1487777&r1=1487776&r2=1487777&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/request/SolrPing.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/java/org/apache/solr/client/solrj/request/SolrPing.java Thu May 30 07:53:18 2013
@@ -17,50 +17,102 @@
package org.apache.solr.client.solrj.request;
+import java.io.IOException;
+import java.util.Collection;
+
import org.apache.solr.client.solrj.SolrRequest;
import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.response.SolrPingResponse;
+import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.util.ContentStream;
-import java.io.IOException;
-import java.util.Collection;
-
/**
* Verify that there is a working Solr core at the URL of a {@link SolrServer}.
* To use this class, the solrconfig.xml for the relevant core must include the
* request handler for <code>/admin/ping</code>.
- *
+ *
* @since solr 1.3
*/
-public class SolrPing extends SolrRequest
-{
+public class SolrPing extends SolrRequest {
+
+ /** serialVersionUID. */
+ private static final long serialVersionUID = 5828246236669090017L;
+
+ /** Request parameters. */
private ModifiableSolrParams params;
- public SolrPing()
- {
- super( METHOD.GET, "/admin/ping" );
+ /**
+ * Create a new SolrPing object.
+ */
+ public SolrPing() {
+ super(METHOD.GET, CommonParams.PING_HANDLER);
params = new ModifiableSolrParams();
}
-
+
@Override
public Collection<ContentStream> getContentStreams() {
return null;
}
-
+
@Override
public ModifiableSolrParams getParams() {
return params;
}
-
+
@Override
- public SolrPingResponse process( SolrServer server ) throws SolrServerException, IOException
- {
+ public SolrPingResponse process(SolrServer server)
+ throws SolrServerException, IOException {
long startTime = System.currentTimeMillis();
SolrPingResponse res = new SolrPingResponse();
- res.setResponse( server.request( this ) );
- res.setElapsedTime( System.currentTimeMillis()-startTime );
+ res.setResponse(server.request(this));
+ res.setElapsedTime(System.currentTimeMillis() - startTime);
return res;
}
+
+ /**
+ * Remove the action parameter from this request. This will result in the same
+ * behavior as {@code SolrPing#setActionPing()}. For Solr server version 4.0
+ * and later.
+ *
+ * @return this
+ */
+ public SolrPing removeAction() {
+ params.remove(CommonParams.ACTION);
+ return this;
+ }
+
+ /**
+ * Set the action parameter on this request to enable. This will delete the
+ * health-check file for the Solr core. For Solr server version 4.0 and later.
+ *
+ * @return this
+ */
+ public SolrPing setActionDisable() {
+ params.set(CommonParams.ACTION, CommonParams.DISABLE);
+ return this;
+ }
+
+ /**
+ * Set the action parameter on this request to enable. This will create the
+ * health-check file for the Solr core. For Solr server version 4.0 and later.
+ *
+ * @return this
+ */
+ public SolrPing setActionEnable() {
+ params.set(CommonParams.ACTION, CommonParams.ENABLE);
+ return this;
+ }
+
+ /**
+ * Set the action parameter on this request to ping. This is the same as not
+ * including the action at all. For Solr server version 4.0 and later.
+ *
+ * @return this
+ */
+ public SolrPing setActionPing() {
+ params.set(CommonParams.ACTION, CommonParams.PING);
+ return this;
+ }
}