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/09 10:36:03 UTC
svn commit: r1068809 [25/36] - in /lucene/dev/branches/docvalues: ./
dev-tools/eclipse/ dev-tools/idea/.idea/ dev-tools/idea/.idea/copyright/
dev-tools/idea/lucene/ dev-tools/idea/lucene/contrib/ant/
dev-tools/idea/lucene/contrib/queryparser/ dev-tools...
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=1068809&r1=1068808&r2=1068809&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 Wed Feb 9 09:35:27 2011
@@ -17,14 +17,14 @@
-->
<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>
+
+ <!--
+ Controls what version of Lucene various components of Solr adhere to. Generally, you want
+ to use the latest version to get all bug fixes and improvements. It is highly recommended
+ that you fully re-index after changing this setting as it can affect both how text is indexed
+ and queried.
+ -->
+ <luceneMatchVersion>LUCENE_40</luceneMatchVersion>
<lib dir="../../../../contrib/dataimporthandler/lib/" regex=".*jar$" />
<lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-extras-\d.*\.jar" />
@@ -655,12 +655,6 @@
<requestHandler name="/update/javabin" class="solr.BinaryUpdateRequestHandler" />
- <!--
- Analysis request handler. Since Solr 1.3. Use to returnhow a document is analyzed. Useful
- for debugging and as a token server for other types of applications
- -->
- <requestHandler name="/analysis" class="solr.AnalysisRequestHandler" />
-
<!-- CSV update handler, loaded on demand -->
<requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
@@ -721,7 +715,7 @@
<!-- allow 50% slop on fragment sizes -->
<float name="hl.regex.slop">0.5</float>
<!-- a basic sentence pattern -->
- <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
+ <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
</lst>
</fragmenter>
Modified: lucene/dev/branches/docvalues/solr/example/example-DIH/solr/rss/conf/rss-data-config.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/example-DIH/solr/rss/conf/rss-data-config.xml?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/example-DIH/solr/rss/conf/rss-data-config.xml (original)
+++ lucene/dev/branches/docvalues/solr/example/example-DIH/solr/rss/conf/rss-data-config.xml Wed Feb 9 09:35:27 2011
@@ -5,17 +5,22 @@
pk="link"
url="http://rss.slashdot.org/Slashdot/slashdot"
processor="XPathEntityProcessor"
- forEach="/rss/channel/item"
+ forEach="/RDF/channel | /RDF/item"
transformer="DateFormatTransformer">
+
+ <field column="source" xpath="/RDF/channel/title" commonField="true" />
+ <field column="source-link" xpath="/RDF/channel/link" commonField="true" />
+ <field column="subject" xpath="/RDF/channel/subject" commonField="true" />
- <field column="title" xpath="/rss/channel/item/title" />
- <field column="link" xpath="/rss/channel/item/link" />
- <field column="description" xpath="/rss/channel/item/description" />
- <field column="creator" xpath="/rss/channel/item/creator" />
- <field column="item-subject" xpath="/rss/channel/item/subject" />
- <field column="date" xpath="/rss/channel/item/date" dateTimeFormat="yyyy-MM-dd'T'hh:mm:ss" />
- <field column="slash-department" xpath="/rss/channel/item/department" />
- <field column="slash-section" xpath="/rss/channel/item/section" />
+ <field column="title" xpath="/RDF/item/title" />
+ <field column="link" xpath="/RDF/item/link" />
+ <field column="description" xpath="/RDF/item/description" />
+ <field column="creator" xpath="/RDF/item/creator" />
+ <field column="item-subject" xpath="/RDF/item/subject" />
+ <field column="date" xpath="/RDF/item/date" dateTimeFormat="yyyy-MM-dd'T'hh:mm:ss" />
+ <field column="slash-department" xpath="/RDF/item/department" />
+ <field column="slash-section" xpath="/RDF/item/section" />
+ <field column="slash-comments" xpath="/RDF/item/comments" />
</entity>
</document>
</dataConfig>
Modified: lucene/dev/branches/docvalues/solr/example/example-DIH/solr/rss/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/example-DIH/solr/rss/conf/schema.xml?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/example-DIH/solr/rss/conf/schema.xml (original)
+++ lucene/dev/branches/docvalues/solr/example/example-DIH/solr/rss/conf/schema.xml Wed Feb 9 09:35:27 2011
@@ -294,10 +294,11 @@
<field name="link" type="string" indexed="true" stored="true" />
<field name="description" type="html" indexed="true" stored="true" />
<field name="creator" type="string" indexed="false" stored="true" />
- <field name="item-subject" type="string" indexed="true" stored="true" />
- <field name="date" type="date" indexed="true" stored="true" />
- <field name="slash-department" type="string" indexed="true" stored="true" />
- <field name="slash-section" type="string" indexed="true" stored="true" />
+ <field name="item-subject" type="string" indexed="true" stored="false" />
+ <field name="date" type="date" indexed="true" stored="false" />
+ <field name="slash-department" type="string" indexed="true" stored="false" />
+ <field name="slash-section" type="string" indexed="true" stored="false" />
+ <field name="slash-comments" type="sint" indexed="true" stored="true" />
<field name="all_text" type="text" indexed="true" stored="false" multiValued="true" />
<copyField source="source" dest="all_text" />
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=1068809&r1=1068808&r2=1068809&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 Wed Feb 9 09:35:27 2011
@@ -17,18 +17,17 @@
-->
<config>
+
+ <!--
+ Controls what version of Lucene various components of Solr adhere to. Generally, you want
+ to use the latest version to get all bug fixes and improvements. It is highly recommended
+ that you fully re-index after changing this setting as it can affect both how text is indexed
+ and queried.
+ -->
+ <luceneMatchVersion>LUCENE_40</luceneMatchVersion>
<jmx />
- <!-- 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>
-
<indexDefaults>
<!-- Values here affect all index writers and act as a default unless overridden. -->
<useCompoundFile>false</useCompoundFile>
@@ -350,112 +349,6 @@
</lst>
</requestHandler>
-
- <!-- DisMaxRequestHandler allows easy searching across multiple fields
- for simple user-entered phrases.
- see http://wiki.apache.org/solr/DisMaxRequestHandler
- -->
- <requestHandler name="dismax" class="solr.DisMaxRequestHandler" >
- <lst name="defaults">
- <str name="echoParams">explicit</str>
- <float name="tie">0.01</float>
- <str name="qf">
- text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
- </str>
- <str name="pf">
- text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9
- </str>
- <str name="bf">
- ord(popularity)^0.5 recip(rord(price),1,1000,1000)^0.3
- </str>
- <str name="fl">
- id,name,price,score
- </str>
- <str name="mm">
- 2<-1 5<-2 6<90%
- </str>
- <int name="ps">100</int>
- <str name="q.alt">*:*</str>
- <!-- example highlighter config, enable per-query with hl=true -->
- <str name="hl.fl">text features name</str>
- <!-- for this field, we want no fragmenting, just highlighting -->
- <str name="f.name.hl.fragsize">0</str>
- <!-- instructs Solr to return the field itself if no query terms are
- found -->
- <str name="f.name.hl.alternateField">name</str>
- <str name="f.text.hl.fragmenter">regex</str> <!-- defined below -->
- </lst>
- </requestHandler>
-
- <!-- Note how you can register the same handler multiple times with
- different names (and different init parameters)
- -->
- <requestHandler name="partitioned" class="solr.DisMaxRequestHandler" >
- <lst name="defaults">
- <str name="echoParams">explicit</str>
- <str name="qf">text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0</str>
- <str name="mm">2<-1 5<-2 6<90%</str>
- <!-- This is an example of using Date Math to specify a constantly
- moving date range in a config...
- -->
- <str name="bq">incubationdate_dt:[* TO NOW/DAY-1MONTH]^2.2</str>
- </lst>
- <!-- In addition to defaults, "appends" params can be specified
- to identify values which should be appended to the list of
- multi-val params from the query (or the existing "defaults").
-
- In this example, the param "fq=instock:true" will be appended to
- any query time fq params the user may specify, as a mechanism for
- partitioning the index, independent of any user selected filtering
- that may also be desired (perhaps as a result of faceted searching).
-
- NOTE: there is *absolutely* nothing a client can do to prevent these
- "appends" values from being used, so don't use this mechanism
- unless you are sure you always want it.
- -->
- <lst name="appends">
- <str name="fq">inStock:true</str>
- </lst>
- <!-- "invariants" are a way of letting the Solr maintainer lock down
- the options available to Solr clients. Any params values
- specified here are used regardless of what values may be specified
- in either the query, the "defaults", or the "appends" params.
-
- In this example, the facet.field and facet.query params are fixed,
- limiting the facets clients can use. Faceting is not turned on by
- default - but if the client does specify facet=true in the request,
- these are the only facets they will be able to see counts for;
- regardless of what other facet.field or facet.query params they
- may specify.
-
- NOTE: there is *absolutely* nothing a client can do to prevent these
- "invariants" values from being used, so don't use this mechanism
- unless you are sure you always want it.
- -->
- <lst name="invariants">
- <str name="facet.field">cat</str>
- <str name="facet.field">manu_exact</str>
- <str name="facet.query">price:[* TO 500]</str>
- <str name="facet.query">price:[500 TO *]</str>
- </lst>
- </requestHandler>
-
- <requestHandler name="instock" class="solr.DisMaxRequestHandler" >
- <!-- for legacy reasons, DisMaxRequestHandler will assume all init
- params are "defaults" if you don't explicitly specify any defaults.
- -->
- <str name="fq">
- inStock:true
- </str>
- <str name="qf">
- text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
- </str>
- <str name="mm">
- 2<-1 5<-2 6<90%
- </str>
- </requestHandler>
-
-
<!-- SpellCheckerRequestHandler takes in a word (or several words) as the
value of the "q" parameter and returns a list of alternative spelling
suggestions. If invoked with a ...&cmd=rebuild, it will rebuild the
@@ -489,7 +382,7 @@
</lst>
</requestHandler>
-<requestHandler name="/dataimport"
+ <requestHandler name="/dataimport"
class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">rss-data-config.xml</str>
@@ -574,16 +467,6 @@
-->
</requestHandler>
- <!--
- Analysis request handler. Since Solr 1.3. Use to returnhow a document is analyzed. Useful
- for debugging and as a token server for other types of applications
- -->
- <requestHandler name="/analysis" class="solr.AnalysisRequestHandler" >
- <!--
- <str name="update.processor.class">org.apache.solr.handler.UpdateRequestProcessor</str>
- -->
- </requestHandler>
-
<!-- CSV update handler, loaded on demand -->
<requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
@@ -643,7 +526,7 @@
<!-- allow 50% slop on fragment sizes -->
<float name="hl.regex.slop">0.5</float>
<!-- a basic sentence pattern -->
- <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
+ <str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
</lst>
</fragmenter>
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=1068809&r1=1068808&r2=1068809&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 Wed Feb 9 09:35:27 2011
@@ -17,14 +17,14 @@
-->
<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>
+
+ <!--
+ Controls what version of Lucene various components of Solr adhere to. Generally, you want
+ to use the latest version to get all bug fixes and improvements. It is highly recommended
+ that you fully re-index after changing this setting as it can affect both how text is indexed
+ and queried.
+ -->
+ <luceneMatchVersion>LUCENE_40</luceneMatchVersion>
<lib dir="../../../../contrib/extraction/lib" />
<lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-extras-\d.*\.jar" />
Modified: lucene/dev/branches/docvalues/solr/example/exampledocs/post.sh
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/exampledocs/post.sh?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/exampledocs/post.sh (original)
+++ lucene/dev/branches/docvalues/solr/example/exampledocs/post.sh Wed Feb 9 09:35:27 2011
@@ -19,10 +19,10 @@ URL=http://localhost:8983/solr/update
for f in $FILES; do
echo Posting file $f to $URL
- curl $URL --data-binary @$f -H 'Content-type:text/xml; charset=utf-8'
+ curl $URL --data-binary @$f -H 'Content-type:application/xml'
echo
done
#send the commit command to make sure all the changes are flushed and visible
-curl $URL --data-binary '<commit/>' -H 'Content-type:text/xml; charset=utf-8'
+curl $URL --data-binary '<commit/>' -H 'Content-type:application/xml'
echo
Modified: lucene/dev/branches/docvalues/solr/example/solr/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/solr/conf/schema.xml?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/solr/conf/schema.xml (original)
+++ lucene/dev/branches/docvalues/solr/example/solr/conf/schema.xml Wed Feb 9 09:35:27 2011
@@ -376,6 +376,11 @@
</analyzer>
</fieldType>
+ <fieldType name="text_path" class="solr.TextField" positionIncrementGap="100">
+ <analyzer>
+ <tokenizer class="solr.PathHierarchyTokenizerFactory"/>
+ </analyzer>
+ </fieldType>
<!-- since fields of this type are by default not stored or indexed,
any data added to them will be ignored outright. -->
Modified: lucene/dev/branches/docvalues/solr/example/solr/conf/synonyms.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/solr/conf/synonyms.txt?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/example/solr/conf/synonyms.txt (original)
+++ lucene/dev/branches/docvalues/solr/example/solr/conf/synonyms.txt Wed Feb 9 09:35:27 2011
@@ -12,11 +12,9 @@
#-----------------------------------------------------------------------
#some test synonym mappings unlikely to appear in real input text
-aaa => aaaa
-bbb => bbbb1 bbbb2
-ccc => cccc1,cccc2
-a\=>a => b\=>b
-a\,a => b\,b
+aaafoo => aaabar
+bbbfoo => bbbfoo bbbbar
+cccfoo => cccbar cccbaz
fooaaa,baraaa,bazaaa
# Some synonym groups specific to this example
Modified: lucene/dev/branches/docvalues/solr/example/start.jar
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/example/start.jar?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
Binary files - no diff available.
Modified: lucene/dev/branches/docvalues/solr/lib/apache-solr-noggit-r944541.jar
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/lib/apache-solr-noggit-r944541.jar?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
Binary files - no diff available.
Modified: lucene/dev/branches/docvalues/solr/site/features.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/site/features.html?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/site/features.html (original)
+++ lucene/dev/branches/docvalues/solr/site/features.html Wed Feb 9 09:35:27 2011
@@ -48,12 +48,12 @@
|start Search
+-->
<div class="searchbox">
-<form action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
+<form id="searchform" action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
<input onFocus="getBlank (this, 'Search the site with Solr');" size="25" name="q" id="query" type="text" value="Search the site with Solr">
- <input name="Search" value="Search" type="submit">
+ <input onclick="selectProvider(this.form)" name="Search" value="Search" type="submit">
+ @
+ <select id="searchProvider" name="searchProvider"><option value="any">select provider</option><option value="lucid">Lucid Find</option><option value="sl">Search-Lucene</option></select>
</form>
-<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
-</div>
</div>
<!--+
|end search
@@ -155,6 +155,43 @@ document.write("Last Published: " + docu
<a href="http://lucene.apache.org/nutch/">Nutch</a>
</div>
</div>
+<script type="text/javascript">
+ function selectProvider(form) {
+ provider = form.elements['searchProvider'].value;
+ if (provider == "any") {
+ if (Math.random() > 0.5) {
+ provider = "lucid";
+ } else {
+ provider = "sl";
+ }
+ }
+
+ if (provider == "lucid") {
+ form.action = "http://search.lucidimagination.com/p:solr";
+ } else if (provider == "sl") {
+ form.action = "http://search-lucene.com/solr";
+ }
+
+ days = 365; // cookie will be valid for a year
+ date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ expires = "; expires=" + date.toGMTString();
+ document.cookie = "searchProvider=" + provider + expires + "; path=/";
+ }
+
+ if (document.cookie.length>0) {
+ cStart=document.cookie.indexOf("searchProvider=");
+ if (cStart!=-1) {
+ cStart=cStart + "searchProvider=".length;
+ cEnd=document.cookie.indexOf(";", cStart);
+ if (cEnd==-1) {
+ cEnd=document.cookie.length;
+ }
+ provider = unescape(document.cookie.substring(cStart,cEnd));
+ document.forms['searchform'].elements['searchProvider'].value = provider;
+ }
+ }
+ </script>
<div id="credit"></div>
<div id="roundbottom">
<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
Modified: lucene/dev/branches/docvalues/solr/site/images/solr.jpg
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/site/images/solr.jpg?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
Binary files - no diff available.
Modified: lucene/dev/branches/docvalues/solr/site/index.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/site/index.html?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/site/index.html (original)
+++ lucene/dev/branches/docvalues/solr/site/index.html Wed Feb 9 09:35:27 2011
@@ -48,12 +48,12 @@
|start Search
+-->
<div class="searchbox">
-<form action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
+<form id="searchform" action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
<input onFocus="getBlank (this, 'Search the site with Solr');" size="25" name="q" id="query" type="text" value="Search the site with Solr">
- <input name="Search" value="Search" type="submit">
+ <input onclick="selectProvider(this.form)" name="Search" value="Search" type="submit">
+ @
+ <select id="searchProvider" name="searchProvider"><option value="any">select provider</option><option value="lucid">Lucid Find</option><option value="sl">Search-Lucene</option></select>
</form>
-<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
-</div>
</div>
<!--+
|end search
@@ -155,6 +155,43 @@ document.write("Last Published: " + docu
<a href="http://lucene.apache.org/nutch/">Nutch</a>
</div>
</div>
+<script type="text/javascript">
+ function selectProvider(form) {
+ provider = form.elements['searchProvider'].value;
+ if (provider == "any") {
+ if (Math.random() > 0.5) {
+ provider = "lucid";
+ } else {
+ provider = "sl";
+ }
+ }
+
+ if (provider == "lucid") {
+ form.action = "http://search.lucidimagination.com/p:solr";
+ } else if (provider == "sl") {
+ form.action = "http://search-lucene.com/solr";
+ }
+
+ days = 365; // cookie will be valid for a year
+ date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ expires = "; expires=" + date.toGMTString();
+ document.cookie = "searchProvider=" + provider + expires + "; path=/";
+ }
+
+ if (document.cookie.length>0) {
+ cStart=document.cookie.indexOf("searchProvider=");
+ if (cStart!=-1) {
+ cStart=cStart + "searchProvider=".length;
+ cEnd=document.cookie.indexOf(";", cStart);
+ if (cEnd==-1) {
+ cEnd=document.cookie.length;
+ }
+ provider = unescape(document.cookie.substring(cStart,cEnd));
+ document.forms['searchform'].elements['searchProvider'].value = provider;
+ }
+ }
+ </script>
<div id="credit">
<hr>
<a href="http://forrest.apache.org/"><img border="0" title="Built with Apache Forrest" alt="Built with Apache Forrest - logo" src="images/built-with-forrest-button.png" style="width: 88px;height: 31px;"></a>
Modified: lucene/dev/branches/docvalues/solr/site/issue_tracking.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/site/issue_tracking.html?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/site/issue_tracking.html (original)
+++ lucene/dev/branches/docvalues/solr/site/issue_tracking.html Wed Feb 9 09:35:27 2011
@@ -48,12 +48,12 @@
|start Search
+-->
<div class="searchbox">
-<form action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
+<form id="searchform" action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
<input onFocus="getBlank (this, 'Search the site with Solr');" size="25" name="q" id="query" type="text" value="Search the site with Solr">
- <input name="Search" value="Search" type="submit">
+ <input onclick="selectProvider(this.form)" name="Search" value="Search" type="submit">
+ @
+ <select id="searchProvider" name="searchProvider"><option value="any">select provider</option><option value="lucid">Lucid Find</option><option value="sl">Search-Lucene</option></select>
</form>
-<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
-</div>
</div>
<!--+
|end search
@@ -155,6 +155,43 @@ document.write("Last Published: " + docu
<a href="http://lucene.apache.org/nutch/">Nutch</a>
</div>
</div>
+<script type="text/javascript">
+ function selectProvider(form) {
+ provider = form.elements['searchProvider'].value;
+ if (provider == "any") {
+ if (Math.random() > 0.5) {
+ provider = "lucid";
+ } else {
+ provider = "sl";
+ }
+ }
+
+ if (provider == "lucid") {
+ form.action = "http://search.lucidimagination.com/p:solr";
+ } else if (provider == "sl") {
+ form.action = "http://search-lucene.com/solr";
+ }
+
+ days = 365; // cookie will be valid for a year
+ date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ expires = "; expires=" + date.toGMTString();
+ document.cookie = "searchProvider=" + provider + expires + "; path=/";
+ }
+
+ if (document.cookie.length>0) {
+ cStart=document.cookie.indexOf("searchProvider=");
+ if (cStart!=-1) {
+ cStart=cStart + "searchProvider=".length;
+ cEnd=document.cookie.indexOf(";", cStart);
+ if (cEnd==-1) {
+ cEnd=document.cookie.length;
+ }
+ provider = unescape(document.cookie.substring(cStart,cEnd));
+ document.forms['searchform'].elements['searchProvider'].value = provider;
+ }
+ }
+ </script>
<div id="credit"></div>
<div id="roundbottom">
<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
Modified: lucene/dev/branches/docvalues/solr/site/linkmap.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/site/linkmap.html?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/site/linkmap.html (original)
+++ lucene/dev/branches/docvalues/solr/site/linkmap.html Wed Feb 9 09:35:27 2011
@@ -48,12 +48,12 @@
|start Search
+-->
<div class="searchbox">
-<form action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
+<form id="searchform" action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
<input onFocus="getBlank (this, 'Search the site with Solr');" size="25" name="q" id="query" type="text" value="Search the site with Solr">
- <input name="Search" value="Search" type="submit">
+ <input onclick="selectProvider(this.form)" name="Search" value="Search" type="submit">
+ @
+ <select id="searchProvider" name="searchProvider"><option value="any">select provider</option><option value="lucid">Lucid Find</option><option value="sl">Search-Lucene</option></select>
</form>
-<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
-</div>
</div>
<!--+
|end search
@@ -155,6 +155,43 @@ document.write("Last Published: " + docu
<a href="http://lucene.apache.org/nutch/">Nutch</a>
</div>
</div>
+<script type="text/javascript">
+ function selectProvider(form) {
+ provider = form.elements['searchProvider'].value;
+ if (provider == "any") {
+ if (Math.random() > 0.5) {
+ provider = "lucid";
+ } else {
+ provider = "sl";
+ }
+ }
+
+ if (provider == "lucid") {
+ form.action = "http://search.lucidimagination.com/p:solr";
+ } else if (provider == "sl") {
+ form.action = "http://search-lucene.com/solr";
+ }
+
+ days = 365; // cookie will be valid for a year
+ date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ expires = "; expires=" + date.toGMTString();
+ document.cookie = "searchProvider=" + provider + expires + "; path=/";
+ }
+
+ if (document.cookie.length>0) {
+ cStart=document.cookie.indexOf("searchProvider=");
+ if (cStart!=-1) {
+ cStart=cStart + "searchProvider=".length;
+ cEnd=document.cookie.indexOf(";", cStart);
+ if (cEnd==-1) {
+ cEnd=document.cookie.length;
+ }
+ provider = unescape(document.cookie.substring(cStart,cEnd));
+ document.forms['searchform'].elements['searchProvider'].value = provider;
+ }
+ }
+ </script>
<div id="credit"></div>
<div id="roundbottom">
<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
Modified: lucene/dev/branches/docvalues/solr/site/mailing_lists.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/site/mailing_lists.html?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/site/mailing_lists.html (original)
+++ lucene/dev/branches/docvalues/solr/site/mailing_lists.html Wed Feb 9 09:35:27 2011
@@ -48,12 +48,12 @@
|start Search
+-->
<div class="searchbox">
-<form action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
+<form id="searchform" action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
<input onFocus="getBlank (this, 'Search the site with Solr');" size="25" name="q" id="query" type="text" value="Search the site with Solr">
- <input name="Search" value="Search" type="submit">
+ <input onclick="selectProvider(this.form)" name="Search" value="Search" type="submit">
+ @
+ <select id="searchProvider" name="searchProvider"><option value="any">select provider</option><option value="lucid">Lucid Find</option><option value="sl">Search-Lucene</option></select>
</form>
-<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
-</div>
</div>
<!--+
|end search
@@ -155,6 +155,43 @@ document.write("Last Published: " + docu
<a href="http://lucene.apache.org/nutch/">Nutch</a>
</div>
</div>
+<script type="text/javascript">
+ function selectProvider(form) {
+ provider = form.elements['searchProvider'].value;
+ if (provider == "any") {
+ if (Math.random() > 0.5) {
+ provider = "lucid";
+ } else {
+ provider = "sl";
+ }
+ }
+
+ if (provider == "lucid") {
+ form.action = "http://search.lucidimagination.com/p:solr";
+ } else if (provider == "sl") {
+ form.action = "http://search-lucene.com/solr";
+ }
+
+ days = 365; // cookie will be valid for a year
+ date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ expires = "; expires=" + date.toGMTString();
+ document.cookie = "searchProvider=" + provider + expires + "; path=/";
+ }
+
+ if (document.cookie.length>0) {
+ cStart=document.cookie.indexOf("searchProvider=");
+ if (cStart!=-1) {
+ cStart=cStart + "searchProvider=".length;
+ cEnd=document.cookie.indexOf(";", cStart);
+ if (cEnd==-1) {
+ cEnd=document.cookie.length;
+ }
+ provider = unescape(document.cookie.substring(cStart,cEnd));
+ document.forms['searchform'].elements['searchProvider'].value = provider;
+ }
+ }
+ </script>
<div id="credit"></div>
<div id="roundbottom">
<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
Modified: lucene/dev/branches/docvalues/solr/site/skin/screen.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/site/skin/screen.css?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/site/skin/screen.css (original)
+++ lucene/dev/branches/docvalues/solr/site/skin/screen.css Wed Feb 9 09:35:27 2011
@@ -95,7 +95,7 @@ html>body #top .searchbox {
#top .searchbox {
position: absolute;
right: 10px;
- height: 42px;
+ height: 28px;
font-size: 70%;
white-space: nowrap;
text-align: right;
Modified: lucene/dev/branches/docvalues/solr/site/tutorial.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/site/tutorial.html?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/site/tutorial.html (original)
+++ lucene/dev/branches/docvalues/solr/site/tutorial.html Wed Feb 9 09:35:27 2011
@@ -5,7 +5,7 @@
<meta content="Apache Forrest" name="Generator">
<meta name="Forrest-version" content="0.8">
<meta name="Forrest-skin-name" content="lucene">
-<title>Solr tutorial (version 3.0.0.2010.07.10.11.10.25)</title>
+<title>Solr tutorial (version 4.0.0.2011.01.04.00.08.44)</title>
<link type="text/css" href="skin/basic.css" rel="stylesheet">
<link media="screen" type="text/css" href="skin/screen.css" rel="stylesheet">
<link media="print" type="text/css" href="skin/print.css" rel="stylesheet">
@@ -48,12 +48,12 @@
|start Search
+-->
<div class="searchbox">
-<form action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
+<form id="searchform" action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
<input onFocus="getBlank (this, 'Search the site with Solr');" size="25" name="q" id="query" type="text" value="Search the site with Solr">
- <input name="Search" value="Search" type="submit">
+ <input onclick="selectProvider(this.form)" name="Search" value="Search" type="submit">
+ @
+ <select id="searchProvider" name="searchProvider"><option value="any">select provider</option><option value="lucid">Lucid Find</option><option value="sl">Search-Lucene</option></select>
</form>
-<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
-</div>
</div>
<!--+
|end search
@@ -155,9 +155,46 @@ document.write("Last Published: " + docu
<a href="http://lucene.apache.org/nutch/">Nutch</a>
</div>
</div>
+<script type="text/javascript">
+ function selectProvider(form) {
+ provider = form.elements['searchProvider'].value;
+ if (provider == "any") {
+ if (Math.random() > 0.5) {
+ provider = "lucid";
+ } else {
+ provider = "sl";
+ }
+ }
+
+ if (provider == "lucid") {
+ form.action = "http://search.lucidimagination.com/p:solr";
+ } else if (provider == "sl") {
+ form.action = "http://search-lucene.com/solr";
+ }
+
+ days = 365; // cookie will be valid for a year
+ date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ expires = "; expires=" + date.toGMTString();
+ document.cookie = "searchProvider=" + provider + expires + "; path=/";
+ }
+
+ if (document.cookie.length>0) {
+ cStart=document.cookie.indexOf("searchProvider=");
+ if (cStart!=-1) {
+ cStart=cStart + "searchProvider=".length;
+ cEnd=document.cookie.indexOf(";", cStart);
+ if (cEnd==-1) {
+ cEnd=document.cookie.length;
+ }
+ provider = unescape(document.cookie.substring(cStart,cEnd));
+ document.forms['searchform'].elements['searchProvider'].value = provider;
+ }
+ }
+ </script>
<div id="credit">
<hr>
- This document is for Apache Solr version 3.0.0.2010.07.10.11.10.25. If you are using a different version of Solr, please consult the documentation that was distributed with the version you are using.
+ This document is for Apache Solr version 4.0.0.2011.01.04.00.08.44. If you are using a different version of Solr, please consult the documentation that was distributed with the version you are using.
</div>
<div id="roundbottom">
<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
@@ -181,7 +218,7 @@ document.write("Last Published: " + docu
</div>
<h1>Solr tutorial</h1>
<div id="motd-area">
- This document is for Apache Solr version 3.0.0.2010.07.10.11.10.25. If you are using a different version of Solr, please consult the documentation that was distributed with the version you are using.
+ This document is for Apache Solr version 4.0.0.2011.01.04.00.08.44. If you are using a different version of Solr, please consult the documentation that was distributed with the version you are using.
</div>
<div id="minitoc-area">
<ul class="minitoc">
@@ -252,14 +289,14 @@ To follow along with this tutorial, you
</p>
<ol>
-<li>Java 1.5 or greater. Some places you can get it are from
+<li>Java 1.6 or greater. Some places you can get it are from
<a href="http://java.sun.com/j2se/downloads.html">OpenJDK</a>,
<a href="http://java.sun.com/j2se/downloads.html">Sun</a>,
<a href="http://www.ibm.com/developerworks/java/jdk/">IBM</a>, or
<a href="http://www.oracle.com/technology/products/jrockit/index.html">Oracle</a>.
<br>
Running <span class="codefrag">java -version</span> at the command line should indicate a version
- number starting with 1.5. Gnu's GCJ is not supported and does not work with Solr.
+ number starting with 1.6. Gnu's GCJ is not supported and does not work with Solr.
</li>
<li>A <a href="http://www.apache.org/dyn/closer.cgi/lucene/solr/">Solr release</a>.
Modified: lucene/dev/branches/docvalues/solr/site/tutorial.pdf
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/site/tutorial.pdf?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
Binary files - no diff available.
Modified: lucene/dev/branches/docvalues/solr/site/version_control.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/site/version_control.html?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/site/version_control.html (original)
+++ lucene/dev/branches/docvalues/solr/site/version_control.html Wed Feb 9 09:35:27 2011
@@ -48,12 +48,12 @@
|start Search
+-->
<div class="searchbox">
-<form action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
+<form id="searchform" action="http://search.lucidimagination.com/p:solr" method="get" class="roundtopsmall">
<input onFocus="getBlank (this, 'Search the site with Solr');" size="25" name="q" id="query" type="text" value="Search the site with Solr">
- <input name="Search" value="Search" type="submit">
+ <input onclick="selectProvider(this.form)" name="Search" value="Search" type="submit">
+ @
+ <select id="searchProvider" name="searchProvider"><option value="any">select provider</option><option value="lucid">Lucid Find</option><option value="sl">Search-Lucene</option></select>
</form>
-<div style="position: relative; top: -5px; left: -10px">Powered by <a href="http://www.lucidimagination.com" style="color: #033268">Lucid Imagination</a>
-</div>
</div>
<!--+
|end search
@@ -155,6 +155,43 @@ document.write("Last Published: " + docu
<a href="http://lucene.apache.org/nutch/">Nutch</a>
</div>
</div>
+<script type="text/javascript">
+ function selectProvider(form) {
+ provider = form.elements['searchProvider'].value;
+ if (provider == "any") {
+ if (Math.random() > 0.5) {
+ provider = "lucid";
+ } else {
+ provider = "sl";
+ }
+ }
+
+ if (provider == "lucid") {
+ form.action = "http://search.lucidimagination.com/p:solr";
+ } else if (provider == "sl") {
+ form.action = "http://search-lucene.com/solr";
+ }
+
+ days = 365; // cookie will be valid for a year
+ date = new Date();
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+ expires = "; expires=" + date.toGMTString();
+ document.cookie = "searchProvider=" + provider + expires + "; path=/";
+ }
+
+ if (document.cookie.length>0) {
+ cStart=document.cookie.indexOf("searchProvider=");
+ if (cStart!=-1) {
+ cStart=cStart + "searchProvider=".length;
+ cEnd=document.cookie.indexOf(";", cStart);
+ if (cEnd==-1) {
+ cEnd=document.cookie.length;
+ }
+ provider = unescape(document.cookie.substring(cStart,cEnd));
+ document.forms['searchform'].elements['searchProvider'].value = provider;
+ }
+ }
+ </script>
<div id="credit"></div>
<div id="roundbottom">
<img style="display: none" class="corner" height="15" width="15" alt="" src="skin/images/rc-b-l-15-1body-2menu-3menu.png"></div>
Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/SolrDocument.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/SolrDocument.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/SolrDocument.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/SolrDocument.java Wed Feb 9 09:35:27 2011
@@ -220,6 +220,7 @@ public class SolrDocument implements Map
public Collection<Collection<Object>> values() {throw new UnsupportedOperationException();}
public Collection<Object> put(String key, Collection<Object> value) {throw new UnsupportedOperationException();}
public Collection<Object> remove(Object key) {throw new UnsupportedOperationException();}
+ @Override
public String toString() {return _fields.toString();}
};
}
@@ -248,6 +249,7 @@ public class SolrDocument implements Map
public Collection<Object> values() {throw new UnsupportedOperationException();}
public Collection<Object> put(String key, Object value) {throw new UnsupportedOperationException();}
public Collection<Object> remove(Object key) {throw new UnsupportedOperationException();}
+ @Override
public String toString() {return _fields.toString();}
};
}
Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/SolrDocumentList.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/SolrDocumentList.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/SolrDocumentList.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/SolrDocumentList.java Wed Feb 9 09:35:27 2011
@@ -57,6 +57,7 @@ public class SolrDocumentList extends Ar
this.start = start;
}
+ @Override
public String toString() {
return "{numFound="+numFound
+",start="+start
Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/cloud/CloudState.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/cloud/CloudState.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/cloud/CloudState.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/cloud/CloudState.java Wed Feb 9 09:35:27 2011
@@ -140,6 +140,7 @@ public class CloudState {
return liveNodesSet;
}
+ @Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("live nodes:" + liveNodes);
Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/cloud/SolrZkClient.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/cloud/SolrZkClient.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/cloud/SolrZkClient.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/cloud/SolrZkClient.java Wed Feb 9 09:35:27 2011
@@ -74,7 +74,6 @@ public class SolrZkClient {
* @param zkClientTimeout
* @param strat
* @param onReconnect
- * @param clientConnectTimeout
* @throws InterruptedException
* @throws TimeoutException
* @throws IOException
@@ -164,7 +163,7 @@ public class SolrZkClient {
/**
* @param path
- * @return
+ * @return true if path exists
* @throws KeeperException
* @throws InterruptedException
*/
@@ -178,7 +177,7 @@ public class SolrZkClient {
* @param data
* @param acl
* @param createMode
- * @return
+ * @return path of created node
* @throws KeeperException
* @throws InterruptedException
*/
@@ -190,7 +189,7 @@ public class SolrZkClient {
/**
* @param path
* @param watcher
- * @return
+ * @return children of the node at the path
* @throws KeeperException
* @throws InterruptedException
*/
@@ -203,7 +202,7 @@ public class SolrZkClient {
* @param path
* @param watcher
* @param stat
- * @return
+ * @return node's data
* @throws KeeperException
* @throws InterruptedException
*/
@@ -216,7 +215,7 @@ public class SolrZkClient {
* @param path
* @param data
* @param version
- * @return
+ * @return node's state
* @throws KeeperException
* @throws InterruptedException
*/
@@ -229,8 +228,8 @@ public class SolrZkClient {
*
* @param path
* @param data
- * @param watcher
- * @return
+ * @param createMode
+ * @return path of created node
* @throws KeeperException
* @throws InterruptedException
*/
Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/cloud/ZkNodeProps.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/cloud/ZkNodeProps.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/cloud/ZkNodeProps.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/cloud/ZkNodeProps.java Wed Feb 9 09:35:27 2011
@@ -46,6 +46,7 @@ public class ZkNodeProps extends HashMap
return sb.toString().getBytes("UTF-8");
}
+ @Override
public String toString() {
StringBuilder sb = new StringBuilder();
Set<Entry<String,String>> entries = entrySet();
Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/params/FacetParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/params/FacetParams.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/params/FacetParams.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/params/FacetParams.java Wed Feb 9 09:35:27 2011
@@ -228,7 +228,6 @@ public interface FacetParams {
* String indicating what "other" ranges should be computed for a
* numerical range facet (multi-value).
* Can be overriden on a per field basis.
- * @see FacetNumberOther
*/
public static final String FACET_RANGE_OTHER = FACET_RANGE + ".other";
/**
@@ -270,6 +269,7 @@ public interface FacetParams {
*/
public enum FacetRangeOther {
BEFORE, AFTER, BETWEEN, ALL, NONE;
+ @Override
public String toString() { return super.toString().toLowerCase(); }
public static FacetRangeOther get(String label) {
try {
@@ -288,6 +288,7 @@ public interface FacetParams {
@Deprecated
public enum FacetDateOther {
BEFORE, AFTER, BETWEEN, ALL, NONE;
+ @Override
public String toString() { return super.toString().toLowerCase(); }
public static FacetDateOther get(String label) {
try {
@@ -321,6 +322,7 @@ public interface FacetParams {
*/
public enum FacetRangeInclude {
ALL, LOWER, UPPER, EDGE, OUTER;
+ @Override
public String toString() { return super.toString().toLowerCase(Locale.ENGLISH); }
public static FacetRangeInclude get(String label) {
try {
Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/params/QueryElevationParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/params/QueryElevationParams.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/params/QueryElevationParams.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/params/QueryElevationParams.java Wed Feb 9 09:35:27 2011
@@ -1,5 +1,22 @@
package org.apache.solr.common.params;
+/**
+ * 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.
+ */
+
/**
* Parameters used with the QueryElevationComponent
Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/ConcurrentLRUCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/ConcurrentLRUCache.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/ConcurrentLRUCache.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/ConcurrentLRUCache.java Wed Feb 9 09:35:27 2011
@@ -20,6 +20,8 @@ import org.apache.lucene.util.PriorityQu
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.util.Arrays;
+import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeSet;
@@ -131,6 +133,7 @@ public class ConcurrentLRUCache<K,V> {
if (currentSize > upperWaterMark && !isCleaning) {
if (newThreadForCleanup) {
new Thread() {
+ @Override
public void run() {
markAndSweep();
}
@@ -182,6 +185,7 @@ public class ConcurrentLRUCache<K,V> {
int wantToKeep = lowerWaterMark;
int wantToRemove = sz - lowerWaterMark;
+ @SuppressWarnings("unchecked") // generic array's are anoying
CacheEntry<K,V>[] eset = new CacheEntry[sz];
int eSize = 0;
@@ -280,7 +284,7 @@ public class ConcurrentLRUCache<K,V> {
wantToKeep = lowerWaterMark - numKept;
wantToRemove = sz - lowerWaterMark - numRemoved;
- PQueue queue = new PQueue(wantToRemove);
+ PQueue<K,V> queue = new PQueue<K,V>(wantToRemove);
for (int i=eSize-1; i>=0; i--) {
CacheEntry<K,V> ce = eset[i];
@@ -331,9 +335,8 @@ public class ConcurrentLRUCache<K,V> {
// Now delete everything in the priority queue.
// avoid using pop() since order doesn't matter anymore
- for (Object o : queue.getValues()) {
- if (o==null) continue;
- CacheEntry<K,V> ce = (CacheEntry)o;
+ for (CacheEntry<K,V> ce : queue.getValues()) {
+ if (ce==null) continue;
evictEntry(ce.key);
numRemoved++;
}
@@ -349,27 +352,30 @@ public class ConcurrentLRUCache<K,V> {
}
}
- private static class PQueue extends PriorityQueue {
+ private static class PQueue<K,V> extends PriorityQueue<CacheEntry<K,V>> {
int myMaxSize;
PQueue(int maxSz) {
super.initialize(maxSz);
myMaxSize = maxSz;
}
- Object[] getValues() { return heap; }
+ Iterable<CacheEntry<K,V>> getValues() {
+ return Collections.unmodifiableCollection(Arrays.asList(heap));
+ }
- protected boolean lessThan(Object a, Object b) {
+ @Override
+ protected boolean lessThan(CacheEntry a, CacheEntry b) {
// reverse the parameter order so that the queue keeps the oldest items
- return ((CacheEntry)b).lastAccessedCopy < ((CacheEntry)a).lastAccessedCopy;
+ return b.lastAccessedCopy < a.lastAccessedCopy;
}
// necessary because maxSize is private in base class
- public Object myInsertWithOverflow(Object element) {
+ public CacheEntry<K,V> myInsertWithOverflow(CacheEntry<K,V> element) {
if (size() < myMaxSize) {
add(element);
return null;
} else if (size() > 0 && !lessThan(element, heap[1])) {
- Object ret = heap[1];
+ CacheEntry<K,V> ret = heap[1];
heap[1] = element;
updateTop();
return ret;
@@ -400,11 +406,11 @@ public class ConcurrentLRUCache<K,V> {
Map<K, V> result = new LinkedHashMap<K, V>();
if (n <= 0)
return result;
- TreeSet<CacheEntry> tree = new TreeSet<CacheEntry>();
+ TreeSet<CacheEntry<K,V>> tree = new TreeSet<CacheEntry<K,V>>();
markAndSweepLock.lock();
try {
for (Map.Entry<Object, CacheEntry<K,V>> entry : map.entrySet()) {
- CacheEntry ce = entry.getValue();
+ CacheEntry<K,V> ce = entry.getValue();
ce.lastAccessedCopy = ce.lastAccessed;
if (tree.size() < n) {
tree.add(ce);
@@ -418,7 +424,7 @@ public class ConcurrentLRUCache<K,V> {
} finally {
markAndSweepLock.unlock();
}
- for (CacheEntry<K, V> e : tree) {
+ for (CacheEntry<K,V> e : tree) {
result.put(e.key, e.value);
}
return result;
@@ -428,7 +434,7 @@ public class ConcurrentLRUCache<K,V> {
Map<K,V> result = new LinkedHashMap<K,V>();
if (n <= 0)
return result;
- TreeSet<CacheEntry> tree = new TreeSet<CacheEntry>();
+ TreeSet<CacheEntry<K,V>> tree = new TreeSet<CacheEntry<K,V>>();
// we need to grab the lock since we are changing lastAccessedCopy
markAndSweepLock.lock();
try {
@@ -487,14 +493,17 @@ public class ConcurrentLRUCache<K,V> {
return this.lastAccessedCopy < that.lastAccessedCopy ? 1 : -1;
}
+ @Override
public int hashCode() {
return value.hashCode();
}
+ @Override
public boolean equals(Object obj) {
return value.equals(obj);
}
+ @Override
public String toString() {
return "key: " + key + " value: " + value + " lastAccessed:" + lastAccessed;
}
@@ -575,6 +584,7 @@ public class ConcurrentLRUCache<K,V> {
cache = new WeakReference<ConcurrentLRUCache>(c);
}
+ @Override
public void run() {
while (true) {
synchronized (this) {
@@ -604,6 +614,7 @@ public class ConcurrentLRUCache<K,V> {
}
}
+ @Override
protected void finalize() throws Throwable {
try {
if(!isDestroyed){
Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/FastOutputStream.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/FastOutputStream.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/FastOutputStream.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/FastOutputStream.java Wed Feb 9 09:35:27 2011
@@ -50,6 +50,7 @@ public class FastOutputStream extends Ou
write((byte)b);
}
+ @Override
public void write(byte b[]) throws IOException {
write(b,0,b.length);
}
Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java Wed Feb 9 09:35:27 2011
@@ -96,15 +96,16 @@ public class JavaBinCodec {
FastInputStream dis = FastInputStream.wrap(is);
version = dis.readByte();
if (version != VERSION) {
- throw new RuntimeException("Invalid version or the data in not in 'javabin' format");
+ throw new RuntimeException("Invalid version (expected " + VERSION +
+ ", but " + version + ") or the data in not in 'javabin' format");
}
return readVal(dis);
}
- public SimpleOrderedMap readOrderedMap(FastInputStream dis) throws IOException {
+ public SimpleOrderedMap<Object> readOrderedMap(FastInputStream dis) throws IOException {
int sz = readSize(dis);
- SimpleOrderedMap nl = new SimpleOrderedMap();
+ SimpleOrderedMap<Object> nl = new SimpleOrderedMap<Object>();
for (int i = 0; i < sz; i++) {
String name = (String) readVal(dis);
Object val = readVal(dis);
@@ -113,9 +114,9 @@ public class JavaBinCodec {
return nl;
}
- public NamedList readNamedList(FastInputStream dis) throws IOException {
+ public NamedList<Object> readNamedList(FastInputStream dis) throws IOException {
int sz = readSize(dis);
- NamedList nl = new NamedList();
+ NamedList<Object> nl = new NamedList<Object>();
for (int i = 0; i < sz; i++) {
String name = (String) readVal(dis);
Object val = readVal(dis);
@@ -124,7 +125,7 @@ public class JavaBinCodec {
return nl;
}
- public void writeNamedList(NamedList nl) throws IOException {
+ public void writeNamedList(NamedList<?> nl) throws IOException {
writeTag(nl instanceof SimpleOrderedMap ? ORDERED_MAP : NAMED_LST, nl.size());
for (int i = 0; i < nl.size(); i++) {
String name = nl.getName(i);
@@ -218,7 +219,7 @@ public class JavaBinCodec {
public boolean writeKnownType(Object val) throws IOException {
if (writePrimitive(val)) return true;
if (val instanceof NamedList) {
- writeNamedList((NamedList) val);
+ writeNamedList((NamedList<?>) val);
return true;
}
if (val instanceof SolrDocumentList) { // SolrDocumentList is a List, so must come before List check
@@ -336,7 +337,8 @@ public class JavaBinCodec {
solrDocs.setStart((Long) list.get(1));
solrDocs.setMaxScore((Float) list.get(2));
- List l = (List) readVal(dis);
+ @SuppressWarnings("unchecked")
+ List<SolrDocument> l = (List<SolrDocument>) readVal(dis);
solrDocs.addAll(l);
return solrDocs;
}
@@ -344,7 +346,7 @@ public class JavaBinCodec {
public void writeSolrDocumentList(SolrDocumentList docs)
throws IOException {
writeTag(SOLRDOCLST);
- List l = new ArrayList(3);
+ List<Number> l = new ArrayList<Number>(3);
l.add(docs.getNumFound());
l.add(docs.getStart());
l.add(docs.getMaxScore());
@@ -352,10 +354,10 @@ public class JavaBinCodec {
writeArray(docs);
}
- public Map readMap(FastInputStream dis)
+ public Map<Object,Object> readMap(FastInputStream dis)
throws IOException {
int sz = readVInt(dis);
- Map m = new LinkedHashMap();
+ Map<Object,Object> m = new LinkedHashMap<Object,Object>();
for (int i = 0; i < sz; i++) {
Object key = readVal(dis);
Object val = readVal(dis);
@@ -373,8 +375,8 @@ public class JavaBinCodec {
writeVal(END_OBJ);
}
- public List readIterator(FastInputStream fis) throws IOException {
- ArrayList l = new ArrayList();
+ public List<Object> readIterator(FastInputStream fis) throws IOException {
+ ArrayList<Object> l = new ArrayList<Object>();
while (true) {
Object o = readVal(fis);
if (o == END_OBJ) break;
@@ -406,9 +408,9 @@ public class JavaBinCodec {
}
}
- public List readArray(FastInputStream dis) throws IOException {
+ public List<Object> readArray(FastInputStream dis) throws IOException {
int sz = readSize(dis);
- ArrayList l = new ArrayList(sz);
+ ArrayList<Object> l = new ArrayList<Object>(sz);
for (int i = 0; i < sz; i++) {
l.add(readVal(dis));
}
@@ -603,10 +605,9 @@ public class JavaBinCodec {
}
- public void writeMap(Map val)
- throws IOException {
+ public void writeMap(Map<?,?> val) throws IOException {
writeTag(MAP, val.size());
- for (Map.Entry entry : (Set<Map.Entry>) val.entrySet()) {
+ for (Map.Entry<?,?> entry : val.entrySet()) {
Object key = entry.getKey();
if (key instanceof String) {
writeExternString((String) key);
Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/NamedList.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/NamedList.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/NamedList.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/NamedList.java Wed Feb 9 09:35:27 2011
@@ -50,11 +50,11 @@ import java.io.Serializable;
* @version $Id$
*/
public class NamedList<T> implements Cloneable, Serializable, Iterable<Map.Entry<String,T>> {
- protected final List nvPairs;
+ protected final List<Object> nvPairs;
/** Creates an empty instance */
public NamedList() {
- nvPairs = new ArrayList();
+ nvPairs = new ArrayList<Object>();
}
@@ -88,7 +88,7 @@ public class NamedList<T> implements Clo
* @deprecated Use {@link #NamedList(java.util.Map.Entry[])} for the NamedList instantiation
*/
@Deprecated
- public NamedList(List nameValuePairs) {
+ public NamedList(List<Object> nameValuePairs) {
nvPairs=nameValuePairs;
}
@@ -104,8 +104,8 @@ public class NamedList<T> implements Clo
* @see https://issues.apache.org/jira/browse/SOLR-912
*/
@Deprecated
- private List nameValueMapToList(Map.Entry<String, ? extends T>[] nameValuePairs) {
- List result = new ArrayList();
+ private List<Object> nameValueMapToList(Map.Entry<String, ? extends T>[] nameValuePairs) {
+ List<Object> result = new ArrayList<Object>();
for (Map.Entry<String, ?> ent : nameValuePairs) {
result.add(ent.getKey());
result.add(ent.getValue());
@@ -158,6 +158,7 @@ public class NamedList<T> implements Clo
*/
public T setVal(int idx, T val) {
int index = (idx<<1)+1;
+ @SuppressWarnings("unchecked")
T old = (T)nvPairs.get( index );
nvPairs.set(index, val);
return old;
@@ -170,7 +171,9 @@ public class NamedList<T> implements Clo
public T remove(int idx) {
int index = (idx<<1);
nvPairs.remove(index);
- return (T)nvPairs.remove(index); // same index, as things shifted in previous remove
+ @SuppressWarnings("unchecked")
+ T result = (T)nvPairs.remove(index); // same index, as things shifted in previous remove
+ return result;
}
/**
@@ -243,6 +246,7 @@ public class NamedList<T> implements Clo
return result;
}
+ @Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append('{');
@@ -314,8 +318,9 @@ public class NamedList<T> implements Clo
/**
* Makes a <i>shallow copy</i> of the named list.
*/
+ @Override
public NamedList<T> clone() {
- ArrayList newList = new ArrayList(nvPairs.size());
+ ArrayList<Object> newList = new ArrayList<Object>(nvPairs.size());
newList.addAll(nvPairs);
return new NamedList<T>(newList);
}
@@ -330,7 +335,7 @@ public class NamedList<T> implements Clo
*/
public Iterator<Map.Entry<String,T>> iterator() {
- final NamedList list = this;
+ final NamedList<T> list = this;
Iterator<Map.Entry<String,T>> iter = new Iterator<Map.Entry<String,T>>() {
@@ -349,16 +354,17 @@ public class NamedList<T> implements Clo
@SuppressWarnings("unchecked")
public T getValue() {
- return (T)list.getVal( index );
+ return list.getVal( index );
}
+ @Override
public String toString()
{
return getKey()+"="+getValue();
}
public T setValue(T value) {
- return (T) list.setVal(index, value);
+ return list.setVal(index, value);
}
};
return nv;
Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/RegexFileFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/RegexFileFilter.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/RegexFileFilter.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/RegexFileFilter.java Wed Feb 9 09:35:27 2011
@@ -37,6 +37,7 @@ public final class RegexFileFilter imple
public boolean accept(File f) {
return pattern.matcher(f.getName()).matches();
}
+ @Override
public String toString() {
return "regex:" + pattern.toString();
}
Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/SimpleOrderedMap.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/SimpleOrderedMap.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/SimpleOrderedMap.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/SimpleOrderedMap.java Wed Feb 9 09:35:27 2011
@@ -50,7 +50,7 @@ public class SimpleOrderedMap<T> extends
* @param nameValuePairs underlying List which should be used to implement a SimpleOrderedMap; modifying this List will affect the SimpleOrderedMap.
*/
@Deprecated
- public SimpleOrderedMap(List nameValuePairs) {
+ public SimpleOrderedMap(List<Object> nameValuePairs) {
super(nameValuePairs);
}
@@ -60,7 +60,7 @@ public class SimpleOrderedMap<T> extends
@Override
public SimpleOrderedMap<T> clone() {
- ArrayList newList = new ArrayList(nvPairs.size());
+ ArrayList<Object> newList = new ArrayList<Object>(nvPairs.size());
newList.addAll(nvPairs);
return new SimpleOrderedMap<T>(newList);
}
Modified: lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/StrUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/StrUtils.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/StrUtils.java (original)
+++ lucene/dev/branches/docvalues/solr/src/common/org/apache/solr/common/util/StrUtils.java Wed Feb 9 09:35:27 2011
@@ -242,7 +242,7 @@ public class StrUtils {
* {@link NullPointerException} and {@link SolrException} free version of {@link #parseBool(String)}
* @param s
* @param def
- * @return
+ * @return parsed boolean value (or def, if s is null or invalid)
*/
public static boolean parseBool(String s, boolean def) {
if( s != null ) {
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ArabicLetterTokenizerFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ArabicLetterTokenizerFactory.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ArabicLetterTokenizerFactory.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ArabicLetterTokenizerFactory.java Wed Feb 9 09:35:27 2011
@@ -19,6 +19,7 @@ package org.apache.solr.analysis;
import org.apache.lucene.analysis.ar.ArabicLetterTokenizer;
import java.io.Reader;
+import java.util.Map;
/**
@@ -28,8 +29,14 @@ import java.io.Reader;
@Deprecated
public class ArabicLetterTokenizerFactory extends BaseTokenizerFactory{
- public ArabicLetterTokenizer create(Reader input) {
+ @Override
+ public void init(Map<String,String> args) {
+ super.init(args);
assureMatchVersion();
+ warnDeprecated("Use StandardTokenizerFactory instead.");
+ }
+
+ public ArabicLetterTokenizer create(Reader input) {
return new ArabicLetterTokenizer(luceneMatchVersion, input);
}
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/BaseTokenStreamFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/BaseTokenStreamFactory.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/BaseTokenStreamFactory.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/BaseTokenStreamFactory.java Wed Feb 9 09:35:27 2011
@@ -30,6 +30,8 @@ import org.apache.lucene.analysis.core.S
import org.apache.lucene.analysis.util.CharArraySet;
import org.apache.lucene.util.Version;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Simple abstract implementation that handles init arg processing, is not really
@@ -45,6 +47,8 @@ abstract class BaseTokenStreamFactory {
/** the luceneVersion arg */
protected Version luceneMatchVersion = null;
+ public static final Logger log = LoggerFactory.getLogger(BaseTokenStreamFactory.class);
+
public void init(Map<String,String> args) {
this.args=args;
String matchVersion = args.get(IndexSchema.LUCENE_MATCH_VERSION_PARAM);
@@ -64,9 +68,17 @@ abstract class BaseTokenStreamFactory {
if (luceneMatchVersion == null) {
throw new RuntimeException("Configuration Error: Factory '" + this.getClass().getName() +
"' needs a 'luceneMatchVersion' parameter");
+ } else if (!luceneMatchVersion.onOrAfter(Version.LUCENE_40)) {
+ log.warn(getClass().getSimpleName() + " is using deprecated " + luceneMatchVersion +
+ " emulation. You should at some point declare and reindex to at least 4.0, because " +
+ "3.x emulation is deprecated and will be removed in 5.0");
}
}
+ protected final void warnDeprecated(String message) {
+ log.warn(getClass().getSimpleName() + " is deprecated. " + message);
+ }
+
// TODO: move these somewhere that tokenizers and others
// can also use them...
protected int getInt(String name) {
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ChineseFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ChineseFilterFactory.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ChineseFilterFactory.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ChineseFilterFactory.java Wed Feb 9 09:35:27 2011
@@ -18,6 +18,8 @@
package org.apache.solr.analysis;
+import java.util.Map;
+
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.cn.ChineseFilter;
@@ -27,6 +29,12 @@ import org.apache.lucene.analysis.cn.Chi
*/
@Deprecated
public class ChineseFilterFactory extends BaseTokenFilterFactory {
+ @Override
+ public void init(Map<String,String> args) {
+ super.init(args);
+ warnDeprecated("Use StopFilterFactory instead.");
+ }
+
public ChineseFilter create(TokenStream in) {
return new ChineseFilter(in);
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ChineseTokenizerFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ChineseTokenizerFactory.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ChineseTokenizerFactory.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/ChineseTokenizerFactory.java Wed Feb 9 09:35:27 2011
@@ -20,6 +20,8 @@
package org.apache.solr.analysis;
import java.io.Reader;
+import java.util.Map;
+
import org.apache.lucene.analysis.cn.ChineseTokenizer;
/**
@@ -28,6 +30,12 @@ import org.apache.lucene.analysis.cn.Chi
*/
@Deprecated
public class ChineseTokenizerFactory extends BaseTokenizerFactory {
+ @Override
+ public void init(Map<String,String> args) {
+ super.init(args);
+ warnDeprecated("Use StandardTokenizerFactory instead.");
+ }
+
public ChineseTokenizer create(Reader in) {
return new ChineseTokenizer(in);
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/DictionaryCompoundWordTokenFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/DictionaryCompoundWordTokenFilterFactory.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/DictionaryCompoundWordTokenFilterFactory.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/DictionaryCompoundWordTokenFilterFactory.java Wed Feb 9 09:35:27 2011
@@ -36,6 +36,7 @@ public class DictionaryCompoundWordToken
private int minSubwordSize;
private int maxSubwordSize;
private boolean onlyLongestMatch;
+ @Override
public void init(Map<String, String> args) {
super.init(args);
assureMatchVersion();
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/HyphenationCompoundWordTokenFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/HyphenationCompoundWordTokenFilterFactory.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/HyphenationCompoundWordTokenFilterFactory.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/HyphenationCompoundWordTokenFilterFactory.java Wed Feb 9 09:35:27 2011
@@ -61,6 +61,7 @@ public class HyphenationCompoundWordToke
private int maxSubwordSize;
private boolean onlyLongestMatch;
+ @Override
public void init(Map<String, String> args) {
super.init(args);
assureMatchVersion();
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/IndonesianStemFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/IndonesianStemFilterFactory.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/IndonesianStemFilterFactory.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/IndonesianStemFilterFactory.java Wed Feb 9 09:35:27 2011
@@ -26,6 +26,7 @@ import org.apache.lucene.analysis.id.Ind
public class IndonesianStemFilterFactory extends BaseTokenFilterFactory {
private boolean stemDerivational = true;
+ @Override
public void init(Map<String, String> args) {
super.init(args);
stemDerivational = getBoolean("stemDerivational", true);
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/KeepWordFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/KeepWordFilterFactory.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/KeepWordFilterFactory.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/KeepWordFilterFactory.java Wed Feb 9 09:35:27 2011
@@ -23,22 +23,27 @@ import org.apache.lucene.analysis.TokenS
import org.apache.lucene.analysis.miscellaneous.KeepWordFilter;
import org.apache.lucene.analysis.util.CharArraySet;
+import java.util.Map;
import java.util.Set;
import java.io.IOException;
/**
* @version $Id$
- * @since solr 1.3
*/
public class KeepWordFilterFactory extends BaseTokenFilterFactory implements ResourceLoaderAware {
- private CharArraySet words;
- private boolean ignoreCase;
+ @Override
+ public void init(Map<String,String> args) {
+ super.init(args);
+ assureMatchVersion();
+ }
public void inform(ResourceLoader loader) {
String wordFiles = args.get("words");
ignoreCase = getBoolean("ignoreCase", false);
- if (wordFiles != null) {
+ enablePositionIncrements = getBoolean("enablePositionIncrements",false);
+
+ if (wordFiles != null) {
try {
words = getWordSet(loader, wordFiles, ignoreCase);
} catch (IOException e) {
@@ -47,6 +52,10 @@ public class KeepWordFilterFactory exten
}
}
+ private CharArraySet words;
+ private boolean ignoreCase;
+ private boolean enablePositionIncrements;
+
/**
* Set the keep word list.
* NOTE: if ignoreCase==true, the words are expected to be lowercase
@@ -62,15 +71,19 @@ public class KeepWordFilterFactory exten
this.ignoreCase = ignoreCase;
}
- public KeepWordFilter create(TokenStream input) {
- return new KeepWordFilter(input, words);
+ public boolean isEnablePositionIncrements() {
+ return enablePositionIncrements;
+ }
+
+ public boolean isIgnoreCase() {
+ return ignoreCase;
}
public CharArraySet getWords() {
return words;
}
- public boolean isIgnoreCase() {
- return ignoreCase;
+ public KeepWordFilter create(TokenStream input) {
+ return new KeepWordFilter(enablePositionIncrements, input, words);
}
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/LengthFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/LengthFilterFactory.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/LengthFilterFactory.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/LengthFilterFactory.java Wed Feb 9 09:35:27 2011
@@ -27,6 +27,7 @@ import java.util.Map;
*/
public class LengthFilterFactory extends BaseTokenFilterFactory {
int min,max;
+ boolean enablePositionIncrements;
public static final String MIN_KEY = "min";
public static final String MAX_KEY = "max";
@@ -35,8 +36,10 @@ public class LengthFilterFactory extends
super.init(args);
min=Integer.parseInt(args.get(MIN_KEY));
max=Integer.parseInt(args.get(MAX_KEY));
+ enablePositionIncrements = getBoolean("enablePositionIncrements",false);
}
+
public LengthFilter create(TokenStream input) {
- return new LengthFilter(input,min,max);
+ return new LengthFilter(enablePositionIncrements, input,min,max);
}
}
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/NumericPayloadTokenFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/NumericPayloadTokenFilterFactory.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/NumericPayloadTokenFilterFactory.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/NumericPayloadTokenFilterFactory.java Wed Feb 9 09:35:27 2011
@@ -27,6 +27,7 @@ import java.util.Map;
public class NumericPayloadTokenFilterFactory extends BaseTokenFilterFactory {
private float payload;
private String typeMatch;
+ @Override
public void init(Map<String, String> args) {
super.init(args);
payload = Float.parseFloat(args.get("payload"));
Modified: lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/PatternReplaceCharFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/PatternReplaceCharFilterFactory.java?rev=1068809&r1=1068808&r2=1068809&view=diff
==============================================================================
--- lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/PatternReplaceCharFilterFactory.java (original)
+++ lucene/dev/branches/docvalues/solr/src/java/org/apache/solr/analysis/PatternReplaceCharFilterFactory.java Wed Feb 9 09:35:27 2011
@@ -36,6 +36,7 @@ public class PatternReplaceCharFilterFac
private int maxBlockChars;
private String blockDelimiters;
+ @Override
public void init(Map<String, String> args) {
super.init( args );
try {