You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2011/05/09 15:19:39 UTC
svn commit: r1101016 [8/10] - in /lucene/dev/branches/bulkpostings: ./
dev-tools/ dev-tools/eclipse/ dev-tools/idea/.idea/libraries/
dev-tools/idea/solr/ dev-tools/maven/lucene/contrib/ant/
dev-tools/maven/lucene/contrib/db/bdb-je/ dev-tools/maven/luce...
Modified: lucene/dev/branches/bulkpostings/solr/site/features.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/site/features.html?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/site/features.html (original)
+++ lucene/dev/branches/bulkpostings/solr/site/features.html Mon May 9 13:19:28 2011
@@ -130,6 +130,9 @@ document.write("Last Published: " + docu
<div class="menuitem">
<a href="api/solrj/index.html">SolrJ Javadoc</a>
</div>
+<div class="menuitem">
+<a href="api/test-framework/index.html">Test Framework Javadoc</a>
+</div>
</div>
<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Resources</div>
<div id="menu_1.3" class="menuitemgroup">
@@ -253,7 +256,7 @@ document.write("Last Published: " + docu
<h2 class="boxed">Solr in a Nutshell</h2>
<div class="section">
<p>
- Solr is a standalone enterprise search server with a web-services like API. You put documents in it (called "indexing") via XML over HTTP. You query it via HTTP GET and receive XML results.
+ Solr is a standalone enterprise search server with a REST-like API. You put documents in it (called "indexing") via XML, JSON or binary over HTTP. You query it via HTTP GET and receive XML, JSON, or binary results.
</p>
<ul>
@@ -288,6 +291,8 @@ document.write("Last Published: " + docu
<li> Faceted Search and Filtering </li>
+<li> Geospatial Search </li>
+
<li> Advanced, Configurable Text Analysis </li>
<li> Highly Configurable and User Extensible Caching </li>
@@ -304,22 +309,24 @@ document.write("Last Published: " + docu
<li> Highly Scalable Distributed search with sharded index across multiple hosts </li>
-<li> XML, CSV/delimited-text, and binary update formats </li>
+<li> JSON, XML, CSV/delimited-text, and binary update formats </li>
<li> Easy ways to pull in data from databases and XML files from local disk and HTTP sources </li>
<li> Rich Document Parsing and Indexing (PDF, Word, HTML, etc) using Apache Tika </li>
+<li> Apache UIMA integration for configurable metadata extraction </li>
+
<li> Multiple search indices </li>
</ul>
</div>
-<a name="N10069"></a><a name="Detailed+Features"></a>
+<a name="N1006F"></a><a name="Detailed+Features"></a>
<h2 class="boxed">Detailed Features</h2>
<div class="section">
-<a name="N1006F"></a><a name="Schema"></a>
+<a name="N10075"></a><a name="Schema"></a>
<h3 class="boxed">Schema</h3>
<ul>
@@ -340,19 +347,19 @@ document.write("Last Published: " + docu
<li>Many additional text analysis components including word splitting, regex and sounds-like filters</li>
</ul>
-<a name="N10090"></a><a name="Query"></a>
+<a name="N10096"></a><a name="Query"></a>
<h3 class="boxed">Query</h3>
<ul>
<li>HTTP interface with configurable response formats (XML/XSLT, JSON, Python, Ruby, PHP, Velocity, binary)</li>
-<li>Sort by any number of fields</li>
+<li>Sort by any number of fields, and by complex functions of numeric fields</li>
<li>Advanced DisMax query parser for high relevancy results from user-entered queries</li>
<li>Highlighted context snippets</li>
-<li>Faceted Searching based on unique field values, explicit queries, or date ranges</li>
+<li>Faceted Searching based on unique field values, explicit queries, date ranges, and numeric ranges</li>
<li>Multi-Select Faceting by tagging and selectively excluding filters</li>
@@ -373,14 +380,14 @@ document.write("Last Published: " + docu
<li>Combine queries derived from different syntaxes</li>
-<li>Auto-suggest functionality</li>
+<li>Auto-suggest functionality for completing user queries</li>
<li>Allow configuration of top results for a query, overriding normal scoring and sorting</li>
<li>Performance Optimizations</li>
</ul>
-<a name="N100CC"></a><a name="Core"></a>
+<a name="N100D2"></a><a name="Core"></a>
<h3 class="boxed">Core</h3>
<ul>
@@ -405,7 +412,7 @@ document.write("Last Published: " + docu
<li>"Luke" request handler for corpus information</li>
</ul>
-<a name="N100F3"></a><a name="Caching"></a>
+<a name="N100F9"></a><a name="Caching"></a>
<h3 class="boxed">Caching</h3>
<ul>
@@ -439,7 +446,7 @@ document.write("Last Published: " + docu
<li>User level caching with autowarming support</li>
</ul>
-<a name="N10118"></a><a name="Replication"></a>
+<a name="N1011E"></a><a name="Replication"></a>
<h3 class="boxed">Replication</h3>
<ul>
@@ -452,7 +459,7 @@ document.write("Last Published: " + docu
<li>Replication and automatic reloading of configuration files</li>
</ul>
-<a name="N1012D"></a><a name="Admin+Interface"></a>
+<a name="N10133"></a><a name="Admin+Interface"></a>
<h3 class="boxed">Admin Interface</h3>
<ul>
Modified: lucene/dev/branches/bulkpostings/solr/site/features.pdf
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/site/features.pdf?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
Binary files - no diff available.
Modified: lucene/dev/branches/bulkpostings/solr/site/index.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/site/index.html?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/site/index.html (original)
+++ lucene/dev/branches/bulkpostings/solr/site/index.html Mon May 9 13:19:28 2011
@@ -130,6 +130,9 @@ document.write("Last Published: " + docu
<div class="menuitem">
<a href="api/solrj/index.html">SolrJ Javadoc</a>
</div>
+<div class="menuitem">
+<a href="api/test-framework/index.html">Test Framework Javadoc</a>
+</div>
</div>
<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Resources</div>
<div id="menu_1.3" class="menuitemgroup">
@@ -229,6 +232,9 @@ document.write("Last Published: " + docu
<a href="#news">News</a>
<ul class="minitoc">
<li>
+<a href="#March+2011+-+Solr+3.1+Released">March 2011 - Solr 3.1 Released</a>
+</li>
+<li>
<a href="#25+June+2010+-+Solr+1.4.1+Released">25 June 2010 - Solr 1.4.1 Released</a>
</li>
<li>
@@ -294,8 +300,8 @@ document.write("Last Published: " + docu
Solr is the popular, blazing fast open source enterprise search
platform from the Apache Lucene project. Its major features include
powerful full-text search, hit highlighting, faceted search, dynamic
-clustering, database integration, and rich document (e.g., Word, PDF)
-handling. Solr is highly scalable, providing distributed search and
+clustering, database integration, rich document (e.g., Word, PDF)
+handling, and geospatial search. Solr is highly scalable, providing distributed search and
index replication, and it powers the search and navigation features of
many of the world's largest internet sites.
</p>
@@ -343,7 +349,55 @@ customization is required.
<a name="N10059"></a><a name="news"></a>
<h2 class="boxed">News</h2>
<div class="section">
-<a name="N1005F"></a><a name="25+June+2010+-+Solr+1.4.1+Released"></a>
+<a name="N1005F"></a><a name="March+2011+-+Solr+3.1+Released"></a>
+<h3 class="boxed">March 2011 - Solr 3.1 Released</h3>
+<p>The Lucene PMC is pleased to announce the release of <a href="http://www.apache.org/dyn/closer.cgi/lucene/solr">Apache Solr 3.1</a>!
+ </p>
+<p>
+ Solr's version number was synced with Lucene following the Lucene/Solr merge, so Solr 3.1 contains Lucene 3.1.
+ Solr 3.1 is the first release after Solr 1.4.1.
+ </p>
+<p>
+ Solr 3.1 release highlights include
+ </p>
+<ul>
+
+<li>
+<a href="http://wiki.apache.org/solr/SimpleFacetParameters#Facet_by_Range">Numeric range facets</a> (similar to date faceting).</li>
+
+<li>New <a href="http://wiki.apache.org/solr/SpatialSearch">spatial search</a>, including spatial filtering, boosting and sorting capabilities.</li>
+
+<li>Example Velocity driven search UI at <a href="http://localhost:8983/solr/browse">http://localhost:8983/solr/browse</a>
+</li>
+
+<li>A new faster <a href="http://wiki.apache.org/solr/HighlightingParameters">termvector-based highlighter</a>.</li>
+
+<li>Extended dismax (edismax) query parser with support for fielded queries, enhanced relevancy, and full lucene syntax support.</li>
+
+<li>Distributed search support for the <a href="http://wiki.apache.org/solr/SpellCheckComponent">Spell check</a>
+ and <a href="http://wiki.apache.org/solr/TermsComponent">Terms</a> components.</li>
+
+<li>
+<a href="http://wiki.apache.org/solr/Suggester">Suggester</a>, a fast trie-based autocomplete component.</li>
+
+<li>Sort results by any <a href="http://wiki.apache.org/solr/FunctionQuery#Sort_By_Function any function">function query</a>.</li>
+
+<li>
+<a href="http://wiki.apache.org/solr/UpdateJSON">JSON document indexing</a>.</li>
+
+<li>
+<a href="http://wiki.apache.org/solr/CSVResponseWriter">CSV response format</a>
+</li>
+
+<li>
+<a href="http://wiki.apache.org/solr/SolrUIMA">Apache UIMA integration</a> for metadata extraction.</li>
+
+<li>Tons of optimizations, bugfixes, and new analysis capabilities via <a href="http://lucene.apache.org/java/docs/index.html">Apache Lucene 3.1</a>.</li>
+
+</ul>
+<p>See the <a href="http://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_3_1/solr/CHANGES.txt">release notes</a> for a more complete list of all the new features, improvements, and bugfixes.
+ </p>
+<a name="N100CA"></a><a name="25+June+2010+-+Solr+1.4.1+Released"></a>
<h3 class="boxed">25 June 2010 - Solr 1.4.1 Released</h3>
<p>
Solr 1.4.1 has been released and is now available for public
@@ -356,7 +410,7 @@ customization is required.
See the <a href="http://svn.apache.org/repos/asf/lucene/solr/tags/release-1.4.1/CHANGES.txt">release notes</a>
for more details.
</p>
-<a name="N10074"></a><a name="7+May+2010+-+Apache+Lucene+Eurocon+2010+Coming+to+Prague+May+18-21"></a>
+<a name="N100DF"></a><a name="7+May+2010+-+Apache+Lucene+Eurocon+2010+Coming+to+Prague+May+18-21"></a>
<h3 class="boxed">7 May 2010 - Apache Lucene Eurocon 2010 Coming to Prague May 18-21</h3>
<p>
On May 18th to the 21st Prague will play host to the first
@@ -428,7 +482,7 @@ customization is required.
</li>
</ul>
-<a name="N100C0"></a><a name="10+November+2009+-+Solr+1.4+Released"></a>
+<a name="N1012B"></a><a name="10+November+2009+-+Solr+1.4+Released"></a>
<h3 class="boxed">10 November 2009 - Solr 1.4 Released</h3>
<p>
Solr 1.4 has been released and is now available for public <a href="http://www.apache.org/dyn/closer.cgi/lucene/solr/">download</a>!
@@ -460,7 +514,7 @@ customization is required.
</ul>
<p>See the <a href="http://svn.apache.org/repos/asf/lucene/solr/tags/release-1.4.0/CHANGES.txt">release notes</a> for more details.
</p>
-<a name="N100F0"></a><a name="20+August+2009+-+Solr%27s+first+book+is+published%21"></a>
+<a name="N1015B"></a><a name="20+August+2009+-+Solr%27s+first+book+is+published%21"></a>
<h3 class="boxed">20 August 2009 - Solr's first book is published!</h3>
<p>
@@ -475,7 +529,7 @@ customization is required.
</p>
<p>Finally, this book covers various deployment considerations to include indexing strategies and performance-oriented configuration that will enable you to scale Solr to meet the needs of a high-volume site.
</p>
-<a name="N10110"></a><a name="18+August+2009+-+Lucene+at+US+ApacheCon"></a>
+<a name="N1017B"></a><a name="18+August+2009+-+Lucene+at+US+ApacheCon"></a>
<h3 class="boxed">18 August 2009 - Lucene at US ApacheCon</h3>
<p>
@@ -551,7 +605,7 @@ Be sure not to miss:
Search</a> - Jason Rutherglen @ 15:00</li>
</ul>
-<a name="N10184"></a><a name="09+February+2009+-+Lucene+at+ApacheCon+Europe+2009+in+Amsterdam"></a>
+<a name="N101EF"></a><a name="09+February+2009+-+Lucene+at+ApacheCon+Europe+2009+in+Amsterdam"></a>
<h3 class="boxed">09 February 2009 - Lucene at ApacheCon Europe 2009 in Amsterdam</h3>
<p>
@@ -589,23 +643,23 @@ Be sure not to miss:
</ul>
-<a name="N101CD"></a><a name="19+December+2008+-+Solr+Logo+Contest+Results"></a>
+<a name="N10238"></a><a name="19+December+2008+-+Solr+Logo+Contest+Results"></a>
<h3 class="boxed">19 December 2008 - Solr Logo Contest Results</h3>
<p>Many great logos were submitted, but only one could be chosen. Congratulations Michiel,
the creator of the winning logo that is proudly displayed at the top of this page.
</p>
-<a name="N101D6"></a><a name="03+October+2008+-+Solr+Logo+Contest"></a>
+<a name="N10241"></a><a name="03+October+2008+-+Solr+Logo+Contest"></a>
<h3 class="boxed">03 October 2008 - Solr Logo Contest</h3>
<p>By popular demand, Solr is holding a contest to pick a new Solr logo. Details about how to submit an entry can be found <a href="http://wiki.apache.org/solr/LogoContest">on the wiki</a>. The Deadline for submissions is November 20th, 2008 @ 11:59PM GMT.
</p>
-<a name="N101E3"></a><a name="15+September+2008+-+Solr+1.3.0+Available"></a>
+<a name="N1024E"></a><a name="15+September+2008+-+Solr+1.3.0+Available"></a>
<h3 class="boxed">15 September 2008 - Solr 1.3.0 Available</h3>
<p>Solr 1.3.0 is available for public download. This version contains many enhancements and bug fixes, including distributed search capabilities,
Lucene 2.3.x performance improvements and many others.
</p>
<p>See the <a href="http://svn.apache.org/repos/asf/lucene/solr/tags/release-1.3.0/CHANGES.txt">release notes</a> for more details. Download is
available from a <a href="http://www.apache.org/dyn/closer.cgi/lucene/solr/">Apache Mirror</a>.</p>
-<a name="N101F7"></a><a name="28+August+2008+-+Lucene%2FSolr+at+ApacheCon+New+Orleans"></a>
+<a name="N10262"></a><a name="28+August+2008+-+Lucene%2FSolr+at+ApacheCon+New+Orleans"></a>
<h3 class="boxed">28 August 2008 - Lucene/Solr at ApacheCon New Orleans</h3>
<p>
@@ -627,7 +681,7 @@ Be sure not to miss:
<li>An <a href="http://us.apachecon.com/c/acus2008/schedule/2008/11/05">entire day of Lucene sessions</a> on November 5th</li>
</ul>
-<a name="N10225"></a><a name="03+September+2007+-+Lucene+at+ApacheCon+Atlanta"></a>
+<a name="N10290"></a><a name="03+September+2007+-+Lucene+at+ApacheCon+Atlanta"></a>
<h3 class="boxed">03 September 2007 - Lucene at ApacheCon Atlanta</h3>
<p>
<a href="http://www.us.apachecon.com"><img alt="ApacheCon US logo" class="float-right" src="http://www.apache.org/ads/ApacheCon/2007-usa-125x125.png"></a>
@@ -647,7 +701,7 @@ Be sure not to miss:
<li>November 16, 4:00 pm: <a href="http://us.apachecon.com/us2007/program/talk/2017"> Advanced Indexing Techniques with Apache Lucene</a> by Michael Busch. Information on payloads and advanced indexing techniques.</li>
</ul>
-<a name="N1025E"></a><a name="06+June+2007%3A+Release+1.2+available"></a>
+<a name="N102C9"></a><a name="06+June+2007%3A+Release+1.2+available"></a>
<h3 class="boxed">06 June 2007: Release 1.2 available</h3>
<p>
This is the first release since Solr graduated from the Incubator,
@@ -657,40 +711,40 @@ Be sure not to miss:
and more flexible plugins.
</p>
<p>See the <a href="http://svn.apache.org/repos/asf/lucene/solr/tags/release-1.2.0/CHANGES.txt">release notes</a> for more details.</p>
-<a name="N1026F"></a><a name="17+January+2007%3A+Solr+graduates+from+Incubator"></a>
+<a name="N102DA"></a><a name="17+January+2007%3A+Solr+graduates+from+Incubator"></a>
<h3 class="boxed">17 January 2007: Solr graduates from Incubator</h3>
<p>
Solr has graduated from the Apache Incubator, and is now a sub-project of Lucene.
</p>
-<a name="N10279"></a><a name="22+December+2006%3A+Release+1.1.0+available"></a>
+<a name="N102E4"></a><a name="22+December+2006%3A+Release+1.1.0+available"></a>
<h3 class="boxed">22 December 2006: Release 1.1.0 available</h3>
<p>
This is the first release since Solr joined the Incubator, and brings
many new features and performance optimizations including highlighting,
faceted search, and JSON/Python/Ruby response formats.
</p>
-<a name="N10283"></a><a name="15+August+2006%3A+Solr+at+ApacheCon+US"></a>
+<a name="N102EE"></a><a name="15+August+2006%3A+Solr+at+ApacheCon+US"></a>
<h3 class="boxed">15 August 2006: Solr at ApacheCon US</h3>
<p>Chris Hostetter will be presenting
<strong><a href="http://www.apachecon.com/2006/US/html/sessions.html#FR26">"Faceted Searching With Apache Solr"</a></strong>
at ApacheCon US 2006, on October 13th at 4:30pm.
See the <a href="http://www.us.apachecon.com/">ApacheCon</a> website for more details.
</p>
-<a name="N10296"></a><a name="21+April+2006%3A+Solr+at+ApacheCon"></a>
+<a name="N10301"></a><a name="21+April+2006%3A+Solr+at+ApacheCon"></a>
<h3 class="boxed">21 April 2006: Solr at ApacheCon</h3>
<p>Yonik Seeley will be presenting
<strong>"Apache Solr, a Full-Text Search Server based on Lucene"</strong>
at ApacheCon Europe 2006, on June 29th at 5:30pm.
See the <a href="http://www.eu.apachecon.com/">ApacheCon</a> website for more details.
</p>
-<a name="N102A7"></a><a name="21+February+2006%3A+nightly+builds"></a>
+<a name="N10312"></a><a name="21+February+2006%3A+nightly+builds"></a>
<h3 class="boxed">21 February 2006: nightly builds</h3>
<p>Solr now has nightly builds. This automatically creates a
<a href="http://people.apache.org/builds/lucene/solr/nightly/">downloadable version of Solr every
night</a>. All unit tests must pass, or a message is sent to
the developers mailing list and no new version is created. This
also updates the <a href="api/index.html">javadoc</a>.</p>
-<a name="N102B9"></a><a name="17+January+2006%3A+Solr+Joins+Apache+Incubator"></a>
+<a name="N10324"></a><a name="17+January+2006%3A+Solr+Joins+Apache+Incubator"></a>
<h3 class="boxed">17 January 2006: Solr Joins Apache Incubator</h3>
<p>Solr, a search server based on Lucene, has been accepted into the Apache Incubator.
Solr was originally developed by CNET Networks, and is widely used within CNET
Modified: lucene/dev/branches/bulkpostings/solr/site/index.pdf
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/site/index.pdf?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
Binary files - no diff available.
Modified: lucene/dev/branches/bulkpostings/solr/site/issue_tracking.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/site/issue_tracking.html?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/site/issue_tracking.html (original)
+++ lucene/dev/branches/bulkpostings/solr/site/issue_tracking.html Mon May 9 13:19:28 2011
@@ -130,6 +130,9 @@ document.write("Last Published: " + docu
<div class="menuitem">
<a href="api/solrj/index.html">SolrJ Javadoc</a>
</div>
+<div class="menuitem">
+<a href="api/test-framework/index.html">Test Framework Javadoc</a>
+</div>
</div>
<div onclick="SwitchMenu('menu_selected_1.3', 'skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Resources</div>
<div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">
Modified: lucene/dev/branches/bulkpostings/solr/site/linkmap.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/site/linkmap.html?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/site/linkmap.html (original)
+++ lucene/dev/branches/bulkpostings/solr/site/linkmap.html Mon May 9 13:19:28 2011
@@ -130,6 +130,9 @@ document.write("Last Published: " + docu
<div class="menuitem">
<a href="api/solrj/index.html">SolrJ Javadoc</a>
</div>
+<div class="menuitem">
+<a href="api/test-framework/index.html">Test Framework Javadoc</a>
+</div>
</div>
<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Resources</div>
<div id="menu_1.3" class="menuitemgroup">
@@ -285,6 +288,12 @@ document.write("Last Published: " + docu
<a href="api/solrj/index.html">SolrJ Javadoc</a> ___________________ <em>apidocs</em>
</li>
</ul>
+
+<ul>
+<li>
+<a href="api/test-framework/index.html">Test Framework Javadoc</a> ___________________ <em>apidocs</em>
+</li>
+</ul>
</ul>
</ul>
Modified: lucene/dev/branches/bulkpostings/solr/site/linkmap.pdf
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/site/linkmap.pdf?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
Binary files - no diff available.
Modified: lucene/dev/branches/bulkpostings/solr/site/mailing_lists.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/site/mailing_lists.html?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/site/mailing_lists.html (original)
+++ lucene/dev/branches/bulkpostings/solr/site/mailing_lists.html Mon May 9 13:19:28 2011
@@ -130,6 +130,9 @@ document.write("Last Published: " + docu
<div class="menuitem">
<a href="api/solrj/index.html">SolrJ Javadoc</a>
</div>
+<div class="menuitem">
+<a href="api/test-framework/index.html">Test Framework Javadoc</a>
+</div>
</div>
<div onclick="SwitchMenu('menu_selected_1.3', 'skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Resources</div>
<div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">
Modified: lucene/dev/branches/bulkpostings/solr/site/skin/basic.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/site/skin/basic.css?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/site/skin/basic.css (original)
+++ lucene/dev/branches/bulkpostings/solr/site/skin/basic.css Mon May 9 13:19:28 2011
@@ -163,4 +163,4 @@ p {
.codefrag {
font-family: "Courier New", Courier, monospace;
font-size: 110%;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/bulkpostings/solr/site/skin/print.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/site/skin/print.css?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/site/skin/print.css (original)
+++ lucene/dev/branches/bulkpostings/solr/site/skin/print.css Mon May 9 13:19:28 2011
@@ -51,4 +51,4 @@ a:link, a:visited {
acronym {
border: 0;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/bulkpostings/solr/site/skin/profile.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/site/skin/profile.css?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/site/skin/profile.css (original)
+++ lucene/dev/branches/bulkpostings/solr/site/skin/profile.css Mon May 9 13:19:28 2011
@@ -172,4 +172,4 @@ a:hover { color:#6587ff}
}
-
\ No newline at end of file
+
Modified: lucene/dev/branches/bulkpostings/solr/site/skin/screen.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/site/skin/screen.css?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/site/skin/screen.css (original)
+++ lucene/dev/branches/bulkpostings/solr/site/skin/screen.css Mon May 9 13:19:28 2011
@@ -584,4 +584,4 @@ p.instruction {
list-style-image: url('../images/instruction_arrow.png');
list-style-position: outside;
margin-left: 2em;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/bulkpostings/solr/site/tutorial.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/site/tutorial.html?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/site/tutorial.html (original)
+++ lucene/dev/branches/bulkpostings/solr/site/tutorial.html Mon May 9 13:19:28 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 4.0.0.2011.01.04.00.08.44)</title>
+<title>Solr tutorial</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">
@@ -130,6 +130,9 @@ document.write("Last Published: " + docu
<div class="menuitem">
<a href="api/solrj/index.html">SolrJ Javadoc</a>
</div>
+<div class="menuitem">
+<a href="api/test-framework/index.html">Test Framework Javadoc</a>
+</div>
</div>
<div onclick="SwitchMenu('menu_1.3', 'skin/')" id="menu_1.3Title" class="menutitle">Resources</div>
<div id="menu_1.3" class="menuitemgroup">
@@ -192,10 +195,7 @@ document.write("Last Published: " + docu
}
}
</script>
-<div id="credit">
-<hr>
- 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="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>
<!--+
@@ -217,9 +217,6 @@ document.write("Last Published: " + docu
PDF</a>
</div>
<h1>Solr tutorial</h1>
-<div id="motd-area">
- 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">
<li>
@@ -257,6 +254,9 @@ document.write("Last Published: " + docu
<a href="#Faceted+Search">Faceted Search</a>
</li>
<li>
+<a href="#Search+UI">Search UI</a>
+</li>
+<li>
<a href="#Text+Analysis">Text Analysis</a>
<ul class="minitoc">
<li>
@@ -290,10 +290,9 @@ To follow along with this tutorial, you
<ol>
<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.oracle.com/technetwork/java/javase/downloads/index.html">Oracle</a>,
+ <a href="http://openjdk.java.net/">Open JDK</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.6. Gnu's GCJ is not supported and does not work with Solr.
@@ -306,7 +305,7 @@ To follow along with this tutorial, you
</div>
-<a name="N10043"></a><a name="Getting+Started"></a>
+<a name="N1003F"></a><a name="Getting+Started"></a>
<h2 class="boxed">Getting Started</h2>
<div class="section">
<p>
@@ -335,7 +334,7 @@ To launch Jetty with the Solr WAR, and t
<pre class="code">
user:~/solr/example$ <strong>java -jar start.jar</strong>
2009-10-23 16:42:53.816::INFO: Logging to STDERR via org.mortbay.log.StdErrLog
-2009-10-23 16:42:53.907::INFO: jetty-6.1.3
+2009-10-23 16:42:53.907::INFO: jetty-6.1.26
...
@@ -354,7 +353,7 @@ You can see that the Solr is running by
-<a name="N1007B"></a><a name="Indexing+Data"></a>
+<a name="N10077"></a><a name="Indexing+Data"></a>
<h2 class="boxed">Indexing Data</h2>
<div class="section">
<p>
@@ -389,11 +388,11 @@ Clicking the "Search" button should take
</p>
<p>
-<a href="http://localhost:8983/solr/select/?q=solr&version=2.2&start=0&rows=10&indent=on">http://localhost:8983/solr/select/?q=solr&version=2.2&start=0&rows=10&indent=on</a>
+<a href="http://localhost:8983/solr/select/?q=solr&start=0&rows=10&indent=on">http://localhost:8983/solr/select/?q=solr&start=0&rows=10&indent=on</a>
</p>
<p>
-You can index all of the sample data, using the following command (assuming your shell supports the *.xml notation):
+You can index all of the sample data, using the following command (assuming your command line shell supports the *.xml notation):
</p>
<pre class="code">
user:~/solr/example/exampledocs$ <strong>java -jar post.jar *.xml</strong>
@@ -448,6 +447,11 @@ SimplePostTool: COMMITting Solr index ch
including those exported by Excel or MySQL.
</li>
+<li>
+<a href="http://wiki.apache.org/solr/UpdateJSON">POST JSON documents</a>
+
+</li>
+
<li>Index binary documents such as Word and PDF with
<a href="http://wiki.apache.org/solr/ExtractingRequestHandler">Solr Cell</a> (ExtractingRequestHandler).
</li>
@@ -464,7 +468,7 @@ SimplePostTool: COMMITting Solr index ch
-<a name="N100EB"></a><a name="Updating+Data"></a>
+<a name="N100ED"></a><a name="Updating+Data"></a>
<h2 class="boxed">Updating Data</h2>
<div class="section">
<p>
@@ -496,7 +500,7 @@ Go ahead and edit the existing XML files
the <span class="codefrag">java -jar post.jar</span> command, you'll see your changes reflected
in subsequent searches.
</p>
-<a name="N10119"></a><a name="Deleting+Data"></a>
+<a name="N1011B"></a><a name="Deleting+Data"></a>
<h3 class="boxed">Deleting Data</h3>
<p>You can delete data by POSTing a delete command to the update URL and specifying the value
of the document's unique key field, or a query that matches multiple documents (be careful with that one!). Since these commands
@@ -525,7 +529,7 @@ in subsequent searches.
</div>
-<a name="N1015F"></a><a name="Querying+Data"></a>
+<a name="N10161"></a><a name="Querying+Data"></a>
<h2 class="boxed">Querying Data</h2>
<div class="section">
<p>
@@ -556,7 +560,7 @@ in subsequent searches.
Solr provides a <a href="http://localhost:8983/solr/admin/form.jsp">query form</a> within the web admin interface
that allows setting the various request parameters and is useful when trying out or debugging queries.
</p>
-<a name="N10194"></a><a name="Sorting"></a>
+<a name="N10196"></a><a name="Sorting"></a>
<h3 class="boxed">Sorting</h3>
<p>
Solr provides a simple method to sort on one or more indexed fields.
@@ -592,13 +596,23 @@ in subsequent searches.
</ul>
<p>
+ Complex functions may also be used to sort results...
+ </p>
+<ul>
+
+<li>
+<a href="http://localhost:8983/solr/select/?indent=on&q=*:*&sort=div(popularity,add(price,1))+desc">q=video&sort=div(popularity,add(price,1)) desc</a>
+</li>
+
+</ul>
+<p>
If no sort is specified, the default is <span class="codefrag">score desc</span> to return the matches having the highest relevancy.
</p>
</div>
-<a name="N101C7"></a><a name="Highlighting"></a>
+<a name="N101D4"></a><a name="Highlighting"></a>
<h2 class="boxed">Highlighting</h2>
<div class="section">
<p>
@@ -625,7 +639,7 @@ in subsequent searches.
-<a name="N101F0"></a><a name="Faceted+Search"></a>
+<a name="N101FD"></a><a name="Faceted+Search"></a>
<h2 class="boxed">Faceted Search</h2>
<div class="section">
<p>
@@ -684,7 +698,25 @@ in subsequent searches.
-<a name="N10241"></a><a name="Text+Analysis"></a>
+<a name="N1024E"></a><a name="Search+UI"></a>
+<h2 class="boxed">Search UI</h2>
+<div class="section">
+<p>
+ Solr includes an example search interface built with velocity templating
+ that demonstrates many features, including searching, faceting, highlighting,
+ autocomplete, and geospatial searching.
+ </p>
+<p>
+ Try it out at
+ <a href="http://localhost:8983/solr/browse">http://localhost:8983/solr/browse</a>
+
+</p>
+</div> <!-- Search UI -->
+
+
+
+
+<a name="N10261"></a><a name="Text+Analysis"></a>
<h2 class="boxed">Text Analysis</h2>
<div class="section">
<p>
@@ -726,7 +758,7 @@ in subsequent searches.
<p>A full description of the analysis components, Analyzers, Tokenizers, and TokenFilters
available for use is <a href="http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters">here</a>.
</p>
-<a name="N10291"></a><a name="Analysis+Debugging"></a>
+<a name="N102B1"></a><a name="Analysis+Debugging"></a>
<h3 class="boxed">Analysis Debugging</h3>
<p>There is a handy <a href="http://localhost:8983/solr/admin/analysis.jsp">analysis</a>
debugging page where you can see how a text value is broken down into words,
@@ -755,7 +787,7 @@ in subsequent searches.
</div>
-<a name="N102D0"></a><a name="Conclusion"></a>
+<a name="N102F0"></a><a name="Conclusion"></a>
<h2 class="boxed">Conclusion</h2>
<div class="section">
<p>
Modified: lucene/dev/branches/bulkpostings/solr/site/tutorial.pdf
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/site/tutorial.pdf?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
Binary files - no diff available.
Modified: lucene/dev/branches/bulkpostings/solr/site/version_control.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/site/version_control.html?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/site/version_control.html (original)
+++ lucene/dev/branches/bulkpostings/solr/site/version_control.html Mon May 9 13:19:28 2011
@@ -130,6 +130,9 @@ document.write("Last Published: " + docu
<div class="menuitem">
<a href="api/solrj/index.html">SolrJ Javadoc</a>
</div>
+<div class="menuitem">
+<a href="api/test-framework/index.html">Test Framework Javadoc</a>
+</div>
</div>
<div onclick="SwitchMenu('menu_selected_1.3', 'skin/')" id="menu_selected_1.3Title" class="menutitle" style="background-image: url('skin/images/chapter_open.gif');">Resources</div>
<div id="menu_selected_1.3" class="selectedmenuitemgroup" style="display: block;">
Modified: lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/SolrDocument.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/SolrDocument.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/SolrDocument.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/SolrDocument.java Mon May 9 13:19:28 2011
@@ -26,6 +26,8 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
+import org.apache.solr.common.util.NamedList;
+
/**
* A concrete representation of a document within a Solr index. Unlike a lucene
@@ -88,6 +90,9 @@ public class SolrDocument implements Map
else if( value instanceof Collection ) {
// nothing
}
+ else if( value instanceof NamedList ) {
+ // nothing
+ }
else if( value instanceof Iterable ) {
ArrayList<Object> lst = new ArrayList<Object>();
for( Object o : (Iterable)value ) {
Modified: lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/util/FileUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/util/FileUtils.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/util/FileUtils.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/util/FileUtils.java Mon May 9 13:19:28 2011
@@ -54,9 +54,7 @@ public class FileUtils {
}
/**
- * Copied from Lucene's {@link org.apache.lucene.store.FSDirectory#sync(String)}
- *
- * @see org.apache.lucene.store.FSDirectory#sync(String)
+ * Copied from Lucene's FSDirectory.sync(String) <!-- protected -->
*
* @param fullFile the File to be synced to disk
* @throws IOException if the file could not be synced
Modified: lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/util/JavaBinCodec.java Mon May 9 13:19:28 2011
@@ -295,27 +295,13 @@ public class JavaBinCodec {
}
public void writeSolrDocument(SolrDocument doc) throws IOException {
- writeSolrDocument(doc, null);
- }
-
- public void writeSolrDocument(SolrDocument doc, Set<String> fields) throws IOException {
- int count = 0;
- if (fields == null) {
- count = doc.getFieldNames().size();
- } else {
- for (Map.Entry<String, Object> entry : doc) {
- if (fields.contains(entry.getKey())) count++;
- }
- }
writeTag(SOLRDOC);
- writeTag(ORDERED_MAP, count);
+ writeTag(ORDERED_MAP, doc.size());
for (Map.Entry<String, Object> entry : doc) {
- if (fields == null || fields.contains(entry.getKey())) {
- String name = entry.getKey();
- writeExternString(name);
- Object val = entry.getValue();
- writeVal(val);
- }
+ String name = entry.getKey();
+ writeExternString(name);
+ Object val = entry.getValue();
+ writeVal(val);
}
}
Modified: lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/util/NamedList.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/util/NamedList.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/util/NamedList.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/common/org/apache/solr/common/util/NamedList.java Mon May 9 13:19:28 2011
@@ -43,7 +43,7 @@ import java.io.Serializable;
* by key, so ResponseWriters that output to a format such as JSON will normally
* choose a data structure that allows order to be easily preserved in various
* clients (i.e. not a straight map).
- * If access by key is more important, see {@link SimpleOrderedMap},
+ * If access by key is more important for serialization, see {@link SimpleOrderedMap},
* or simply use a regular {@link Map}
* </p>
*
@@ -200,10 +200,14 @@ public class NamedList<T> implements Clo
/**
* Gets the value for the first instance of the specified name
* found.
- *
+ * <p>
+ * NOTE: this runs in linear time (it scans starting at the
+ * beginning of the list until it finds the first pair with
+ * the specified name).
* @return null if not found or if the value stored was null.
* @see #indexOf
* @see #get(String,int)
+ *
*/
public T get(String name) {
return get(name,0);
@@ -212,7 +216,10 @@ public class NamedList<T> implements Clo
/**
* Gets the value for the first instance of the specified name
* found starting at the specified index.
- *
+ * <p>
+ * NOTE: this runs in linear time (it scans starting at the
+ * specified position until it finds the first pair with
+ * the specified name).
* @return null if not found or if the value stored was null.
* @see #indexOf
*/
@@ -377,6 +384,11 @@ public class NamedList<T> implements Clo
return iter;
}
+ /**
+ * NOTE: this runs in linear time (it scans starting at the
+ * beginning of the list until it finds the first pair with
+ * the specified name).
+ */
public T remove(String name) {
int idx = indexOf(name, 0);
if(idx != -1) return remove(idx);
Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/analysis/CollationKeyFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/analysis/CollationKeyFilterFactory.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/analysis/CollationKeyFilterFactory.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/analysis/CollationKeyFilterFactory.java Mon May 9 13:19:28 2011
@@ -69,7 +69,9 @@ import org.apache.solr.util.plugin.Resou
* @see Locale
* @see RuleBasedCollator
* @since solr 3.1
+ * @deprecated use {@link org.apache.solr.schema.CollationField} instead.
*/
+@Deprecated
public class CollationKeyFilterFactory extends BaseTokenFilterFactory implements ResourceLoaderAware {
private Collator collator;
Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/core/RequestHandlers.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/core/RequestHandlers.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/core/RequestHandlers.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/core/RequestHandlers.java Mon May 9 13:19:28 2011
@@ -17,25 +17,28 @@
package org.apache.solr.core;
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrException.ErrorCode;
+import org.apache.solr.common.params.CommonParams;
+import org.apache.solr.common.params.CommonParams.EchoParamStyle;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
+import org.apache.solr.handler.component.SearchHandler;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrRequestHandler;
import org.apache.solr.response.SolrQueryResponse;
-import org.apache.solr.util.plugin.SolrCoreAware;
import org.apache.solr.util.plugin.PluginInfoInitialized;
+import org.apache.solr.util.plugin.SolrCoreAware;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.net.URL;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
/**
*/
final class RequestHandlers {
Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/core/SolrConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/core/SolrConfig.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/core/SolrConfig.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/core/SolrConfig.java Mon May 9 13:19:28 2011
@@ -27,6 +27,7 @@ import org.apache.solr.request.LocalSolr
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrRequestHandler;
import org.apache.solr.response.QueryResponseWriter;
+import org.apache.solr.response.transform.TransformerFactory;
import org.apache.solr.search.CacheConfig;
import org.apache.solr.search.FastLRUCache;
@@ -190,6 +191,7 @@ public class SolrConfig extends Config {
loadPluginInfo(QParserPlugin.class,"queryParser",true, true);
loadPluginInfo(QueryResponseWriter.class,"queryResponseWriter",true, true);
loadPluginInfo(ValueSourceParser.class,"valueSourceParser",true, true);
+ loadPluginInfo(TransformerFactory.class,"transformer",true, true);
loadPluginInfo(SearchComponent.class,"searchComponent",true, true);
loadPluginInfo(QueryConverter.class,"queryConverter",true, true);
@@ -396,7 +398,7 @@ public class SolrConfig extends Config {
* @param type The key is FQN of the plugin class there are a few known types : SolrFormatter, SolrFragmenter
* SolrRequestHandler,QParserPlugin, QueryResponseWriter,ValueSourceParser,
* SearchComponent, QueryConverter, SolrEventListener, DirectoryFactory,
- * IndexDeletionPolicy, IndexReaderFactory
+ * IndexDeletionPolicy, IndexReaderFactory, {@link TransformerFactory}
*/
public List<PluginInfo> getPluginInfos(String type){
List<PluginInfo> result = pluginStore.get(type);
Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/core/SolrCore.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/core/SolrCore.java Mon May 9 13:19:28 2011
@@ -33,16 +33,7 @@ import org.apache.solr.handler.component
import org.apache.solr.highlight.SolrHighlighter;
import org.apache.solr.request.*;
import org.apache.solr.response.*;
-import org.apache.solr.response.BinaryResponseWriter;
-import org.apache.solr.response.JSONResponseWriter;
-import org.apache.solr.response.PHPResponseWriter;
-import org.apache.solr.response.PHPSerializedResponseWriter;
-import org.apache.solr.response.PythonResponseWriter;
-import org.apache.solr.response.QueryResponseWriter;
-import org.apache.solr.response.RawResponseWriter;
-import org.apache.solr.response.RubyResponseWriter;
-import org.apache.solr.response.SolrQueryResponse;
-import org.apache.solr.response.XMLResponseWriter;
+import org.apache.solr.response.transform.TransformerFactory;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.search.QParserPlugin;
import org.apache.solr.search.SolrFieldCacheMBean;
@@ -507,6 +498,7 @@ public final class SolrCore implements S
initWriters();
initQParsers();
initValueSourceParsers();
+ initTransformerFactories();
this.searchComponents = Collections.unmodifiableMap(loadSearchComponents());
@@ -1455,6 +1447,34 @@ public final class SolrCore implements S
}
}
}
+
+
+ private final HashMap<String, TransformerFactory> transformerFactories = new HashMap<String, TransformerFactory>();
+
+ /** Configure the TransformerFactory plugins */
+ private void initTransformerFactories() {
+ // Load any transformer factories
+ initPlugins(transformerFactories,TransformerFactory.class);
+
+ // Tell each transformer what its name is
+ for( Map.Entry<String, TransformerFactory> entry : TransformerFactory.defaultFactories.entrySet() ) {
+ try {
+ String name = entry.getKey();
+ if (null == valueSourceParsers.get(name)) {
+ TransformerFactory f = entry.getValue();
+ transformerFactories.put(name, f);
+ // f.init(null); default ones don't need init
+ }
+ } catch (Exception e) {
+ throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
+ }
+ }
+ }
+
+ public TransformerFactory getTransformerFactory(String name) {
+ return transformerFactories.get(name);
+ }
+
/**
* @param registry The map to which the instance should be added to. The key is the name attribute
Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java Mon May 9 13:19:28 2011
@@ -38,7 +38,6 @@ import org.apache.solr.common.SolrExcept
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.schema.FieldType;
-import org.apache.solr.util.ByteUtils;
import org.apache.noggit.CharArr;
@@ -141,12 +140,12 @@ public abstract class AnalysisRequestHan
final Set<BytesRef> tokens = new HashSet<BytesRef>();
final TokenStream tokenStream = analyzer.tokenStream("", new StringReader(query));
final TermToBytesRefAttribute bytesAtt = tokenStream.getAttribute(TermToBytesRefAttribute.class);
+ final BytesRef bytes = bytesAtt.getBytesRef();
try {
tokenStream.reset();
while (tokenStream.incrementToken()) {
- final BytesRef bytes = new BytesRef();
- bytesAtt.toBytesRef(bytes);
- tokens.add(bytes);
+ bytesAtt.fillBytesRef();
+ tokens.add(new BytesRef(bytes));
}
} catch (IOException ioe) {
throw new RuntimeException("Error occured while iterating over tokenstream", ioe);
@@ -236,12 +235,13 @@ public abstract class AnalysisRequestHan
FieldType fieldType = context.getFieldType();
- final BytesRef rawBytes = new BytesRef();
final CharArr textBuf = new CharArr();
for (int i = 0, c = tokens.size(); i < c; i++) {
AttributeSource token = tokens.get(i);
final NamedList<Object> tokenNamedList = new SimpleOrderedMap<Object>();
- token.getAttribute(TermToBytesRefAttribute.class).toBytesRef(rawBytes);
+ final TermToBytesRefAttribute termAtt = token.getAttribute(TermToBytesRefAttribute.class);
+ BytesRef rawBytes = termAtt.getBytesRef();
+ termAtt.fillBytesRef();
textBuf.reset();
fieldType.indexedToReadable(rawBytes, textBuf);
Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/MoreLikeThisHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/MoreLikeThisHandler.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/MoreLikeThisHandler.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/MoreLikeThisHandler.java Mon May 9 13:19:28 2011
@@ -77,10 +77,11 @@ public class MoreLikeThisHandler extends
SolrParams params = req.getParams();
// Set field flags
- String fl = params.get(CommonParams.FL);
+ ReturnFields returnFields = new ReturnFields( req );
+ rsp.setReturnFields( returnFields );
int flags = 0;
- if (fl != null) {
- flags |= SolrPluginUtils.setReturnFields(fl, rsp);
+ if (returnFields.wantsScore()) {
+ flags |= SolrIndexSearcher.GET_SCORES;
}
String defType = params.get(QueryParsing.DEFTYPE, QParserPlugin.DEFAULT_QTYPE);
Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/component/QueryComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/component/QueryComponent.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/component/QueryComponent.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/handler/component/QueryComponent.java Mon May 9 13:19:28 2011
@@ -39,6 +39,7 @@ import org.apache.solr.common.util.Named
import org.apache.solr.common.util.StrUtils;
import org.apache.solr.core.CoreDescriptor;
import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.response.ResultContext;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.schema.FieldType;
import org.apache.solr.schema.SchemaField;
@@ -72,13 +73,14 @@ public class QueryComponent extends Sear
}
SolrQueryResponse rsp = rb.rsp;
- // Set field flags
- String fl = params.get(CommonParams.FL);
- int fieldFlags = 0;
- if (fl != null) {
- fieldFlags |= SolrPluginUtils.setReturnFields(fl, rsp);
+ // Set field flags
+ ReturnFields returnFields = new ReturnFields( req );
+ rsp.setReturnFields( returnFields );
+ int flags = 0;
+ if (returnFields.wantsScore()) {
+ flags |= SolrIndexSearcher.GET_SCORES;
}
- rb.setFieldFlags( fieldFlags );
+ rb.setFieldFlags( flags );
String defType = params.get(QueryParsing.DEFTYPE,QParserPlugin.DEFAULT_QTYPE);
@@ -294,7 +296,11 @@ public class QueryComponent extends Sear
res.docSet = searcher.getDocSet(queries);
}
rb.setResults(res);
- rsp.add("response",rb.getResults().docList);
+
+ ResultContext ctx = new ResultContext();
+ ctx.docs = rb.getResults().docList;
+ ctx.query = null; // anything?
+ rsp.add("response", ctx);
return;
}
@@ -416,7 +422,10 @@ public class QueryComponent extends Sear
// TODO: get "hits" a different way to log
if (grouping.mainResult != null) {
- rsp.add("response",grouping.mainResult);
+ ResultContext ctx = new ResultContext();
+ ctx.docs = grouping.mainResult;
+ ctx.query = null; // TODO? add the query?
+ rsp.add("response", ctx);
rsp.getToLog().add("hits", grouping.mainResult.matches());
}
@@ -431,7 +440,11 @@ public class QueryComponent extends Sear
searcher.search(result,cmd);
rb.setResult( result );
- rsp.add("response",rb.getResults().docList);
+
+ ResultContext ctx = new ResultContext();
+ ctx.docs = rb.getResults().docList;
+ ctx.query = rb.getQuery();
+ rsp.add("response", ctx);
rsp.getToLog().add("hits", rb.getResults().docList.matches());
doFieldSortValues(rb, searcher);
Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/BaseResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/BaseResponseWriter.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/BaseResponseWriter.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/BaseResponseWriter.java Mon May 9 13:19:28 2011
@@ -24,6 +24,7 @@ import org.apache.solr.common.SolrInputD
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.search.DocList;
+import org.apache.solr.search.ReturnFields;
import org.apache.solr.search.SolrIndexSearcher;
import org.apache.solr.search.DocIterator;
import org.apache.solr.schema.FieldType;
@@ -38,10 +39,14 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.List;
-import java.util.Set;
import java.util.ArrayList;
/**
+ * THIS HAS NO TESTS and is not used anywhere.... no idea how or if it should work...
+ *
+ * I think we should drop it - along with {@link GenericBinaryResponseWriter} and {@link GenericBinaryResponseWriter}
+ *
+ * unless I'm missing something (ryan, March 2011)
*
*
* This class serves as a basis from which {@link QueryResponseWriter}s can be
@@ -60,7 +65,6 @@ public abstract class BaseResponseWriter
private static final Logger LOG = LoggerFactory
.getLogger(BaseResponseWriter.class);
- private static final String SCORE_FIELD = "score";
/**
*
@@ -110,9 +114,6 @@ public abstract class BaseResponseWriter
responseWriter.startDocumentList(name,info);
for (int j = 0; j < sz; j++) {
SolrDocument sdoc = getDoc(iterator.nextDoc(), idxInfo);
- if (idxInfo.includeScore && docList.hasScores()) {
- sdoc.addField(SCORE_FIELD, iterator.score());
- }
responseWriter.writeDoc(sdoc);
}
} else {
@@ -120,9 +121,6 @@ public abstract class BaseResponseWriter
.size());
for (int j = 0; j < sz; j++) {
SolrDocument sdoc = getDoc(iterator.nextDoc(), idxInfo);
- if (idxInfo.includeScore && docList.hasScores()) {
- sdoc.addField(SCORE_FIELD, iterator.score());
- }
list.add(sdoc);
}
responseWriter.writeAllDocs(info, list);
@@ -144,22 +142,13 @@ public abstract class BaseResponseWriter
private static class IdxInfo {
IndexSchema schema;
SolrIndexSearcher searcher;
- Set<String> returnFields;
- boolean includeScore;
+ ReturnFields returnFields;
private IdxInfo(IndexSchema schema, SolrIndexSearcher searcher,
- Set<String> returnFields) {
+ ReturnFields returnFields) {
this.schema = schema;
this.searcher = searcher;
- this.includeScore = returnFields != null
- && returnFields.contains(SCORE_FIELD);
- if (returnFields != null) {
- if (returnFields.size() == 0 || (returnFields.size() == 1 && includeScore) || returnFields.contains("*")) {
- returnFields = null; // null means return all stored fields
- }
- }
this.returnFields = returnFields;
-
}
}
@@ -168,7 +157,7 @@ public abstract class BaseResponseWriter
SolrDocument solrDoc = new SolrDocument();
for (Fieldable f : doc.getFields()) {
String fieldName = f.name();
- if (info.returnFields != null && !info.returnFields.contains(fieldName))
+ if (info.returnFields != null && !info.returnFields.wantsField(fieldName))
continue;
SchemaField sf = info.schema.getFieldOrNull(fieldName);
FieldType ft = null;
Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/BinaryResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/BinaryResponseWriter.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/BinaryResponseWriter.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/BinaryResponseWriter.java Mon May 9 13:19:28 2011
@@ -19,13 +19,16 @@ package org.apache.solr.response;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Fieldable;
import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.JavaBinCodec;
import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.response.transform.DocTransformer;
+import org.apache.solr.response.transform.TransformContext;
import org.apache.solr.schema.*;
-import org.apache.solr.search.DocIterator;
import org.apache.solr.search.DocList;
+import org.apache.solr.search.ReturnFields;
import org.apache.solr.search.SolrIndexSearcher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -62,79 +65,101 @@ public class BinaryResponseWriter implem
protected final SolrQueryRequest solrQueryRequest;
protected IndexSchema schema;
protected SolrIndexSearcher searcher;
- protected final Set<String> returnFields;
- protected final boolean includeScore;
+ protected final ReturnFields returnFields;
// transmit field values using FieldType.toObject()
// rather than the String from FieldType.toExternal()
boolean useFieldObjects = true;
- public Resolver(SolrQueryRequest req, Set<String> returnFields) {
+ public Resolver(SolrQueryRequest req, ReturnFields returnFields) {
solrQueryRequest = req;
- this.includeScore = returnFields != null && returnFields.contains("score");
-
- if (returnFields != null) {
- if (returnFields.size() == 0 || (returnFields.size() == 1 && includeScore) || returnFields.contains("*")) {
- returnFields = null; // null means return all stored fields
- }
- }
this.returnFields = returnFields;
}
public Object resolve(Object o, JavaBinCodec codec) throws IOException {
+ if (o instanceof ResultContext) {
+ writeResults((ResultContext) o, codec);
+ return null; // null means we completely handled it
+ }
if (o instanceof DocList) {
- writeDocList((DocList) o, codec);
+ ResultContext ctx = new ResultContext();
+ ctx.docs = (DocList) o;
+ writeResults(ctx, codec);
return null; // null means we completely handled it
}
+
if (o instanceof SolrDocument) {
- SolrDocument solrDocument = (SolrDocument) o;
- codec.writeSolrDocument(solrDocument, returnFields);
- return null;
- }
- if (o instanceof Document) {
- return getDoc((Document) o);
+ // Remove any fields that were not requested
+ // This typically happens when distributed search adds extra fields to an internal request
+ SolrDocument doc = (SolrDocument)o;
+ for( String fname : doc.getFieldNames() ) {
+ if( !returnFields.wantsField( fname ) ) {
+ doc.removeFields( fname );
+ }
+ }
+ return doc;
}
-
return o;
}
- public void writeDocList(DocList ids, JavaBinCodec codec) throws IOException {
- codec.writeTag(JavaBinCodec.SOLRDOCLST);
- List l = new ArrayList(3);
- l.add((long) ids.matches());
- l.add((long) ids.offset());
- Float maxScore = null;
- if (includeScore && ids.hasScores()) {
- maxScore = ids.maxScore();
- }
- l.add(maxScore);
- codec.writeArray(l);
-
+ protected void writeResultsBody( ResultContext res, JavaBinCodec codec ) throws IOException
+ {
+ DocList ids = res.docs;
+ TransformContext context = new TransformContext();
+ context.query = res.query;
+ context.wantsScores = returnFields.wantsScore() && ids.hasScores();
+
int sz = ids.size();
codec.writeTag(JavaBinCodec.ARR, sz);
if(searcher == null) searcher = solrQueryRequest.getSearcher();
if(schema == null) schema = solrQueryRequest.getSchema();
- DocIterator iterator = ids.iterator();
+
+ context.searcher = searcher;
+ DocTransformer transformer = returnFields.getTransformer();
+ if( transformer != null ) {
+ transformer.setContext( context );
+ }
+
+ Set<String> fnames = returnFields.getLuceneFieldNames();
+ context.iterator = ids.iterator();
for (int i = 0; i < sz; i++) {
- int id = iterator.nextDoc();
- Document doc = searcher.doc(id, returnFields);
-
+ int id = context.iterator.nextDoc();
+ Document doc = searcher.doc(id, fnames);
SolrDocument sdoc = getDoc(doc);
-
- if (includeScore && ids.hasScores()) {
- sdoc.addField("score", iterator.score());
+ if( transformer != null ) {
+ transformer.transform(sdoc, id );
}
-
codec.writeSolrDocument(sdoc);
}
+ if( transformer != null ) {
+ transformer.setContext( null );
+ }
+ }
+
+ public void writeResults(ResultContext ctx, JavaBinCodec codec) throws IOException {
+ codec.writeTag(JavaBinCodec.SOLRDOCLST);
+ boolean wantsScores = returnFields.wantsScore() && ctx.docs.hasScores();
+ List l = new ArrayList(3);
+ l.add((long) ctx.docs.matches());
+ l.add((long) ctx.docs.offset());
+
+ Float maxScore = null;
+ if (wantsScores) {
+ maxScore = ctx.docs.maxScore();
+ }
+ l.add(maxScore);
+ codec.writeArray(l);
+
+ // this is a seprate function so that streaming responses can use just that part
+ writeResultsBody( ctx, codec );
}
-
public SolrDocument getDoc(Document doc) {
SolrDocument solrDoc = new SolrDocument();
for (Fieldable f : doc.getFields()) {
String fieldName = f.name();
- if (returnFields != null && !returnFields.contains(fieldName)) continue;
+ if( !returnFields.wantsField(fieldName) )
+ continue;
SchemaField sf = schema.getFieldOrNull(fieldName);
FieldType ft = null;
if(sf != null) ft =sf.getType();
Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/CSVResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/CSVResponseWriter.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/CSVResponseWriter.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/CSVResponseWriter.java Mon May 9 13:19:28 2011
@@ -34,6 +34,7 @@ import org.apache.solr.schema.SchemaFiel
import org.apache.solr.schema.StrField;
import org.apache.solr.search.DocIterator;
import org.apache.solr.search.DocList;
+import org.apache.solr.search.ReturnFields;
import org.apache.solr.search.SolrIndexSearcher;
import java.io.CharArrayWriter;
@@ -159,7 +160,6 @@ class CSVWriter extends TextResponseWrit
ResettableFastWriter mvWriter = new ResettableFastWriter(); // writer used for multi-valued fields
String NullValue;
- boolean returnScore = false;
public CSVWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) {
@@ -236,12 +236,9 @@ class CSVWriter extends TextResponseWrit
// encapsulator will already be disabled if it wasn't specified
}
- returnScore = returnFields != null && returnFields.contains("score");
- boolean needListOfFields = returnFields==null || returnFields.size()==0 || (returnFields.size()==1 && returnScore) || returnFields.contains("*");
- Collection<String> fields = returnFields;
-
+ Collection<String> fields = returnFields.getLuceneFieldNames();
Object responseObj = rsp.getValues().get("response");
- if (needListOfFields) {
+ if (fields==null) {
if (responseObj instanceof SolrDocumentList) {
// get the list of fields from the SolrDocumentList
fields = new LinkedHashSet<String>();
@@ -252,7 +249,7 @@ class CSVWriter extends TextResponseWrit
// get the list of fields from the index
fields = req.getSearcher().getFieldNames();
}
- if (returnScore) {
+ if (returnFields.wantsScore()) {
fields.add("score");
} else {
fields.remove("score");
@@ -327,11 +324,15 @@ class CSVWriter extends TextResponseWrit
printer.println();
}
-
- if (responseObj instanceof DocList) {
- writeDocList(null, (DocList)responseObj, null, null);
+ if (responseObj instanceof ResultContext ) {
+ writeDocuments(null, (ResultContext)responseObj, returnFields );
+ }
+ else if (responseObj instanceof DocList) {
+ ResultContext ctx = new ResultContext();
+ ctx.docs = (DocList)responseObj;
+ writeDocuments(null, ctx, returnFields );
} else if (responseObj instanceof SolrDocumentList) {
- writeSolrDocumentList(null, (SolrDocumentList)responseObj, null, null);
+ writeSolrDocumentList(null, (SolrDocumentList)responseObj, returnFields );
}
}
@@ -346,56 +347,21 @@ class CSVWriter extends TextResponseWrit
public void writeNamedList(String name, NamedList val) throws IOException {
}
- @Override
- public void writeDoc(String name, Document doc, Set<String> returnFields, float score, boolean includeScore) throws IOException {
- pass++;
-
- for (Fieldable field: doc.getFields()) {
- CSVField csvField = csvFields.get(field.name());
- if (csvField == null) continue;
- if (csvField.tmp != pass) {
- csvField.tmp = pass;
- csvField.values.clear();
- }
- csvField.values.add(field);
- }
-
- for (CSVField csvField : csvFields.values()) {
- if (csvField.name.equals("score")) {
- writeFloat("score", score);
- continue;
- }
- if (csvField.tmp != pass) {
- writeNull(csvField.name);
- continue;
- }
-
- if (csvField.sf.multiValued() || csvField.values.size() > 1) {
- mvWriter.reset();
- csvField.mvPrinter.reset();
- // switch the printer to use the multi-valued one
- CSVPrinter tmp = printer;
- printer = csvField.mvPrinter;
- for (Fieldable fval : csvField.values) {
- csvField.sf.getType().write(this, csvField.name, fval);
- }
- printer = tmp; // restore the original printer
-
- mvWriter.freeze();
- printer.print(mvWriter.getFrozenBuf(), 0, mvWriter.getFrozenSize(), true);
- } else {
- assert csvField.values.size() == 1;
- csvField.sf.getType().write(this,csvField.name,csvField.values.get(0));
- }
- }
+ public void writeStartDocumentList(String name,
+ long start, int size, long numFound, Float maxScore) throws IOException
+ {
+ // nothing
+ }
- printer.println();
+ public void writeEndDocumentList() throws IOException
+ {
+ // nothing
}
//NOTE: a document cannot currently contain another document
List tmpList;
@Override
- public void writeSolrDocument(String name, SolrDocument doc, Set<String> returnFields, Map pseudoFields) throws IOException {
+ public void writeSolrDocument(String name, SolrDocument doc, ReturnFields returnFields, int idx ) throws IOException {
if (tmpList == null) {
tmpList = new ArrayList(1);
tmpList.add(null);
@@ -446,26 +412,6 @@ class CSVWriter extends TextResponseWrit
}
@Override
- public void writeDocList(String name, DocList ids, Set<String> fields, Map otherFields) throws IOException {
- int sz=ids.size();
- SolrIndexSearcher searcher = req.getSearcher();
- DocIterator iterator = ids.iterator();
- for (int i=0; i<sz; i++) {
- int id = iterator.nextDoc();
- Document doc = searcher.doc(id, fields);
- writeDoc(null, doc, fields, (returnScore ? iterator.score() : 0.0f), returnScore);
- }
- }
-
- Map scoreMap = new HashMap(1);
- @Override
- public void writeSolrDocumentList(String name, SolrDocumentList docs, Set<String> fields, Map otherFields) throws IOException {
- for (SolrDocument doc : docs) {
- writeSolrDocument(name, doc, fields, otherFields);
- }
- }
-
- @Override
public void writeStr(String name, String val, boolean needsEscaping) throws IOException {
printer.print(val, needsEscaping);
}
Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/JSONResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/JSONResponseWriter.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/JSONResponseWriter.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/JSONResponseWriter.java Mon May 9 13:19:28 2011
@@ -17,24 +17,24 @@
package org.apache.solr.response;
-import org.apache.lucene.document.Document;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
import org.apache.lucene.document.Fieldable;
import org.apache.lucene.util.StringHelper;
import org.apache.solr.common.SolrDocument;
-import org.apache.solr.common.SolrDocumentList;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.schema.SchemaField;
-import org.apache.solr.schema.TextField;
-import org.apache.solr.search.DocIterator;
-import org.apache.solr.search.DocList;
-import org.apache.solr.search.SolrIndexSearcher;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.*;
+import org.apache.solr.search.ReturnFields;
/**
* @version $Id$
@@ -73,7 +73,6 @@ class JSONWriter extends TextResponseWri
private static final String JSON_NL_ARROFMAP="arrmap";
private static final String JSON_WRAPPER_FUNCTION="json.wrf";
-
public JSONWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) {
super(writer, req, rsp);
namedListStyle = StringHelper.intern(req.getParams().get(JSON_NL_STYLE, JSON_NL_FLAT));
@@ -312,94 +311,21 @@ class JSONWriter extends TextResponseWri
}
}
- public void writeDoc(String name, Collection<Fieldable> fields, Set<String> returnFields, Map pseudoFields) throws IOException {
- writeMapOpener(-1); // no trivial way to determine map size
- incLevel();
-
- HashMap<String, MultiValueField> multi = new HashMap<String, MultiValueField>();
-
- boolean first=true;
-
- for (Fieldable ff : fields) {
- String fname = ff.name();
- if (returnFields!=null && !returnFields.contains(fname)) {
- continue;
- }
-
- // if the field is multivalued, it may have other values further on... so
- // build up a list for each multi-valued field.
- SchemaField sf = schema.getField(fname);
- if (sf.multiValued()) {
- MultiValueField mf = multi.get(fname);
- if (mf==null) {
- mf = new MultiValueField(sf, ff);
- multi.put(fname, mf);
- } else {
- mf.fields.add(ff);
- }
- } else {
- // not multi-valued, so write it immediately.
- if (first) {
- first=false;
- } else {
- writeMapSeparator();
- }
- indent();
- writeKey(fname,true);
- sf.write(this, fname, ff);
- }
- }
-
- for(MultiValueField mvf : multi.values()) {
- if (first) {
- first=false;
- } else {
- writeMapSeparator();
- }
-
- indent();
- writeKey(mvf.sfield.getName(), true);
-
- boolean indentArrElems=false;
- if (doIndent) {
- // heuristic... TextField is probably the only field type likely to be long enough
- // to warrant indenting individual values.
- indentArrElems = (mvf.sfield.getType() instanceof TextField);
- }
-
- writeArrayOpener(-1); // no trivial way to determine array size
- boolean firstArrElem=true;
- incLevel();
-
- for (Fieldable ff : mvf.fields) {
- if (firstArrElem) {
- firstArrElem=false;
- } else {
- writeArraySeparator();
- }
- if (indentArrElems) indent();
- mvf.sfield.write(this, null, ff);
- }
- writeArrayCloser();
- decLevel();
- }
-
- if (pseudoFields !=null && pseudoFields.size()>0) {
- writeMap(null,pseudoFields,true,first);
- }
-
- decLevel();
- writeMapCloser();
- }
-
@Override
- public void writeSolrDocument(String name, SolrDocument doc, Set<String> returnFields, Map pseudoFields) throws IOException {
- writeMapOpener(-1); // no trivial way to determine map size
- // TODO: could easily figure out size for SolrDocument if needed...
+ public void writeSolrDocument(String name, SolrDocument doc, ReturnFields returnFields, int idx) throws IOException {
+ if( idx > 0 ) {
+ writeArraySeparator();
+ }
+
+ writeMapOpener(doc.size());
incLevel();
boolean first=true;
for (String fname : doc.getFieldNames()) {
+ if (!returnFields.wantsField(fname)) {
+ continue;
+ }
+
if (first) {
first=false;
}
@@ -424,144 +350,43 @@ class JSONWriter extends TextResponseWri
writeVal(fname, val);
}
}
-
- if (pseudoFields !=null && pseudoFields.size()>0) {
- writeMap(null,pseudoFields,true,first);
- }
}
-
+
decLevel();
writeMapCloser();
}
-
- // reusable map to store the "score" pseudo-field.
- // if a Doc can ever contain another doc, this optimization would have to go.
- private final HashMap scoreMap = new HashMap(1);
-
- @Override
- public void writeDoc(String name, Document doc, Set<String> returnFields, float score, boolean includeScore) throws IOException {
- Map other = null;
- if (includeScore) {
- other = scoreMap;
- scoreMap.put("score",score);
- }
- writeDoc(name, doc.getFields(), returnFields, other);
- }
-
@Override
- public void writeDocList(String name, DocList ids, Set<String> fields, Map otherFields) throws IOException {
- boolean includeScore=false;
- if (fields!=null) {
- includeScore = fields.contains("score");
- if (fields.size()==0 || (fields.size()==1 && includeScore) || fields.contains("*")) {
- fields=null; // null means return all stored fields
- }
- }
-
- int sz=ids.size();
-
- writeMapOpener(includeScore ? 4 : 3);
+ public void writeStartDocumentList(String name,
+ long start, int size, long numFound, Float maxScore) throws IOException
+ {
+ writeMapOpener((maxScore==null) ? 3 : 4);
incLevel();
writeKey("numFound",false);
- writeInt(null,ids.matches());
+ writeLong(null,numFound);
writeMapSeparator();
writeKey("start",false);
- writeInt(null,ids.offset());
+ writeLong(null,start);
- if (includeScore) {
+ if (maxScore!=null) {
writeMapSeparator();
writeKey("maxScore",false);
- writeFloat(null,ids.maxScore());
+ writeFloat(null,maxScore);
}
writeMapSeparator();
// indent();
writeKey("docs",false);
- writeArrayOpener(sz);
+ writeArrayOpener(size);
incLevel();
- boolean first=true;
-
- SolrIndexSearcher searcher = req.getSearcher();
- // be defensive... write out the doc even if we don't have the scores like we should
- includeScore = includeScore && ids.hasScores();
- DocIterator iterator = ids.iterator();
- for (int i=0; i<sz; i++) {
- int id = iterator.nextDoc();
- Document doc = searcher.doc(id, fields);
-
- if (first) {
- first=false;
- } else {
- writeArraySeparator();
- }
- indent();
- writeDoc(null, doc, fields, (includeScore ? iterator.score() : 0.0f), includeScore);
- }
- decLevel();
- writeArrayCloser();
-
- if (otherFields !=null) {
- writeMap(null, otherFields, true, false);
- }
-
- decLevel();
- indent();
- writeMapCloser();
}
-
@Override
- public void writeSolrDocumentList(String name, SolrDocumentList docs, Set<String> fields, Map otherFields) throws IOException {
- boolean includeScore=false;
- if (fields!=null) {
- includeScore = fields.contains("score");
- if (fields.size()==0 || (fields.size()==1 && includeScore) || fields.contains("*")) {
- fields=null; // null means return all stored fields
- }
- }
-
- int sz=docs.size();
-
- writeMapOpener(includeScore ? 4 : 3);
- incLevel();
- writeKey("numFound",false);
- writeLong(null,docs.getNumFound());
- writeMapSeparator();
- writeKey("start",false);
- writeLong(null,docs.getStart());
-
- if (includeScore && docs.getMaxScore() != null) {
- writeMapSeparator();
- writeKey("maxScore",false);
- writeFloat(null,docs.getMaxScore());
- }
- writeMapSeparator();
- // indent();
- writeKey("docs",false);
- writeArrayOpener(sz);
-
- incLevel();
- boolean first=true;
-
- SolrIndexSearcher searcher = req.getSearcher();
- for (SolrDocument doc : docs) {
-
- if (first) {
- first=false;
- } else {
- writeArraySeparator();
- }
- indent();
- writeSolrDocument(null, doc, fields, otherFields);
- }
+ public void writeEndDocumentList() throws IOException
+ {
decLevel();
writeArrayCloser();
- if (otherFields !=null) {
- writeMap(null, otherFields, true, false);
- }
-
decLevel();
indent();
writeMapCloser();
Modified: lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java?rev=1101016&r1=1101015&r2=1101016&view=diff
==============================================================================
--- lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java (original)
+++ lucene/dev/branches/bulkpostings/solr/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java Mon May 9 13:19:28 2011
@@ -17,23 +17,23 @@
package org.apache.solr.response;
-import java.io.Writer;
import java.io.IOException;
-import java.util.*;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Fieldable;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.UnicodeUtil;
+import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.schema.SchemaField;
-import org.apache.solr.search.DocIterator;
-import org.apache.solr.search.DocList;
-import org.apache.solr.search.SolrIndexSearcher;
-import org.apache.solr.common.SolrDocument;
-import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.search.ReturnFields;
+
+
/**
* A description of the PHP serialization format can be found here:
* http://www.hurring.com/scott/code/perl/serialize/
@@ -80,126 +80,53 @@ class PHPSerializedWriter extends JSONWr
writeNamedListAsMapMangled(name,val);
}
- @Override
- public void writeDoc(String name, Collection<Fieldable> fields, Set<String> returnFields, Map pseudoFields) throws IOException {
- ArrayList<Fieldable> single = new ArrayList<Fieldable>();
- LinkedHashMap<String, MultiValueField> multi
- = new LinkedHashMap<String, MultiValueField>();
-
- for (Fieldable ff : fields) {
- String fname = ff.name();
- if (returnFields!=null && !returnFields.contains(fname)) {
- continue;
- }
- // if the field is multivalued, it may have other values further on... so
- // build up a list for each multi-valued field.
- SchemaField sf = schema.getField(fname);
- if (sf.multiValued()) {
- MultiValueField mf = multi.get(fname);
- if (mf==null) {
- mf = new MultiValueField(sf, ff);
- multi.put(fname, mf);
- } else {
- mf.fields.add(ff);
- }
- } else {
- single.add(ff);
- }
- }
-
- // obtain number of fields in doc
- writeArrayOpener(single.size() + multi.size() + ((pseudoFields!=null) ? pseudoFields.size() : 0));
-
- // output single value fields
- for(Fieldable ff : single) {
- SchemaField sf = schema.getField(ff.name());
- writeKey(ff.name(),true);
- sf.write(this, ff.name(), ff);
- }
-
- // output multi value fields
- for(MultiValueField mvf : multi.values()) {
- writeKey(mvf.sfield.getName(), true);
- writeArrayOpener(mvf.fields.size());
- int i = 0;
- for (Fieldable ff : mvf.fields) {
- writeKey(i++, false);
- mvf.sfield.write(this, null, ff);
- }
- writeArrayCloser();
- }
-
- // output pseudo fields
- if (pseudoFields !=null && pseudoFields.size()>0) {
- writeMap(null,pseudoFields,true,false);
- }
- writeArrayCloser();
- }
- @Override
- public void writeDocList(String name, DocList ids, Set<String> fields, Map otherFields) throws IOException {
- boolean includeScore=false;
-
- if (fields!=null) {
- includeScore = fields.contains("score");
- if (fields.size()==0 || (fields.size()==1 && includeScore) || fields.contains("*")) {
- fields=null; // null means return all stored fields
- }
- }
-
- int sz=ids.size();
- writeMapOpener(includeScore ? 4 : 3);
+ public void writeStartDocumentList(String name,
+ long start, int size, long numFound, Float maxScore) throws IOException
+ {
+ writeMapOpener((maxScore==null) ? 3 : 4);
writeKey("numFound",false);
- writeInt(null,ids.matches());
+ writeLong(null,numFound);
writeKey("start",false);
- writeInt(null,ids.offset());
+ writeLong(null,start);
- if (includeScore) {
+ if (maxScore!=null) {
writeKey("maxScore",false);
- writeFloat(null,ids.maxScore());
+ writeFloat(null,maxScore);
}
writeKey("docs",false);
- writeArrayOpener(sz);
-
- SolrIndexSearcher searcher = req.getSearcher();
- DocIterator iterator = ids.iterator();
- for (int i=0; i<sz; i++) {
- int id = iterator.nextDoc();
- Document doc = searcher.doc(id, fields);
- writeKey(i, false);
- writeDoc(null, doc, fields, (includeScore ? iterator.score() : 0.0f), includeScore);
- }
- writeMapCloser();
-
- if (otherFields !=null) {
- writeMap(null, otherFields, true, false);
- }
+ writeArrayOpener(size);
+ }
+ public void writeEndDocumentList() throws IOException
+ {
+ writeArrayCloser(); // doc list
writeMapCloser();
}
@Override
- public void writeSolrDocument(String name, SolrDocument doc, Set<String> returnFields, Map pseudoFields) throws IOException {
+ public void writeSolrDocument(String name, SolrDocument doc, ReturnFields returnFields, int idx) throws IOException
+ {
+ writeKey(idx, false);
+
LinkedHashMap <String,Object> single = new LinkedHashMap<String, Object>();
LinkedHashMap <String,Object> multi = new LinkedHashMap<String, Object>();
- int pseudoSize = pseudoFields != null ? pseudoFields.size() : 0;
for (String fname : doc.getFieldNames()) {
- if(returnFields != null && !returnFields.contains(fname)){
+ if(!returnFields.wantsField(fname)){
continue;
}
Object val = doc.getFieldValue(fname);
- SchemaField sf = schema.getFieldOrNull(fname);
- if (sf != null && sf.multiValued()) {
+ if (val instanceof Collection) {
multi.put(fname, val);
}else{
single.put(fname, val);
}
}
- writeMapOpener(single.size() + multi.size() + pseudoSize);
+ writeMapOpener(single.size() + multi.size());
for(String fname: single.keySet()){
Object val = single.get(fname);
writeKey(fname, true);
@@ -220,51 +147,7 @@ class PHPSerializedWriter extends JSONWr
writeVal(fname, val);
}
}
-
- if (pseudoSize > 0) {
- writeMap(null,pseudoFields,true, false);
- }
- writeMapCloser();
- }
-
-
- @Override
- public void writeSolrDocumentList(String name, SolrDocumentList docs, Set<String> fields, Map otherFields) throws IOException {
- boolean includeScore=false;
- if (fields!=null) {
- includeScore = fields.contains("score");
- if (fields.size()==0 || (fields.size()==1 && includeScore) || fields.contains("*")) {
- fields=null; // null means return all stored fields
- }
- }
-
- int sz = docs.size();
-
- writeMapOpener(includeScore ? 4 : 3);
-
- writeKey("numFound",false);
- writeLong(null,docs.getNumFound());
-
- writeKey("start",false);
- writeLong(null,docs.getStart());
-
- if (includeScore && docs.getMaxScore() != null) {
- writeKey("maxScore",false);
- writeFloat(null,docs.getMaxScore());
- }
-
- writeKey("docs",false);
-
- writeArrayOpener(sz);
- for (int i=0; i<sz; i++) {
- writeKey(i, false);
- writeSolrDocument(null, docs.get(i), fields, otherFields);
- }
- writeArrayCloser();
-
- if (otherFields !=null) {
- writeMap(null, otherFields, true, false);
- }
+
writeMapCloser();
}