You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by si...@apache.org on 2011/02/21 15:13:40 UTC
svn commit: r1072973 [10/11] - in /lucene/dev/branches/docvalues: ./
dev-tools/eclipse/ dev-tools/idea/.idea/ dev-tools/idea/lucene/contrib/ant/
dev-tools/idea/lucene/contrib/demo/
dev-tools/idea/lucene/contrib/highlighter/ dev-tools/idea/lucene/contri...
Modified: lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.jflex
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.jflex?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.jflex (original)
+++ lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizer.jflex Mon Feb 21 14:13:28 2011
@@ -77,6 +77,8 @@ ComplexContext = ([\p{LB:Complex_Context
Han = ([\p{Script:Han}] | {HanSupp})
Hiragana = ([\p{Script:Hiragana}] | {HiraganaSupp})
+// Script=Hangul & Aletter
+HangulEx = (!(!\p{Script:Hangul}|!\p{WB:ALetter})) ({Format} | {Extend})*
// UAX#29 WB4. X (Extend | Format)* --> X
//
ALetterEx = {ALetter} ({Format} | {Extend})*
@@ -168,16 +170,16 @@ EMAIL = {EMAILlocalPart} "@" ({DomainNam
%{
/** Alphanumeric sequences */
- public static final String WORD_TYPE = "<ALPHANUM>";
+ public static final String WORD_TYPE = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.ALPHANUM];
/** Numbers */
- public static final String NUMERIC_TYPE = "<NUM>";
+ public static final String NUMERIC_TYPE = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.NUM];
/** URLs with scheme: HTTP(S), FTP, or FILE; no-scheme URLs match HTTP syntax */
public static final String URL_TYPE = "<URL>";
/** E-mail addresses */
- public static final String EMAIL_TYPE = "<EMAIL";
+ public static final String EMAIL_TYPE = "<EMAIL>";
/**
* Chars in class \p{Line_Break = Complex_Context} are from South East Asian
@@ -187,12 +189,16 @@ EMAIL = {EMAILlocalPart} "@" ({DomainNam
* <p>
* See Unicode Line Breaking Algorithm: http://www.unicode.org/reports/tr14/#SA
*/
- public static final String SOUTH_EAST_ASIAN_TYPE = "<SOUTHEAST_ASIAN>";
+ public static final String SOUTH_EAST_ASIAN_TYPE = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.SOUTHEAST_ASIAN];
- public static final String IDEOGRAPHIC_TYPE = "<IDEOGRAPHIC>";
+ public static final String IDEOGRAPHIC_TYPE = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.IDEOGRAPHIC];
- public static final String HIRAGANA_TYPE = "<HIRAGANA>";
+ public static final String HIRAGANA_TYPE = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.HIRAGANA];
+ public static final String KATAKANA_TYPE = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.KATAKANA];
+
+ public static final String HANGUL_TYPE = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.HANGUL];
+
private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class);
private final OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
private final PositionIncrementAttribute posIncrAtt
@@ -316,6 +322,12 @@ EMAIL = {EMAILlocalPart} "@" ({DomainNam
{ExtendNumLetEx}*
{ if (populateAttributes(NUMERIC_TYPE)) return true; }
+// subset of the below for typing purposes only!
+{HangulEx}+
+ { if (populateAttributes(HANGUL_TYPE)) return true; }
+
+{KatakanaEx}+
+ { if (populateAttributes(KATAKANA_TYPE)) return true; }
// UAX#29 WB5. ALetter à ALetter
// WB6. ALetter à (MidLetter | MidNumLet) ALetter
Modified: lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.java Mon Feb 21 14:13:28 2011
@@ -1,4 +1,4 @@
-/* The following code was generated by JFlex 1.5.0-SNAPSHOT on 10/3/10 9:07 AM */
+/* The following code was generated by JFlex 1.5.0-SNAPSHOT on 2/9/11 11:45 AM */
package org.apache.lucene.analysis.wikipedia;
@@ -25,8 +25,8 @@ import org.apache.lucene.analysis.tokena
/**
* This class is a scanner generated by
* <a href="http://www.jflex.de/">JFlex</a> 1.5.0-SNAPSHOT
- * on 10/3/10 9:07 AM from the specification file
- * <tt>C:/Users/rmuir/workspace/lucene-clean/modules/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.jflex</tt>
+ * on 2/9/11 11:45 AM from the specification file
+ * <tt>C:/Users/rmuir/workspace/lucene-2911/modules/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.jflex</tt>
*/
class WikipediaTokenizerImpl {
@@ -757,6 +757,12 @@ final int setText(StringBuilder buffer){
zzState = ZZ_LEXSTATE[zzLexicalState];
+ // set up zzAction for empty match case:
+ int zzAttributes = zzAttrL[zzState];
+ if ( (zzAttributes & 1) == 1 ) {
+ zzAction = zzState;
+ }
+
zzForAction: {
while (true) {
@@ -789,7 +795,7 @@ final int setText(StringBuilder buffer){
if (zzNext == -1) break zzForAction;
zzState = zzNext;
- int zzAttributes = zzAttrL[zzState];
+ zzAttributes = zzAttrL[zzState];
if ( (zzAttributes & 1) == 1 ) {
zzAction = zzState;
zzMarkedPosL = zzCurrentPosL;
Modified: lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestStandardAnalyzer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestStandardAnalyzer.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestStandardAnalyzer.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestStandardAnalyzer.java Mon Feb 21 14:13:28 2011
@@ -207,4 +207,16 @@ public class TestStandardAnalyzer extend
new String[] {"ð©¬
", "è±", "é", "ä¹", "æ¯", "ç"},
new String[] { "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>" });
}
+
+ public void testKorean() throws Exception {
+ BaseTokenStreamTestCase.assertAnalyzesTo(a, "í민ì ì",
+ new String[] { "í민ì ì" },
+ new String[] { "<HANGUL>" });
+ }
+
+ public void testJapanese() throws Exception {
+ BaseTokenStreamTestCase.assertAnalyzesTo(a, "ä»®åé£ã ã«ã¿ã«ã",
+ new String[] { "ä»®", "å", "é£", "ã", "ã«ã¿ã«ã" },
+ new String[] { "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<HIRAGANA>", "<KATAKANA>" });
+ }
}
Modified: lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestUAX29URLEmailTokenizer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestUAX29URLEmailTokenizer.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestUAX29URLEmailTokenizer.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestUAX29URLEmailTokenizer.java Mon Feb 21 14:13:28 2011
@@ -406,4 +406,16 @@ public class TestUAX29URLEmailTokenizer
new String[] {"ð©¬
", "è±", "é", "ä¹", "æ¯", "ç"},
new String[] { "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>" });
}
+
+ public void testKorean() throws Exception {
+ BaseTokenStreamTestCase.assertAnalyzesTo(a, "í민ì ì",
+ new String[] { "í민ì ì" },
+ new String[] { "<HANGUL>" });
+ }
+
+ public void testJapanese() throws Exception {
+ BaseTokenStreamTestCase.assertAnalyzesTo(a, "ä»®åé£ã ã«ã¿ã«ã",
+ new String[] { "ä»®", "å", "é£", "ã", "ã«ã¿ã«ã" },
+ new String[] { "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<HIRAGANA>", "<KATAKANA>" });
+ }
}
Modified: lucene/dev/branches/docvalues/modules/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/DefaultICUTokenizerConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/DefaultICUTokenizerConfig.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/DefaultICUTokenizerConfig.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/icu/src/java/org/apache/lucene/analysis/icu/segmentation/DefaultICUTokenizerConfig.java Mon Feb 21 14:13:28 2011
@@ -20,6 +20,8 @@ package org.apache.lucene.analysis.icu.s
import java.io.IOException;
import java.io.InputStream;
+import org.apache.lucene.analysis.standard.StandardTokenizer;
+
import com.ibm.icu.lang.UScript;
import com.ibm.icu.text.BreakIterator;
import com.ibm.icu.text.RuleBasedBreakIterator;
@@ -44,20 +46,24 @@ import com.ibm.icu.util.ULocale;
*/
public class DefaultICUTokenizerConfig extends ICUTokenizerConfig {
/** Token type for words containing ideographic characters */
- public static final String WORD_IDEO = "<IDEOGRAPHIC>";
- /** Token type for words containing Japanese kana */
- public static final String WORD_KANA = "<KANA>";
+ public static final String WORD_IDEO = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.IDEOGRAPHIC];
+ /** Token type for words containing Japanese hiragana */
+ public static final String WORD_HIRAGANA = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.HIRAGANA];
+ /** Token type for words containing Japanese katakana */
+ public static final String WORD_KATAKANA = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.KATAKANA];
+ /** Token type for words containing Korean hangul */
+ public static final String WORD_HANGUL = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.HANGUL];
/** Token type for words that contain letters */
- public static final String WORD_LETTER = "<ALPHANUM>";
+ public static final String WORD_LETTER = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.ALPHANUM];
/** Token type for words that appear to be numbers */
- public static final String WORD_NUMBER = "<NUM>";
+ public static final String WORD_NUMBER = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.NUM];
/*
* the default breakiterators in use. these can be expensive to
* instantiate, cheap to clone.
*/
private static final BreakIterator rootBreakIterator =
- BreakIterator.getWordInstance(ULocale.ROOT);
+ readBreakIterator("Default.brk");
private static final BreakIterator thaiBreakIterator =
BreakIterator.getWordInstance(new ULocale("th_TH"));
private static final BreakIterator hebrewBreakIterator =
@@ -87,9 +93,9 @@ public class DefaultICUTokenizerConfig e
case RuleBasedBreakIterator.WORD_IDEO:
return WORD_IDEO;
case RuleBasedBreakIterator.WORD_KANA:
- return WORD_KANA;
+ return script == UScript.HIRAGANA ? WORD_HIRAGANA : WORD_KATAKANA;
case RuleBasedBreakIterator.WORD_LETTER:
- return WORD_LETTER;
+ return script == UScript.HANGUL ? WORD_HANGUL : WORD_LETTER;
case RuleBasedBreakIterator.WORD_NUMBER:
return WORD_NUMBER;
default: /* some other custom code */
Modified: lucene/dev/branches/docvalues/modules/analysis/icu/src/java/org/apache/lucene/analysis/icu/tokenattributes/ScriptAttributeImpl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/icu/src/java/org/apache/lucene/analysis/icu/tokenattributes/ScriptAttributeImpl.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/icu/src/java/org/apache/lucene/analysis/icu/tokenattributes/ScriptAttributeImpl.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/icu/src/java/org/apache/lucene/analysis/icu/tokenattributes/ScriptAttributeImpl.java Mon Feb 21 14:13:28 2011
@@ -17,8 +17,6 @@ package org.apache.lucene.analysis.icu.t
* limitations under the License.
*/
-import java.io.Serializable;
-
import org.apache.lucene.util.AttributeImpl;
import org.apache.lucene.util.AttributeReflector;
@@ -29,7 +27,7 @@ import com.ibm.icu.lang.UScript;
* as an integer.
* @lucene.experimental
*/
-public class ScriptAttributeImpl extends AttributeImpl implements ScriptAttribute, Cloneable, Serializable {
+public class ScriptAttributeImpl extends AttributeImpl implements ScriptAttribute, Cloneable {
private int code = UScript.COMMON;
public int getCode() {
Modified: lucene/dev/branches/docvalues/modules/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizer.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizer.java (original)
+++ lucene/dev/branches/docvalues/modules/analysis/icu/src/test/org/apache/lucene/analysis/icu/segmentation/TestICUTokenizer.java Mon Feb 21 14:13:28 2011
@@ -128,11 +128,10 @@ public class TestICUTokenizer extends Ba
/*
* For chinese, tokenize as char (these can later form bigrams or whatever)
- * TODO: why do full-width numerics have no word-break prop?
*/
public void testChinese() throws Exception {
assertAnalyzesTo(a, "ææ¯ä¸å½äººã ï¼ï¼ï¼ï¼ ï¼´ï½
ï½ï½ï½ ",
- new String[] { "æ", "æ¯", "ä¸", "å½", "人", "tests"});
+ new String[] { "æ", "æ¯", "ä¸", "å½", "人", "1234", "tests"});
}
public void testEmpty() throws Exception {
@@ -221,4 +220,16 @@ public class TestICUTokenizer extends Ba
new String[] {"david", "has", "5000", "bones"},
new String[] { "<ALPHANUM>", "<ALPHANUM>", "<NUM>", "<ALPHANUM>" });
}
+
+ public void testKorean() throws Exception {
+ BaseTokenStreamTestCase.assertAnalyzesTo(a, "í민ì ì",
+ new String[] { "í민ì ì" },
+ new String[] { "<HANGUL>" });
+ }
+
+ public void testJapanese() throws Exception {
+ BaseTokenStreamTestCase.assertAnalyzesTo(a, "ä»®åé£ã ã«ã¿ã«ã",
+ new String[] { "ä»®", "å", "é£", "ã", "ã«ã¿ã«ã" },
+ new String[] { "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<HIRAGANA>", "<KATAKANA>" });
+ }
}
Modified: lucene/dev/branches/docvalues/modules/benchmark/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/benchmark/build.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/benchmark/build.xml (original)
+++ lucene/dev/branches/docvalues/modules/benchmark/build.xml Mon Feb 21 14:13:28 2011
@@ -22,7 +22,6 @@
<module-uptodate name="analysis/common" jarfile="${common.dir}/../modules/analysis/build/common/lucene-analyzers-common-${version}.jar"
property="analyzers-common.uptodate" classpath.property="analyzers-common.jar"/>
<contrib-uptodate name="memory" property="memory.uptodate" classpath.property="memory.jar"/>
- <contrib-uptodate name="demo" property="demo.uptodate" classpath.property="demo.jar"/>
<target name="check-files">
<available file="temp/news20.tar.gz" property="news20.exists"/>
@@ -143,7 +142,6 @@
<pathelement path="${memory.jar}"/>
<pathelement path="${highlighter.jar}"/>
<pathelement path="${analyzers-common.jar}"/>
- <pathelement path="${demo.jar}"/>
<path refid="base.classpath"/>
<fileset dir="lib">
<include name="**/*.jar"/>
@@ -232,11 +230,6 @@
<echo>Benchmark output in JIRA table format is in file: ${shingle.jira.output.file}</echo>
</target>
- <target name="compile-demo" unless="demo.uptodate">
- <subant target="default">
- <fileset dir="${common.dir}/contrib/demo" includes="build.xml"/>
- </subant>
- </target>
<target name="compile-highlighter" unless="highlighter.uptodate">
<subant target="default">
<fileset dir="${common.dir}/contrib/highlighter" includes="build.xml"/>
@@ -258,7 +251,19 @@
</subant>
</target>
- <target name="init" depends="contrib-build.init,compile-demo,compile-memory,compile-highlighter,compile-analyzers-common"/>
+ <target name="init" depends="contrib-build.init,compile-memory,compile-highlighter,compile-analyzers-common"/>
+ <target name="clean-javacc">
+ <fileset dir="src/java/org/apache/lucene/benchmark/byTask/feeds/demohtml" includes="*.java">
+ <containsregexp expression="Generated.*By.*JavaCC"/>
+ </fileset>
+ </target>
+
+ <target name="javacc" depends="init,javacc-check" if="javacc.present">
+ <invoke-javacc target="src/java/org/apache/lucene/benchmark/byTask/feeds/demohtml/HTMLParser.jj"
+ outputDir="src/java/org/apache/lucene/benchmark/byTask/feeds/demohtml"
+ />
+ </target>
+
<target name="dist-maven" depends="jar-core,javadocs,contrib-build.dist-maven"/>
</project>
Modified: lucene/dev/branches/docvalues/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DemoHTMLParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DemoHTMLParser.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DemoHTMLParser.java (original)
+++ lucene/dev/branches/docvalues/modules/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DemoHTMLParser.java Mon Feb 21 14:13:28 2011
@@ -30,7 +30,7 @@ import java.util.Properties;
public class DemoHTMLParser implements org.apache.lucene.benchmark.byTask.feeds.HTMLParser {
public DocData parse(DocData docData, String name, Date date, String title, Reader reader, DateFormat dateFormat) throws IOException, InterruptedException {
- org.apache.lucene.demo.html.HTMLParser p = new org.apache.lucene.demo.html.HTMLParser(reader);
+ org.apache.lucene.benchmark.byTask.feeds.demohtml.HTMLParser p = new org.apache.lucene.benchmark.byTask.feeds.demohtml.HTMLParser(reader);
// title
if (title==null) {
Modified: lucene/dev/branches/docvalues/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/CHANGES.txt?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/CHANGES.txt (original)
+++ lucene/dev/branches/docvalues/solr/CHANGES.txt Mon Feb 21 14:13:28 2011
@@ -53,14 +53,6 @@ Upgrading from Solr 3.1-dev
legacy behavior should set a default value for the 'mm' param in
their solrconfig.xml file.
-* In previous releases, sorting on fields that are "multiValued"
- (either by explicit declaration in schema.xml or by implict behavior
- because the "version" attribute on the schema was less then 1.2) did
- not generally work, but it would sometimes silently act as if it
- succeeded and order the docs arbitrarily. Solr will now fail on any
- attempt to sort on a multivalued field
-
-
Detailed Change List
----------------------
@@ -161,26 +153,6 @@ Bug Fixes
* SOLR-2275: fix DisMax 'mm' parsing to be tolerant of whitespace
(Erick Erickson via hossman)
-* SOLR-2307: fix bug in PHPSerializedResponseWriter (wt=phps) when
- dealing with SolrDocumentList objects -- ie: sharded queries.
- (Antonio Verni via hossman)
-
-* SOLR-2127: Fixed serialization of default core and indentation of solr.xml when serializing.
- (Ephraim Ofir, Mark Miller)
-
-* SOLR-482: Provide more exception handling in CSVLoader (gsingers)
-
-* SOLR-2320: Fixed ReplicationHandler detail reporting for masters
- (hossman)
-
-* SOLR-2085: Improve SolrJ behavior when FacetComponent comes before
- QueryComponent (Tomas Salfischberger via hossman)
-
-* SOLR-1940: Fix SolrDispatchFilter behavior when Content-Type is
- unknown (Lance Norskog and hossman)
-
-* SOLR-2339: Fix sorting to explicitly generate an error if you
- attempt to sort on a multiValued field. (hossman)
Other Changes
----------------------
@@ -203,16 +175,13 @@ Other Changes
using Generics where applicable in method/object declatations, and
adding @SuppressWarnings("unchecked") when appropriate (hossman)
-* SOLR-2350: Since Solr no longer requires XML files to be in UTF-8
- (see SOLR-96) SimplePostTool (aka: post.jar) has been improved to
- work with files of any mime-type or charset. (hossman)
-
Documentation
----------------------
* SOLR-2232: Improved README info on solr.solr.home in examples
(Eric Pugh and hossman)
+
================== 3.1.0-dev ==================
Versions of Major Components
---------------------
@@ -264,6 +233,19 @@ Upgrading from Solr 1.4
* readercycle script was removed. (SOLR-2046)
+* In previous releases, sorting or evaluating function queries on
+ fields that were "multiValued" (either by explicit declaration in
+ schema.xml or by implict behavior because the "version" attribute on
+ the schema was less then 1.2) did not generally work, but it would
+ sometimes silently act as if it succeeded and order the docs
+ arbitrarily. Solr will now fail on any attempt to sort, or apply a
+ function to, multi-valued fields
+
+* The DataImportHandler jars are no longer included in the solr
+ WAR and should be added in Solr's lib directory, or referenced
+ via the <lib> directive in solrconfig.xml.
+
+
Detailed Change List
----------------------
@@ -279,7 +261,7 @@ New Features
* SOLR-1553: New dismax parser implementation (accessible as "edismax")
that supports full lucene syntax, improved reserved char escaping,
fielded queries, improved proximity boosting, and improved stopword
- handling. (yonik)
+ handling. Note: status is experimental for now. (yonik)
* SOLR-1574: Add many new functions from java Math (e.g. sin, cos) (yonik)
@@ -669,6 +651,27 @@ Bug Fixes
* SOLR-2261: fix velocity template layout.vm that referred to an older
version of jquery. (Eric Pugh via rmuir)
+* SOLR-2307: fix bug in PHPSerializedResponseWriter (wt=phps) when
+ dealing with SolrDocumentList objects -- ie: sharded queries.
+ (Antonio Verni via hossman)
+
+* SOLR-2127: Fixed serialization of default core and indentation of solr.xml when serializing.
+ (Ephraim Ofir, Mark Miller)
+
+* SOLR-2320: Fixed ReplicationHandler detail reporting for masters
+ (hossman)
+
+* SOLR-482: Provide more exception handling in CSVLoader (gsingers)
+
+* SOLR-1283: HTMLStripCharFilter sometimes threw a "Mark Invalid" exception.
+ (Julien Coloos, hossman, yonik)
+
+* SOLR-2085: Improve SolrJ behavior when FacetComponent comes before
+ QueryComponent (Tomas Salfischberger via hossman)
+
+* SOLR-1940: Fix SolrDispatchFilter behavior when Content-Type is
+ unknown (Lance Norskog and hossman)
+
* SOLR-1983: snappuller fails when modifiedConfFiles is not empty and
full copy of index is needed. (Alexander Kanarsky via yonik)
@@ -679,6 +682,18 @@ Bug Fixes
DocumentAnalysisRequestHandler to respect charset from XML file and only
use HTTP header's "Content-Type" as a "hint". (Uwe Schindler)
+* SOLR-2339: Fix sorting to explicitly generate an error if you
+ attempt to sort on a multiValued field. (hossman)
+
+* SOLR-2348: Fix field types to explicitly generate an error if you
+ attempt to get a ValueSource for a multiValued field. (hossman)
+
+* SOLR-1191: resolve DataImportHandler deltaQuery column against pk when pk
+ has a prefix (e.g. pk="book.id" deltaQuery="select id from ..."). More
+ useful error reporting when no match found (previously failed with a
+ NullPointerException in log and no clear user feedback). (gthb via yonik)
+
+
Other Changes
----------------------
@@ -777,6 +792,12 @@ Other Changes
* SOLR-2340: Add version infos to message in JavaBinCodec when throwing
exception. (koji)
+* SOLR-2350: Since Solr no longer requires XML files to be in UTF-8
+ (see SOLR-96) SimplePostTool (aka: post.jar) has been improved to
+ work with files of any mime-type or charset. (hossman)
+
+* SOLR-2365: Move DIH jars out of solr.war (David Smiley via yonik)
+
Build
----------------------
@@ -793,7 +814,6 @@ Build
* LUCENE-2657: Switch from using Maven POM templates to full POMs when
generating Maven artifacts (Steven Rowe)
-
Documentation
----------------------
@@ -911,8 +931,7 @@ New Features
7. SOLR-680: Add StatsComponent. This gets simple statistics on matched numeric fields,
including: min, max, mean, median, stddev. (koji, ryan)
- 7.1 SOLR-1380: Added support for multi-valued fields to stats component
- (Harish Agarwal via gsingers)
+ 7.1 SOLR-1380: Added support for multi-valued fields (Harish Agarwal via gsingers)
8. SOLR-561: Added Replication implemented in Java as a request handler. Supports index replication
as well as configuration replication and exposes detailed statistics and progress information
Modified: lucene/dev/branches/docvalues/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/build.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/build.xml (original)
+++ lucene/dev/branches/docvalues/solr/build.xml Mon Feb 21 14:13:28 2011
@@ -756,6 +756,12 @@
excludes="*.tgz *.zip *.md5 **/*src*.jar **/*docs*.jar" />
<tarfileset dir="${build.docs}"
prefix="${fullnamever}/docs/" />
+ <tarfileset dir="../lucene"
+ prefix="lucene"
+ excludes="**/build/" />
+ <tarfileset dir="../modules"
+ prefix="modules"
+ excludes="**/build/" />
</tar>
<solr-checksum file="${dist}/${fullnamever}.tgz"/>
@@ -775,6 +781,12 @@
prefix="${fullnamever}"
includes="**/*.sh **/bin/ src/scripts/"
filemode="755" />
+ <zipfileset dir="../lucene"
+ prefix="lucene"
+ excludes="**/build/" />
+ <zipfileset dir="../modules"
+ prefix="modules"
+ excludes="**/build/" />
</zip>
<solr-checksum file="${dist}/${fullnamever}.zip"/>
Modified: lucene/dev/branches/docvalues/solr/client/ruby/solr-ruby/solr/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/client/ruby/solr-ruby/solr/conf/solrconfig.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/client/ruby/solr-ruby/solr/conf/solrconfig.xml (original)
+++ lucene/dev/branches/docvalues/solr/client/ruby/solr-ruby/solr/conf/solrconfig.xml Mon Feb 21 14:13:28 2011
@@ -17,19 +17,11 @@
-->
<config>
- <!-- Set this to 'false' if you want solr to continue working after it has
- encountered an severe configuration error. In a production environment,
- you may want solr to keep working even if one handler is mis-configured.
-
- You may also set this to false using by setting the system property:
- -Dsolr.abortOnConfigurationError=false
- -->
- <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
<!-- Used to specify an alternate directory to hold all index data
other than the default ./data under the Solr home.
If replication is in use, this should match the replication configuration. -->
- <dataDir>${solr.data.dir:./solr/data}</dataDir>
+ <dataDir>${solr.data.dir:}</dataDir>
<indexDefaults>
<!-- Values here affect all index writers and act as a default unless overridden. -->
Modified: lucene/dev/branches/docvalues/solr/client/ruby/solr-ruby/test/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/client/ruby/solr-ruby/test/conf/solrconfig.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/client/ruby/solr-ruby/test/conf/solrconfig.xml (original)
+++ lucene/dev/branches/docvalues/solr/client/ruby/solr-ruby/test/conf/solrconfig.xml Mon Feb 21 14:13:28 2011
@@ -17,20 +17,12 @@
-->
<config>
- <!-- Set this to 'false' if you want solr to continue working after it has
- encountered an severe configuration error. In a production environment,
- you may want solr to keep working even if one handler is mis-configured.
-
- You may also set this to false using by setting the system property:
- -Dsolr.abortOnConfigurationError=false
- -->
- <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
<!-- Used to specify an alternate directory to hold all index data
other than the default ./data under the Solr home.
If replication is in use, this should match the replication configuration. -->
<!--
- <dataDir>./solr/data</dataDir>
+ <dataDir>${solr.data.dir:}</dataDir>
-->
<indexDefaults>
Modified: lucene/dev/branches/docvalues/solr/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/common-build.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/common-build.xml (original)
+++ lucene/dev/branches/docvalues/solr/common-build.xml Mon Feb 21 14:13:28 2011
@@ -347,7 +347,8 @@
<attribute name="destdir"/>
<attribute name="title" default="${Name} ${version} API (${specversion})"/>
<sequential>
- <copy todir="@{destdir}/../prettify" overwrite="false">
+ <mkdir dir="@{destdir}"/>
+ <copy todir="@{destdir}/prettify" overwrite="false">
<fileset dir="${prettify.dir}"/>
</copy>
<javadoc
@@ -363,7 +364,7 @@
link="${javadoc.link.java}"
windowtitle="${Name} ${version} API"
doctitle="@{title}"
- stylesheetfile="@{destdir}/../prettify/stylesheet+prettify.css"
+ stylesheetfile="@{destdir}/prettify/stylesheet+prettify.css"
bottom="Copyright &copy; ${year} Apache Software Foundation. All Rights Reserved.">
<tag name="todo" description="To Do:"/>
<tag name="uml.property" description="UML Property:"/>
@@ -376,7 +377,7 @@
<link href="${javadoc.link.junit}"/>
<link href="${javadoc.link.lucene}"/>
<header><![CDATA[
- <script src="{@docRoot}/../prettify/prettify.js" type="text/javascript"></script>
+ <script src="{@docRoot}/prettify/prettify.js" type="text/javascript"></script>
<script language="JavaScript">window.onload=function(){windowTitle();prettyPrint();}</script>
]]></header>
Modified: lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/resources/solr-clustering/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/resources/solr-clustering/conf/solrconfig.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/resources/solr-clustering/conf/solrconfig.xml (original)
+++ lucene/dev/branches/docvalues/solr/contrib/clustering/src/test/resources/solr-clustering/conf/solrconfig.xml Mon Feb 21 14:13:28 2011
@@ -18,19 +18,11 @@
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
- <!-- Set this to 'false' if you want solr to continue working after it has
- encountered an severe configuration error. In a production environment,
- you may want solr to keep working even if one handler is mis-configured.
-
- You may also set this to false using by setting the system property:
- -Dsolr.abortOnConfigurationError=false
- -->
- <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
<!-- Used to specify an alternate directory to hold all index data
other than the default ./data under the Solr home.
If replication is in use, this should match the replication configuration. -->
- <dataDir>${solr.data.dir:./solr/data}</dataDir>
+ <dataDir>${solr.data.dir:}</dataDir>
<indexDefaults>
Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/CHANGES.txt?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/CHANGES.txt (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/CHANGES.txt Mon Feb 21 14:13:28 2011
@@ -80,12 +80,20 @@ Bug Fixes
* SOLR-2330: solrconfig.xml files in example-DIH are broken. (Matt Parker, koji)
+* SOLR-2116: Fix TikaConfig classloader bug in TikaEntityProcessor
+ (Martijn van Groningen via hossman)
+
+
Other Changes
----------------------
* SOLR-1821: Fix TimeZone-dependent test failure in TestEvaluatorBag.
(Chris Male via rmuir)
+* SOLR-2367: Reduced noise in test output by ensuring the properties file can be written.
+ (Gunnlaugur Thor Briem via rmuir)
+
+
Build
----------------------
Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/build.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/build.xml (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/build.xml Mon Feb 21 14:13:28 2011
@@ -276,7 +276,7 @@
<fileset dir="src/main/webapp" includes="**" />
</copy>
<mkdir dir="../../build/web/WEB-INF/lib"/>
- <copy file="target/${fullnamever}.jar" todir="${solr-path}/build/web/WEB-INF/lib"></copy>
+ <!--<copy file="target/${fullnamever}.jar" todir="${solr-path}/build/web/WEB-INF/lib"></copy>-->
<copy file="target/${fullnamever}.jar" todir="${solr-path}/dist"></copy>
<copy file="target/apache-${ant.project.name}-extras-${version}.jar" todir="${solr-path}/dist"></copy>
</target>
Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/main/java/org/apache/solr/handler/dataimport/TikaEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/main/java/org/apache/solr/handler/dataimport/TikaEntityProcessor.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/main/java/org/apache/solr/handler/dataimport/TikaEntityProcessor.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/main/java/org/apache/solr/handler/dataimport/TikaEntityProcessor.java Mon Feb 21 14:13:28 2011
@@ -17,15 +17,11 @@
package org.apache.solr.handler.dataimport;
import org.apache.commons.io.IOUtils;
-import static org.apache.solr.handler.dataimport.DataImportHandlerException.SEVERE;
-import static org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow;
-import static org.apache.solr.handler.dataimport.DataImporter.COLUMN;
-import static org.apache.solr.handler.dataimport.XPathEntityProcessor.URL;
import org.apache.tika.config.TikaConfig;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.parser.AutoDetectParser;
-import org.apache.tika.parser.Parser;
import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
import org.apache.tika.sax.BodyContentHandler;
import org.apache.tika.sax.ContentHandlerDecorator;
import org.apache.tika.sax.XHTMLContentHandler;
@@ -47,6 +43,11 @@ import java.io.StringWriter;
import java.io.Writer;
import java.util.HashMap;
import java.util.Map;
+
+import static org.apache.solr.handler.dataimport.DataImportHandlerException.SEVERE;
+import static org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow;
+import static org.apache.solr.handler.dataimport.DataImporter.COLUMN;
+import static org.apache.solr.handler.dataimport.XPathEntityProcessor.URL;
/**
* <p>An implementation of {@link EntityProcessor} which reads data from rich docs
* using <a href="http://tika.apache.org/">Apache Tika</a>
@@ -65,19 +66,20 @@ public class TikaEntityProcessor extends
@Override
protected void firstInit(Context context) {
- String tikaConfigFile = context.getResolvedEntityAttribute("tikaConfig");
- if (tikaConfigFile == null) {
- tikaConfig = TikaConfig.getDefaultConfig();
- } else {
- File configFile = new File(tikaConfigFile);
- if (!configFile.isAbsolute()) {
- configFile = new File(context.getSolrCore().getResourceLoader().getConfigDir(), tikaConfigFile);
- }
- try {
+ try {
+ String tikaConfigFile = context.getResolvedEntityAttribute("tikaConfig");
+ if (tikaConfigFile == null) {
+ ClassLoader classLoader = context.getSolrCore().getResourceLoader().getClassLoader();
+ tikaConfig = new TikaConfig(classLoader);
+ } else {
+ File configFile = new File(tikaConfigFile);
+ if (!configFile.isAbsolute()) {
+ configFile = new File(context.getSolrCore().getResourceLoader().getConfigDir(), tikaConfigFile);
+ }
tikaConfig = new TikaConfig(configFile);
- } catch (Exception e) {
- wrapAndThrow (SEVERE, e,"Unable to load Tika Config");
}
+ } catch (Exception e) {
+ wrapAndThrow (SEVERE, e,"Unable to load Tika Config");
}
format = context.getResolvedEntityAttribute("format");
Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/java/org/apache/solr/handler/dataimport/TestTikaEntityProcessor.java Mon Feb 21 14:13:28 2011
@@ -17,6 +17,7 @@
package org.apache.solr.handler.dataimport;
import org.junit.BeforeClass;
+import org.junit.Test;
/**Testcase for TikaEntityProcessor
* @version $Id$
@@ -25,9 +26,10 @@ import org.junit.BeforeClass;
public class TestTikaEntityProcessor extends AbstractDataImportHandlerTestCase {
@BeforeClass
public static void beforeClass() throws Exception {
- initCore("dataimport-solrconfig.xml", "dataimport-schema-no-unique-key.xml", "solr-dihextras");
+ initCore("dataimport-solrconfig.xml", "dataimport-schema-no-unique-key.xml", getFile("solr-dihextras").getAbsolutePath());
}
+ @Test
public void testIndexingWithTikaEntityProcessor() throws Exception {
String conf =
"<dataConfig>" +
@@ -35,12 +37,17 @@ public class TestTikaEntityProcessor ext
" <document>" +
" <entity processor=\"TikaEntityProcessor\" url=\"" + getFile("solr-word.pdf").getAbsolutePath() + "\" >" +
" <field column=\"Author\" meta=\"true\" name=\"author\"/>" +
- " <field column=\"title\" meta=\"true\" name=\"docTitle\"/>" +
+ " <field column=\"title\" meta=\"true\" name=\"title\"/>" +
" <field column=\"text\"/>" +
" </entity>" +
" </document>" +
"</dataConfig>";
runFullImport(conf);
- assertQ(req("*:*"), "//*[@numFound='1']");
+ assertQ(req("*:*")
+ ,"//*[@numFound='1']"
+ ,"//str[@name='author'][.='Grant Ingersoll']"
+ ,"//str[@name='title'][.='solr-word']"
+ ,"//str[@name='text']"
+ );
}
}
Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/resources/solr-dihextras/conf/dataimport-solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/resources/solr-dihextras/conf/dataimport-solrconfig.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/resources/solr-dihextras/conf/dataimport-solrconfig.xml (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/extras/test/resources/solr-dihextras/conf/dataimport-solrconfig.xml Mon Feb 21 14:13:28 2011
@@ -18,19 +18,11 @@
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
- <!-- Set this to 'false' if you want solr to continue working after it has
- encountered an severe configuration error. In a production environment,
- you may want solr to keep working even if one handler is mis-configured.
-
- You may also set this to false using by setting the system property:
- -Dsolr.abortOnConfigurationError=false
- -->
- <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
<!-- Used to specify an alternate directory to hold all index data
other than the default ./data under the Solr home.
If replication is in use, this should match the replication configuration. -->
- <dataDir>${solr.data.dir:./solr/data}</dataDir>
+ <dataDir>${solr.data.dir:}</dataDir>
<indexDefaults>
Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImporter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImporter.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImporter.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DataImporter.java Mon Feb 21 14:13:28 2011
@@ -17,6 +17,7 @@
package org.apache.solr.handler.dataimport;
+import org.apache.solr.common.SolrException;
import org.apache.solr.core.SolrConfig;
import org.apache.solr.core.SolrCore;
import org.apache.solr.schema.IndexSchema;
@@ -336,7 +337,7 @@ public class DataImporter {
if (!requestParams.debug)
cumulativeStatistics.add(docBuilder.importStatistics);
} catch (Throwable t) {
- LOG.error("Full Import failed", t);
+ SolrException.log(LOG, "Full Import failed", t);
docBuilder.rollback();
} finally {
setStatus(Status.IDLE);
Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/DocBuilder.java Mon Feb 21 14:13:28 2011
@@ -17,6 +17,7 @@
package org.apache.solr.handler.dataimport;
+import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.core.SolrCore;
import static org.apache.solr.handler.dataimport.SolrWriter.LAST_INDEX_KEY;
@@ -318,7 +319,11 @@ public class DocBuilder {
String keyName = root.isDocRoot ? root.getPk() : root.getSchemaPk();
Object key = map.get(keyName);
if(key == null) {
- LOG.warn("no key was available for deleteted pk query. keyName = " + keyName);
+ keyName = findMatchingPkColumn(keyName, map);
+ key = map.get(keyName);
+ }
+ if(key == null) {
+ LOG.warn("no key was available for deleted pk query. keyName = " + keyName);
continue;
}
writer.deleteDoc(key);
@@ -486,7 +491,7 @@ public class DocBuilder {
importStatistics.skipDocCount.getAndIncrement();
exception = null;//should not propogate up
} else {
- LOG.error("Exception while processing: "
+ SolrException.log(LOG, "Exception while processing: "
+ entity.name + " document : " + docWrapper, dihe);
}
if (dihe.getErrCode() == DataImportHandlerException.SEVERE)
@@ -645,7 +650,7 @@ public class DocBuilder {
importStatistics.skipDocCount.getAndIncrement();
doc = null;
} else {
- LOG.error("Exception while processing: "
+ SolrException.log(LOG, "Exception while processing: "
+ entity.name + " document : " + doc, e);
}
if (e.getErrCode() == DataImportHandlerException.SEVERE)
@@ -816,6 +821,28 @@ public class DocBuilder {
return entity.processor = new EntityProcessorWrapper(entityProcessor, this);
}
+ private String findMatchingPkColumn(String pk, Map<String, Object> row) {
+ if (row.containsKey(pk))
+ throw new IllegalArgumentException(
+ String.format("deltaQuery returned a row with null for primary key %s", pk));
+ String resolvedPk = null;
+ for (String columnName : row.keySet()) {
+ if (columnName.endsWith("." + pk) || pk.endsWith("." + columnName)) {
+ if (resolvedPk != null)
+ throw new IllegalArgumentException(
+ String.format(
+ "deltaQuery has more than one column (%s and %s) that might resolve to declared primary key pk='%s'",
+ resolvedPk, columnName, pk));
+ resolvedPk = columnName;
+ }
+ }
+ if (resolvedPk == null)
+ throw new IllegalArgumentException(
+ String.format("deltaQuery has no column to resolve to declared primary key pk='%s'", pk));
+ LOG.info(String.format("Resolving deltaQuery column '%s' to match entity's declared pk '%s'", resolvedPk, pk));
+ return resolvedPk;
+ }
+
/**
* <p> Collects unique keys of all Solr documents for whom one or more source tables have been changed since the last
* indexed time. </p> <p> Note: In our definition, unique key of Solr document is the primary key of the top level
@@ -852,13 +879,20 @@ public class DocBuilder {
Map<String, Map<String, Object>> deltaSet = new HashMap<String, Map<String, Object>>();
LOG.info("Running ModifiedRowKey() for Entity: " + entity.name);
//get the modified rows in this entity
+ String pk = entity.getPk();
while (true) {
Map<String, Object> row = entityProcessor.nextModifiedRowKey();
if (row == null)
break;
- deltaSet.put(row.get(entity.getPk()).toString(), row);
+ Object pkValue = row.get(pk);
+ if (pkValue == null) {
+ pk = findMatchingPkColumn(pk, row);
+ pkValue = row.get(pk);
+ }
+
+ deltaSet.put(pkValue.toString(), row);
importStatistics.rowsCount.incrementAndGet();
// check for abort
if (stop.get())
@@ -873,8 +907,14 @@ public class DocBuilder {
deletedSet.add(row);
+ Object pkValue = row.get(pk);
+ if (pkValue == null) {
+ pk = findMatchingPkColumn(pk, row);
+ pkValue = row.get(pk);
+ }
+
// Remove deleted rows from the delta rows
- String deletedRowPk = row.get(entity.getPk()).toString();
+ String deletedRowPk = pkValue.toString();
if (deltaSet.containsKey(deletedRowPk)) {
deltaSet.remove(deletedRowPk);
}
Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorBase.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorBase.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorBase.java Mon Feb 21 14:13:28 2011
@@ -16,6 +16,7 @@
*/
package org.apache.solr.handler.dataimport;
+import org.apache.solr.common.SolrException;
import static org.apache.solr.handler.dataimport.DataImportHandlerException.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -79,7 +80,7 @@ public class EntityProcessorBase extends
rowIterator = null;
return null;
} catch (Exception e) {
- log.error("getNext() failed for query '" + query + "'", e);
+ SolrException.log(log, "getNext() failed for query '" + query + "'", e);
query = null;
rowIterator = null;
wrapAndThrow(DataImportHandlerException.WARN, e);
Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java Mon Feb 21 14:13:28 2011
@@ -16,6 +16,7 @@
*/
package org.apache.solr.handler.dataimport;
+import org.apache.solr.common.SolrException;
import static org.apache.solr.handler.dataimport.DataImportHandlerException.*;
import static org.apache.solr.handler.dataimport.EntityProcessorBase.*;
import static org.apache.solr.handler.dataimport.EntityProcessorBase.SKIP;
@@ -240,7 +241,7 @@ public class EntityProcessorWrapper exte
wrapAndThrow(SEVERE, e);
} else {
//SKIP is not really possible. If this calls the nextRow() again the Entityprocessor would be in an inconisttent state
- log.error("Exception in entity : "+ entityName, e);
+ SolrException.log(log, "Exception in entity : "+ entityName, e);
return null;
}
}
Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/webapp/admin/dataimport.jsp
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/webapp/admin/dataimport.jsp?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/webapp/admin/dataimport.jsp (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/main/webapp/admin/dataimport.jsp Mon Feb 21 14:13:28 2011
@@ -1,6 +1,5 @@
<%@ page import="org.apache.solr.request.SolrRequestHandler" %>
<%@ page import="java.util.Map" %>
-<%@ page import="org.apache.solr.handler.dataimport.DataImportHandler" %>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%--
Licensed to the Apache Software Foundation (ASF) under one or more
@@ -36,7 +35,7 @@ Select handler:
<ul>
<%
for (String key : handlers.keySet()) {
- if (handlers.get(key) instanceof DataImportHandler) { %>
+ if (handlers.get(key).getClass().getName().equals("org.apache.solr.handler.dataimport.DataImportHandler")) { %>
<li><a href="dataimport.jsp?handler=<%=key%>"><%=key%></a></li>
<%
}
Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java Mon Feb 21 14:13:28 2011
@@ -54,7 +54,7 @@ public abstract class AbstractDataImport
// note, a little twisted that we shadow this static method
public static void initCore(String config, String schema) throws Exception {
- initCore(config, schema, "solr-dih");
+ initCore(config, schema, getFile("solr-dih").getAbsolutePath());
}
@Override
Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestErrorHandling.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestErrorHandling.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestErrorHandling.java (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/java/org/apache/solr/handler/dataimport/TestErrorHandling.java Mon Feb 21 14:13:28 2011
@@ -37,6 +37,7 @@ public class TestErrorHandling extends A
@BeforeClass
public static void beforeClass() throws Exception {
initCore("dataimport-solrconfig.xml", "dataimport-schema.xml");
+ ignoreException("Unexpected close tag");
}
@Before @Override
Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/resources/solr-dih/conf/contentstream-solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/resources/solr-dih/conf/contentstream-solrconfig.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/resources/solr-dih/conf/contentstream-solrconfig.xml (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/resources/solr-dih/conf/contentstream-solrconfig.xml Mon Feb 21 14:13:28 2011
@@ -18,19 +18,11 @@
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
- <!-- Set this to 'false' if you want solr to continue working after it has
- encountered an severe configuration error. In a production environment,
- you may want solr to keep working even if one handler is mis-configured.
-
- You may also set this to false using by setting the system property:
- -Dsolr.abortOnConfigurationError=false
- -->
- <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
<!-- Used to specify an alternate directory to hold all index data
other than the default ./data under the Solr home.
If replication is in use, this should match the replication configuration. -->
- <dataDir>${solr.data.dir:./solr/data}</dataDir>
+ <dataDir>${solr.data.dir:}</dataDir>
<indexDefaults>
Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/resources/solr-dih/conf/dataimport-nodatasource-solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/resources/solr-dih/conf/dataimport-nodatasource-solrconfig.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/resources/solr-dih/conf/dataimport-nodatasource-solrconfig.xml (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/resources/solr-dih/conf/dataimport-nodatasource-solrconfig.xml Mon Feb 21 14:13:28 2011
@@ -18,19 +18,11 @@
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
- <!-- Set this to 'false' if you want solr to continue working after it has
- encountered an severe configuration error. In a production environment,
- you may want solr to keep working even if one handler is mis-configured.
-
- You may also set this to false using by setting the system property:
- -Dsolr.abortOnConfigurationError=false
- -->
- <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
<!-- Used to specify an alternate directory to hold all index data
other than the default ./data under the Solr home.
If replication is in use, this should match the replication configuration. -->
- <dataDir>${solr.data.dir:./solr/data}</dataDir>
+ <dataDir>${solr.data.dir:}</dataDir>
<indexDefaults>
Modified: lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/resources/solr-dih/conf/dataimport-solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/resources/solr-dih/conf/dataimport-solrconfig.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/resources/solr-dih/conf/dataimport-solrconfig.xml (original)
+++ lucene/dev/branches/docvalues/solr/contrib/dataimporthandler/src/test/resources/solr-dih/conf/dataimport-solrconfig.xml Mon Feb 21 14:13:28 2011
@@ -18,19 +18,11 @@
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
- <!-- Set this to 'false' if you want solr to continue working after it has
- encountered an severe configuration error. In a production environment,
- you may want solr to keep working even if one handler is mis-configured.
-
- You may also set this to false using by setting the system property:
- -Dsolr.abortOnConfigurationError=false
- -->
- <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
<!-- Used to specify an alternate directory to hold all index data
other than the default ./data under the Solr home.
If replication is in use, this should match the replication configuration. -->
- <dataDir>${solr.data.dir:./solr/data}</dataDir>
+ <dataDir>${solr.data.dir:}</dataDir>
<indexDefaults>
Modified: lucene/dev/branches/docvalues/solr/contrib/extraction/src/test/resources/solr-extraction/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/extraction/src/test/resources/solr-extraction/conf/solrconfig.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/extraction/src/test/resources/solr-extraction/conf/solrconfig.xml (original)
+++ lucene/dev/branches/docvalues/solr/contrib/extraction/src/test/resources/solr-extraction/conf/solrconfig.xml Mon Feb 21 14:13:28 2011
@@ -29,7 +29,7 @@
<!-- 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>
+ <dataDir>${solr.data.dir:}</dataDir>
<indexDefaults>
<!-- Values here affect all index writers and act as a default
Modified: lucene/dev/branches/docvalues/solr/contrib/uima/README.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/uima/README.txt?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/uima/README.txt (original)
+++ lucene/dev/branches/docvalues/solr/contrib/uima/README.txt Mon Feb 21 14:13:28 2011
@@ -35,6 +35,12 @@ To start using Solr UIMA Metadata Extrac
</type>
</fieldMapping>
</uimaConfig>
+
+ where VALID_ALCHEMYAPI_KEY is your AlchemyAPI Access Key. You need to register AlchemyAPI Access
+ key to exploit the AlchemyAPI services: http://www.alchemyapi.com/api/register.html
+
+ where VALID_OPENCALAIS_KEY is your Calais Service Key. You need to register Calais Service
+ key to exploit the Calais services: http://www.opencalais.com/apikey
5. the analysisEngine tag must contain an AE descriptor inside the specified path in the classpath
@@ -45,7 +51,7 @@ To start using Solr UIMA Metadata Extrac
8. define in your solrconfig.xml an UpdateRequestProcessorChain as following:
<updateRequestProcessorChain name="uima">
- <processor class="org.apache.solr.uima.processor.UIMAProcessorFactory"/>
+ <processor class="org.apache.solr.uima.processor.UIMAUpdateRequestProcessorFactory"/>
<processor class="solr.LogUpdateProcessorFactory" />
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>
Modified: lucene/dev/branches/docvalues/solr/contrib/uima/src/test/resources/solr-uima/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/contrib/uima/src/test/resources/solr-uima/conf/solrconfig.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/contrib/uima/src/test/resources/solr-uima/conf/solrconfig.xml (original)
+++ lucene/dev/branches/docvalues/solr/contrib/uima/src/test/resources/solr-uima/conf/solrconfig.xml Mon Feb 21 14:13:28 2011
@@ -24,15 +24,8 @@
https://issues.apache.org/jira/browse/SOLR-1167
-->
<config xmlns:xi="http://www.w3.org/2001/XInclude">
- <!--
- Set this to 'false' if you want solr to continue working after it
- has encountered an severe configuration error. In a production
- environment, you may want solr to keep working even if one handler
- is mis-configured. You may also set this to false using by setting
- the system property: -Dsolr.abortOnConfigurationError=false
- -->
+
<luceneMatchVersion>LUCENE_40</luceneMatchVersion>
- <abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
<!--
lib directives can be used to instruct Solr to load an Jars
@@ -74,7 +67,7 @@
than the default ./data under the Solr home. If replication is in
use, this should match the replication configuration.
-->
- <dataDir>${solr.data.dir:./solr/data}</dataDir>
+ <dataDir>${solr.data.dir:}</dataDir>
<!--
Modified: lucene/dev/branches/docvalues/solr/example/example-DIH/solr/db/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/example-DIH/solr/db/conf/solrconfig.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/example-DIH/solr/db/conf/solrconfig.xml (original)
+++ lucene/dev/branches/docvalues/solr/example/example-DIH/solr/db/conf/solrconfig.xml Mon Feb 21 14:13:28 2011
@@ -28,6 +28,8 @@
<jmx />
+ <lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-.*\.jar" />
+
<indexDefaults>
<!-- Values here affect all index writers and act as a default unless overridden. -->
<useCompoundFile>false</useCompoundFile>
Modified: lucene/dev/branches/docvalues/solr/example/example-DIH/solr/mail/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/example-DIH/solr/mail/conf/solrconfig.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/example-DIH/solr/mail/conf/solrconfig.xml (original)
+++ lucene/dev/branches/docvalues/solr/example/example-DIH/solr/mail/conf/solrconfig.xml Mon Feb 21 14:13:28 2011
@@ -27,7 +27,7 @@
<luceneMatchVersion>LUCENE_40</luceneMatchVersion>
<lib dir="../../../../contrib/dataimporthandler/lib/" regex=".*jar$" />
- <lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-extras-\d.*\.jar" />
+ <lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-.*\.jar" />
<indexDefaults>
<!-- Values here affect all index writers and act as a default unless overridden. -->
Modified: lucene/dev/branches/docvalues/solr/example/example-DIH/solr/rss/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/example-DIH/solr/rss/conf/solrconfig.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/example-DIH/solr/rss/conf/solrconfig.xml (original)
+++ lucene/dev/branches/docvalues/solr/example/example-DIH/solr/rss/conf/solrconfig.xml Mon Feb 21 14:13:28 2011
@@ -28,6 +28,8 @@
<jmx />
+ <lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-.*\.jar" />
+
<indexDefaults>
<!-- Values here affect all index writers and act as a default unless overridden. -->
<useCompoundFile>false</useCompoundFile>
Modified: lucene/dev/branches/docvalues/solr/example/example-DIH/solr/tika/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/example-DIH/solr/tika/conf/solrconfig.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/example-DIH/solr/tika/conf/solrconfig.xml (original)
+++ lucene/dev/branches/docvalues/solr/example/example-DIH/solr/tika/conf/solrconfig.xml Mon Feb 21 14:13:28 2011
@@ -27,13 +27,7 @@
<luceneMatchVersion>LUCENE_40</luceneMatchVersion>
<lib dir="../../../../contrib/extraction/lib" />
- <lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-extras-\d.*\.jar" />
-
- <!-- Used to specify an alternate directory to hold all index data
- other than the default ./data under the Solr home.
- If replication is in use, this should match the replication configuration. -->
- <dataDir>${solr.data.dir:./solr/data}</dataDir>
-
+ <lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-.*\.jar" />
<indexDefaults>
<!-- Values here affect all index writers and act as a default unless overridden. -->
Modified: lucene/dev/branches/docvalues/solr/example/solr/conf/velocity/tabs.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/solr/conf/velocity/tabs.vm?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/solr/conf/velocity/tabs.vm (original)
+++ lucene/dev/branches/docvalues/solr/example/solr/conf/velocity/tabs.vm Mon Feb 21 14:13:28 2011
@@ -1,6 +1,6 @@
##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">Simple</a>#{else}Simple#end</span>
-<span class="tab">#if($queryOpts == "spatial")Spatial#else<a href="#url_for_home?&queryOpts=spatial">Spatial</a>#end</span>
-<span class="tab">#if($queryOpts == "group")Group By#else<a href="#url_for_home?&queryOpts=group&group=true&group.field=manu_exact">Group By</a>#end</span></span>
+<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
Modified: lucene/dev/branches/docvalues/solr/example/solr/solr.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/solr/solr.xml?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/solr/solr.xml (original)
+++ lucene/dev/branches/docvalues/solr/example/solr/solr.xml Mon Feb 21 14:13:28 2011
@@ -29,6 +29,6 @@
If 'null' (or absent), cores will not be manageable via request handler
-->
<cores adminPath="/admin/cores" defaultCoreName="collection1">
- <core name="collection1" instanceDir="." />
+ <core name="collection1" instanceDir="." shard="shard1"/>
</cores>
</solr>
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/core/CoreContainer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/core/CoreContainer.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/core/CoreContainer.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/core/CoreContainer.java Mon Feb 21 14:13:28 2011
@@ -133,6 +133,11 @@ public class CoreContainer
if (zkRun == null && zookeeperHost == null)
return; // not in zk mode
+ // zookeeper in quorum mode currently causes a failure when trying to
+ // register log4j mbeans. See SOLR-2369
+ // TODO: remove after updating to an slf4j based zookeeper
+ System.setProperty("zookeeper.jmx.log4j.disable", "true");
+
zkServer = new SolrZkServer(zkRun, zookeeperHost, solrHome, hostPort);
zkServer.parseConfig();
zkServer.start();
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/request/SimpleFacets.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/request/SimpleFacets.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/request/SimpleFacets.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/request/SimpleFacets.java Mon Feb 21 14:13:28 2011
@@ -779,8 +779,9 @@ public class SimpleFacets {
* SolrParams
*
* @see FacetParams#FACET_DATE
+ * @deprecated Use getFacetRangeCounts which is more generalized
*/
-
+ @Deprecated
public NamedList<Object> getFacetDateCounts()
throws IOException, ParseException {
@@ -802,6 +803,10 @@ public class SimpleFacets {
return resOuter;
}
+ /**
+ * @deprecated Use getFacetRangeCounts which is more generalized
+ */
+ @Deprecated
public void getFacetDateCounts(String dateFacet, NamedList<Object> resOuter)
throws IOException, ParseException {
@@ -1158,6 +1163,10 @@ public class SimpleFacets {
return searcher.numDocs(rangeQ ,base);
}
+ /**
+ * @deprecated Use rangeCount(SchemaField,String,String,boolean,boolean) which is more generalized
+ */
+ @Deprecated
protected int rangeCount(SchemaField sf, Date low, Date high,
boolean iLow, boolean iHigh) throws IOException {
Query rangeQ = ((DateField)(sf.getType())).getRangeQuery(null, sf,low,high,iLow,iHigh);
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/AbstractSubTypeFieldType.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/AbstractSubTypeFieldType.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/AbstractSubTypeFieldType.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/AbstractSubTypeFieldType.java Mon Feb 21 14:13:28 2011
@@ -85,6 +85,7 @@ public abstract class AbstractSubTypeFie
//Just set these, delegate everything else to the field type
props.put("indexed", "true");
props.put("stored", "false");
+ props.put("multiValued", "false");
int p = SchemaField.calcProps(name, type, props);
SchemaField proto = SchemaField.create(name,
type, p, null);
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/BoolField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/BoolField.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/BoolField.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/BoolField.java Mon Feb 21 14:13:28 2011
@@ -49,6 +49,7 @@ public class BoolField extends FieldType
@Override
public ValueSource getValueSource(SchemaField field, QParser qparser) {
+ field.checkFieldCacheSource(qparser);
return new OrdFieldSource(field.name);
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/ByteField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/ByteField.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/ByteField.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/ByteField.java Mon Feb 21 14:13:28 2011
@@ -47,6 +47,7 @@ public class ByteField extends FieldType
@Override
public ValueSource getValueSource(SchemaField field, QParser qparser) {
+ field.checkFieldCacheSource(qparser);
return new ByteFieldSource( new ByteValuesCreator( field.name, null, CachedArrayCreator.CACHE_VALUES_AND_BITS ) );
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/DateField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/DateField.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/DateField.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/DateField.java Mon Feb 21 14:13:28 2011
@@ -220,10 +220,6 @@ public class DateField extends FieldType
return getStringSort(field,reverse);
}
- public ValueSource getValueSource(SchemaField field) {
- return new OrdFieldSource(field.name);
- }
-
@Override
public void write(TextResponseWriter writer, String name, Fieldable f) throws IOException {
writer.writeDate(name, toExternal(f));
@@ -408,6 +404,7 @@ public class DateField extends FieldType
@Override
public ValueSource getValueSource(SchemaField field, QParser parser) {
+ field.checkFieldCacheSource(parser);
return new DateFieldSource(field.getName(), field.getType());
}
@@ -499,4 +496,4 @@ class DateFieldSource extends FieldCache
public int hashCode() {
return hcode + super.hashCode();
};
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/DoubleField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/DoubleField.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/DoubleField.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/DoubleField.java Mon Feb 21 14:13:28 2011
@@ -47,7 +47,7 @@ public class DoubleField extends FieldTy
@Override
public ValueSource getValueSource(SchemaField field, QParser qparser) {
- // fieldCache doesn't support double
+ field.checkFieldCacheSource(qparser);
return new DoubleFieldSource( new DoubleValuesCreator( field.name, null, CachedArrayCreator.CACHE_VALUES_AND_BITS ) );
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/FieldType.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/FieldType.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/FieldType.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/FieldType.java Mon Feb 21 14:13:28 2011
@@ -496,6 +496,7 @@ public abstract class FieldType extends
* Lucene FieldCache.)
*/
public ValueSource getValueSource(SchemaField field, QParser parser) {
+ field.checkFieldCacheSource(parser);
return new StrFieldSource(field.name);
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/FloatField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/FloatField.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/FloatField.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/FloatField.java Mon Feb 21 14:13:28 2011
@@ -45,6 +45,7 @@ public class FloatField extends FieldTyp
@Override
public ValueSource getValueSource(SchemaField field, QParser qparser) {
+ field.checkFieldCacheSource(qparser);
return new FloatFieldSource( new FloatValuesCreator( field.name, null, CachedArrayCreator.CACHE_VALUES_AND_BITS ) );
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/GeoHashField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/GeoHashField.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/GeoHashField.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/GeoHashField.java Mon Feb 21 14:13:28 2011
@@ -97,6 +97,7 @@ public class GeoHashField extends FieldT
@Override
public ValueSource getValueSource(SchemaField field, QParser parser) {
+ field.checkFieldCacheSource(parser);
return new StrFieldSource(field.name);
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/IntField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/IntField.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/IntField.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/IntField.java Mon Feb 21 14:13:28 2011
@@ -45,6 +45,7 @@ public class IntField extends FieldType
@Override
public ValueSource getValueSource(SchemaField field, QParser qparser) {
+ field.checkFieldCacheSource(qparser);
return new IntFieldSource(new IntValuesCreator( field.name, null, CachedArrayCreator.CACHE_VALUES_AND_BITS ) );
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/LongField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/LongField.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/LongField.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/LongField.java Mon Feb 21 14:13:28 2011
@@ -47,6 +47,7 @@ public class LongField extends FieldType
@Override
public ValueSource getValueSource(SchemaField field, QParser qparser) {
+ field.checkFieldCacheSource(qparser);
return new LongFieldSource( new LongValuesCreator( field.name, null, CachedArrayCreator.CACHE_VALUES_AND_BITS ) );
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SchemaField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SchemaField.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SchemaField.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SchemaField.java Mon Feb 21 14:13:28 2011
@@ -22,6 +22,7 @@ import org.apache.solr.common.SolrExcept
import org.apache.lucene.document.Field;
import org.apache.lucene.document.Fieldable;
import org.apache.lucene.search.SortField;
+import org.apache.solr.search.QParser;
import org.apache.solr.response.TextResponseWriter;
@@ -133,8 +134,8 @@ public final class SchemaField extends F
/**
* Sanity checks that the properties of this field type are plausible
- * for a field that may be used in sorting, throwing an appropraite
- * exception (including hte field name) if it is not. FieldType subclasses
+ * for a field that may be used in sorting, throwing an appropriate
+ * exception (including the field name) if it is not. FieldType subclasses
* can choose to call this method in their getSortField implementation
* @see FieldType#getSortField
*/
@@ -152,6 +153,27 @@ public final class SchemaField extends F
}
+ /**
+ * Sanity checks that the properties of this field type are plausible
+ * for a field that may be used to get a FieldCacheSource, throwing
+ * an appropriate exception (including the field name) if it is not.
+ * FieldType subclasses can choose to call this method in their
+ * getValueSource implementation
+ * @see FieldType#getValueSource
+ */
+ public void checkFieldCacheSource(QParser parser) throws SolrException {
+ if (! indexed() ) {
+ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
+ "can not use FieldCache on unindexed field: "
+ + getName());
+ }
+ if ( multiValued() ) {
+ throw new SolrException(SolrException.ErrorCode.BAD_REQUEST,
+ "can not use FieldCache on multivalued field: "
+ + getName());
+ }
+
+ }
static SchemaField create(String name, FieldType ft, Map<String,String> props) {
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/ShortField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/ShortField.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/ShortField.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/ShortField.java Mon Feb 21 14:13:28 2011
@@ -50,7 +50,7 @@ public class ShortField extends FieldTyp
@Override
public ValueSource getValueSource(SchemaField field, QParser qparser) {
-
+ field.checkFieldCacheSource(qparser);
return new ShortFieldSource(new ShortValuesCreator( field.name, null, CachedArrayCreator.CACHE_VALUES_AND_BITS ) );
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SortableDoubleField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SortableDoubleField.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SortableDoubleField.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SortableDoubleField.java Mon Feb 21 14:13:28 2011
@@ -53,6 +53,7 @@ public class SortableDoubleField extends
@Override
public ValueSource getValueSource(SchemaField field, QParser qparser) {
+ field.checkFieldCacheSource(qparser);
return new SortableDoubleFieldSource(field.name);
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SortableFloatField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SortableFloatField.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SortableFloatField.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SortableFloatField.java Mon Feb 21 14:13:28 2011
@@ -53,6 +53,7 @@ public class SortableFloatField extends
@Override
public ValueSource getValueSource(SchemaField field, QParser qparser) {
+ field.checkFieldCacheSource(qparser);
return new SortableFloatFieldSource(field.name);
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SortableIntField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SortableIntField.java?rev=1072973&r1=1072972&r2=1072973&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SortableIntField.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/schema/SortableIntField.java Mon Feb 21 14:13:28 2011
@@ -53,6 +53,7 @@ public class SortableIntField extends Fi
@Override
public ValueSource getValueSource(SchemaField field, QParser qparser) {
+ field.checkFieldCacheSource(qparser);
return new SortableIntFieldSource(field.name);
}