lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sh...@apache.org
Subject svn commit: r1454862 [46/49] - in /lucene/dev/branches/lucene4258: ./ dev-tools/ dev-tools/eclipse/ dev-tools/idea/.idea/ dev-tools/idea/.idea/libraries/ dev-tools/idea/lucene/demo/ dev-tools/idea/lucene/facet/ dev-tools/idea/lucene/highlighter/ dev-to...
Date Sun, 10 Mar 2013 15:05:21 GMT
Modified: lucene/dev/branches/lucene4258/solr/example/example-DIH/solr/tika/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/example/example-DIH/solr/tika/conf/solrconfig.xml?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/example/example-DIH/solr/tika/conf/solrconfig.xml (original)
+++ lucene/dev/branches/lucene4258/solr/example/example-DIH/solr/tika/conf/solrconfig.xml Sun Mar 10 15:04:57 2013
@@ -34,7 +34,7 @@
   <lib dir="../../../../contrib/extraction/lib" />
 
   <lib dir="../../../../contrib/dataimporthandler/lib/" regex=".*jar$" />
-  <lib dir="../../../../dist/" regex="apache-solr-dataimporthandler-.*\.jar" />
+  <lib dir="../../../../dist/" regex="solr-dataimporthandler-.*\.jar" />
 
   <!-- <indexConfig> section could go here, but we want the defaults -->
 
@@ -188,7 +188,7 @@
     -->
   <requestDispatcher handleSelect="true" >
     <!--Make sure your system has some authentication before enabling remote streaming!  -->
-    <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
+    <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" formdataUploadLimitInKB="2048" />
         
     <!-- Set HTTP caching related parameters (for proxy caches and clients).
           

Modified: lucene/dev/branches/lucene4258/solr/example/multicore/core0/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/example/multicore/core0/conf/solrconfig.xml?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/example/multicore/core0/conf/solrconfig.xml (original)
+++ lucene/dev/branches/lucene4258/solr/example/multicore/core0/conf/solrconfig.xml Sun Mar 10 15:04:57 2013
@@ -47,7 +47,7 @@
   <requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" /> 
 
   <requestDispatcher handleSelect="true" >
-    <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
+    <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" formdataUploadLimitInKB="2048" />
   </requestDispatcher>
   
   <requestHandler name="standard" class="solr.StandardRequestHandler" default="true" />

Modified: lucene/dev/branches/lucene4258/solr/example/multicore/core1/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/example/multicore/core1/conf/solrconfig.xml?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/example/multicore/core1/conf/solrconfig.xml (original)
+++ lucene/dev/branches/lucene4258/solr/example/multicore/core1/conf/solrconfig.xml Sun Mar 10 15:04:57 2013
@@ -47,7 +47,7 @@
   <requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" /> 
 
   <requestDispatcher handleSelect="true" >
-    <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" />
+    <requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" formdataUploadLimitInKB="2048" />
   </requestDispatcher>
   
   <requestHandler name="standard" class="solr.StandardRequestHandler" default="true" />

Modified: lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/lang/contractions_fr.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/lang/contractions_fr.txt?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/lang/contractions_fr.txt (original)
+++ lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/lang/contractions_fr.txt Sun Mar 10 15:04:57 2013
@@ -7,3 +7,9 @@ qu
 n
 s
 j
+d
+c
+jusqu
+quoiqu
+lorsqu
+puisqu

Modified: lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/schema.xml?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/schema.xml (original)
+++ lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/schema.xml Sun Mar 10 15:04:57 2013
@@ -70,6 +70,15 @@
        <types> fieldType section
      indexed: true if this field should be indexed (searchable or sortable)
      stored: true if this field should be retrievable
+     docValues: true if this field should have doc values. Doc values are
+       useful for faceting, grouping, sorting and function queries. Although not
+       required, doc values will make the index faster to load, more
+       NRT-friendly and more memory-efficient. They however come with some
+       limitations: they are currently only supported by StrField, UUIDField
+       and all Trie*Fields, and depending on the field type, they might
+       require the field to be single-valued, be required or have a default
+       value (check the documentation of the field type you're interested in
+       for more information)
      multiValued: true if this field may contain multiple values per document
      omitNorms: (expert) set to true to omit the norms associated with
        this field (this disables length normalization and index-time
@@ -156,11 +165,15 @@
 
    <field name="_version_" type="long" indexed="true" stored="true"/>
 
-   <!-- Uncommenting the following will create a "timestamp" field using
-        a default value of "NOW" to indicate when each document was indexed.
-     -->
    <!--
-   <field name="timestamp" type="date" indexed="true" stored="true" default="NOW" multiValued="false"/>
+     Some fields such as popularity and manu_exact could be modified to
+     leverage doc values:
+     <field name="popularity" type="int" indexed="true" stored="true" docValues="true" default="0" />
+     <field name="manu_exact" type="string" indexed="false" stored="false" docValues="true" default="" />
+
+     Although it would make indexing slightly slower and the index bigger, it
+     would also make the index faster to load, more memory-efficient and more
+     NRT-friendly.
      -->
 
    <!-- Dynamic field definitions allow using convention over configuration
@@ -282,7 +295,10 @@
        standard package such as org.apache.solr.analysis
     -->
 
-    <!-- The StrField type is not analyzed, but indexed/stored verbatim. -->
+    <!-- The StrField type is not analyzed, but indexed/stored verbatim.
+       It supports doc values but in that case the field needs to be
+       single-valued and either required or have a default value.
+      -->
     <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
 
     <!-- boolean type: "true" or "false" -->
@@ -306,6 +322,9 @@
 
     <!--
       Default numeric field types. For faster range queries, consider the tint/tfloat/tlong/tdouble types.
+
+      These fields support doc values, but they require the field to be
+      single-valued and either be required or have a default value.
     -->
     <fieldType name="int" class="solr.TrieIntField" precisionStep="0" positionIncrementGap="0"/>
     <fieldType name="float" class="solr.TrieFloatField" precisionStep="0" positionIncrementGap="0"/>

Modified: lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/solrconfig.xml?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/solrconfig.xml (original)
+++ lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/solrconfig.xml Sun Mar 10 15:04:57 2013
@@ -70,16 +70,16 @@
        with their external dependencies.
     -->
   <lib dir="../../../contrib/extraction/lib" regex=".*\.jar" />
-  <lib dir="../../../dist/" regex="apache-solr-cell-\d.*\.jar" />
+  <lib dir="../../../dist/" regex="solr-cell-\d.*\.jar" />
 
   <lib dir="../../../contrib/clustering/lib/" regex=".*\.jar" />
-  <lib dir="../../../dist/" regex="apache-solr-clustering-\d.*\.jar" />
+  <lib dir="../../../dist/" regex="solr-clustering-\d.*\.jar" />
 
   <lib dir="../../../contrib/langid/lib/" regex=".*\.jar" />
-  <lib dir="../../../dist/" regex="apache-solr-langid-\d.*\.jar" />
+  <lib dir="../../../dist/" regex="solr-langid-\d.*\.jar" />
 
   <lib dir="../../../contrib/velocity/lib" regex=".*\.jar" />
-  <lib dir="../../../dist/" regex="apache-solr-velocity-\d.*\.jar" />
+  <lib dir="../../../dist/" regex="solr-velocity-\d.*\.jar" />
 
   <!-- If a 'dir' option (with or without a regex) is used and nothing
        is found that matches, it will be ignored
@@ -121,6 +121,17 @@
   <directoryFactory name="DirectoryFactory" 
                     class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/> 
 
+  <!-- The CodecFactory for defining the format of the inverted index.
+       The default implementation is SchemaCodecFactory, which is the official Lucene
+       index format, but hooks into the schema to provide per-field customization of
+       the postings lists and per-document values in the fieldType element
+       (postingsFormat/docValuesFormat). Note that most of the alternative implementations
+       are experimental, so if you choose to customize the index format, its a good
+       idea to convert back to the official format e.g. via IndexWriter.addIndexes(IndexReader)
+       before upgrading to a newer version to avoid unnecessary reindexing.
+  -->
+  <codecFactory class="solr.SchemaCodecFactory"/>
+
   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Index Config - These settings control low-level behavior of indexing
        Most example settings here show the default value, but are commented
@@ -211,7 +222,7 @@
          More details on the nuances of each LockFactory...
          http://wiki.apache.org/lucene-java/AvailableLockFactories
     -->
-    <!-- <lockType>native</lockType> -->
+    <lockType>${solr.lock.type:native}</lockType>
 
     <!-- Unlock On Startup
 
@@ -220,7 +231,7 @@
          processes to safely access a lucene index, and should be used
          with care. Default is "false".
 
-         This is not needed if lock type is 'none' or 'single'
+         This is not needed if lock type is 'single'
      -->
     <!--
     <unlockOnStartup>false</unlockOnStartup>
@@ -239,12 +250,9 @@
       -->
 
     <!-- Commit Deletion Policy
-
          Custom deletion policies can be specified here. The class must
          implement org.apache.lucene.index.IndexDeletionPolicy.
 
-         http://lucene.apache.org/java/3_5_0/api/core/org/apache/lucene/index/IndexDeletionPolicy.html
-
          The default Solr IndexDeletionPolicy implementation supports
          deleting index commit points on number of commits, age of
          commit point and optimized status.
@@ -304,6 +312,16 @@
   <!-- The default high-performance update handler -->
   <updateHandler class="solr.DirectUpdateHandler2">
 
+    <!-- Enables a transaction log, used for real-time get, durability, and
+         and solr cloud replica recovery.  The log can grow as big as
+         uncommitted changes to the index, so use of a hard autoCommit
+         is recommended (see below).
+         "dir" - the target directory for transaction logs, defaults to the
+                solr data directory.  --> 
+    <updateLog>
+      <str name="dir">${solr.ulog.dir:}</str>
+    </updateLog>
+ 
     <!-- AutoCommit
 
          Perform a hard commit automatically under certain conditions.
@@ -316,11 +334,14 @@
                    commit before automatically triggering a new commit.
 
          maxTime - Maximum amount of time in ms that is allowed to pass
-                   since a document was added before automaticly
+                   since a document was added before automatically
                    triggering a new commit. 
          openSearcher - if false, the commit causes recent index changes
-         to be flushed to stable storage, but does not cause a new
-         searcher to be opened to make those changes visible.
+           to be flushed to stable storage, but does not cause a new
+           searcher to be opened to make those changes visible.
+
+         If the updateLog is enabled, then it's highly recommended to
+         have some sort of hard autoCommit to limit the log size.
       -->
      <autoCommit> 
        <maxTime>15000</maxTime> 
@@ -370,14 +391,6 @@
        </listener>
       -->
 
-    <!-- Enables a transaction log, currently used for real-time get.
-         "dir" - the target directory for transaction logs, defaults to the
-            solr data directory.  --> 
-    <updateLog>
-      <str name="dir">${solr.ulog.dir:}</str>
-    </updateLog>
-   
-
   </updateHandler>
   
   <!-- IndexReaderFactory
@@ -657,9 +670,14 @@
          enableRemoteStreaming - enables use of the stream.file
          and stream.url parameters for specifying remote streams.
 
-         multipartUploadLimitInKB - specifies the max size of
+         multipartUploadLimitInKB - specifies the max size (in KiB) of
          Multipart File Uploads that Solr will allow in a Request.
          
+         formdataUploadLimitInKB - specifies the max size (in KiB) of
+         form data (application/x-www-form-urlencoded) sent via
+         POST. You can use POST to pass request parameters not
+         fitting into the URL.
+         
          *** WARNING ***
          The settings below authorize Solr to fetch remote files, You
          should make sure your system has some authentication before
@@ -667,7 +685,8 @@
 
       --> 
     <requestParsers enableRemoteStreaming="true" 
-                    multipartUploadLimitInKB="2048000" />
+                    multipartUploadLimitInKB="2048000"
+                    formdataUploadLimitInKB="2048"/>
 
     <!-- HTTP Caching
 
@@ -1115,7 +1134,7 @@
 
        http://wiki.apache.org/solr/SolrReplication 
 
-       It is also neccessary for SolrCloud to function (in Cloud mode, the 
+       It is also necessary for SolrCloud to function (in Cloud mode, the
        replication handler is used to bulk transfer segments when nodes 
        are added or need to recover).
 
@@ -1124,7 +1143,7 @@
   <requestHandler name="/replication" class="solr.ReplicationHandler" > 
     <!--
        To enable simple master/slave replication, uncomment one of the 
-       sections below, depending on wether this solr instance should be 
+       sections below, depending on whether this solr instance should be
        the "master" or a "slave".  If this instance is a "slave" you will 
        also need to fill in the masterUrl to point to a real machine.
     -->
@@ -1338,7 +1357,7 @@
 
        http://wiki.apache.org/solr/ClusteringComponent
 
-       You'll need to set the solr.cluster.enabled system property
+       You'll need to set the solr.clustering.enabled system property
        when running solr to run with clustering enabled:
 
             java -Dsolr.clustering.enabled=true -jar start.jar

Modified: lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/VM_global_library.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/VM_global_library.vm?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/VM_global_library.vm (original)
+++ lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/VM_global_library.vm Sun Mar 10 15:04:57 2013
@@ -26,7 +26,9 @@
 
 #macro(group)#if($request.params.getBool("group") == true)&group=true#end#if($request.params.get("group.field"))#foreach($grp in $request.params.getParams('group.field'))&group.field=$grp#end#end#end
 
-#macro(lensNoQ)?#if($request.params.getParams('fq') and $list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end#debug#boostPrice#annotate#spatial#qOpts#group#end
+#macro(sort $p)#if($p)#foreach($s in $p)&sort=$esc.url($s)#end#end#end
+
+#macro(lensNoQ)?#if($request.params.getParams('fq') and $list.size($request.params.getParams('fq')) > 0)&#fqs($request.params.getParams('fq'))#end#sort($request.params.getParams('sort'))#debug#boostPrice#annotate#spatial#qOpts#group#end
 #macro(lens)#lensNoQ#q#end
         
 

Modified: lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/head.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/head.vm?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/head.vm (original)
+++ lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/head.vm Sun Mar 10 15:04:57 2013
@@ -20,7 +20,11 @@
              'v.template': 'suggest'
            }
          }
-      );
+      ).keydown(function(e){
+        if (e.keyCode === 13){
+          $("#query-form").trigger('submit');
+        }
+      });
 
       // http://localhost:8983/solr/terms?terms.fl=name&terms.prefix=i&terms.sort=count
     });

Modified: lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/jquery.autocomplete.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/jquery.autocomplete.js?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/jquery.autocomplete.js (original)
+++ lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/jquery.autocomplete.js Sun Mar 10 15:04:57 2013
@@ -325,6 +325,7 @@ $.Autocompleter = function(input, option
 		if (!options.matchCase)
 			term = term.toLowerCase();
 		var data = cache.load(term);
+		data = null; // Avoid buggy cache and go to Solr every time 
 		// recieve the cached data
 		if (data && data.length) {
 			success(term, data);
@@ -398,7 +399,7 @@ $.Autocompleter.defaults = {
 	max: 100,
 	mustMatch: false,
 	extraParams: {},
-	selectFirst: true,
+	selectFirst: false,
 	formatItem: function(row) { return row[0]; },
 	formatMatch: null,
 	autoFill: false,

Modified: lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/richtext-doc.vm
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/richtext-doc.vm?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/richtext-doc.vm (original)
+++ lucene/dev/branches/lucene4258/solr/example/solr/collection1/conf/velocity/richtext-doc.vm Sun Mar 10 15:04:57 2013
@@ -1,3 +1,59 @@
+## Mimetype to extension map for detecting file type and show icon
+## List of types match the icons in /solr/img/filetypes
+#set($extMap = {"application/x-7z-compressed": "7z",
+                 "application/postscript": "ai",
+                 "application/pgp-signature": "asc",
+                 "application/octet-stream": "bin",
+                 "application/x-bzip2": "bz2",
+                 "text/x-c": "c",
+                 "application/vnd.ms-htmlhelp": "chm",
+                 "application/java-vm": "class",
+                 "text/css": "css",
+                 "text/csv": "csv",
+                 "application/x-debian-package": "deb",
+                 "application/msword": "doc",
+                 "message/rfc822": "eml",
+                 "image/gif": "gif",
+                 "application/winhlp": "hlp",
+                 "text/html": "html",
+                 "application/java-archive": "jar",
+                 "text/x-java-source": "java",
+                 "image/jpeg": "jpeg",
+                 "application/javascript": "js",
+                 "application/vnd.oasis.opendocument.chart": "odc",
+                 "application/vnd.oasis.opendocument.formula": "odf",
+                 "application/vnd.oasis.opendocument.graphics": "odg",
+                 "application/vnd.oasis.opendocument.image": "odi",
+                 "application/vnd.oasis.opendocument.presentation": "odp",
+                 "application/vnd.oasis.opendocument.spreadsheet": "ods",
+                 "application/vnd.oasis.opendocument.text": "odt",
+                 "application/pdf": "pdf",
+                 "application/pgp-encrypted": "pgp",
+                 "image/png": "png",
+                 "application/vnd.ms-powerpoint": "ppt",
+                 "audio/x-pn-realaudio": "ram",
+                 "application/x-rar-compressed": "rar",
+                 "application/vnd.rn-realmedia": "rm",
+                 "application/rtf": "rtf",
+                 "application/x-shockwave-flash": "swf",
+                 "application/vnd.sun.xml.calc": "sxc",
+                 "application/vnd.sun.xml.draw": "sxd",
+                 "application/vnd.sun.xml.impress": "sxi",
+                 "application/vnd.sun.xml.writer": "sxw",
+                 "application/x-tar": "tar",
+                 "application/x-tex": "tex",
+                 "text/plain": "txt",
+                 "text/x-vcard": "vcf",
+                 "application/vnd.visio": "vsd",
+                 "audio/x-wav": "wav",
+                 "audio/x-ms-wma": "wma",
+                 "video/x-ms-wmv": "wmv",
+                 "application/vnd.ms-excel": "xls",
+                 "application/xml": "xml",
+                 "application/x-xpinstall": "xpi",
+                 "application/zip": "zip"})
+
+
 #if($doc.getFieldValue('title'))
   #set($title = $esc.html($doc.getFirstValue('title')))
 #else
@@ -13,10 +69,16 @@
 #set($supportedtypes = "7z;ai;aiff;asc;audio;bin;bz2;c;cfc;cfm;chm;class;conf;cpp;cs;css;csv;deb;divx;doc;dot;eml;enc;file;gif;gz;hlp;htm;html;image;iso;jar;java;jpeg;jpg;js;lua;m;mm;mov;mp3;mpg;odc;odf;odg;odi;odp;ods;odt;ogg;pdf;pgp;php;pl;png;ppt;ps;py;ram;rar;rb;rm;rpm;rtf;sig;sql;swf;sxc;sxd;sxi;sxw;tar;tex;tgz;txt;vcf;video;vsd;wav;wma;wmv;xls;xml;xpi;xvid;zip")
 #set($ct = $list.get($doc.getFirstValue('content_type').split(";"),0))
 #set($filename = $doc.getFieldValue('resourcename'))
-#set($filetype = $mimeToExt.get($ct))
+
+#set($filetype = false)
+#set($filetype = $extMap.get($ct))
+##TODO: falling back to file extension is convenient, except when you don't have an icon for that extension
+##      example "application/vnd.openxmlformats-officedocument.wordprocessingml.document" document
+##        with a .docx extension.  It'd be nice to fall back to an "unknown" or the existing "file" type
+##      We sort of do this below, but only if the filename has no extension (anything after the last dot).
 #if(!$filetype)#set($filetype = $filename.substring($filename.lastIndexOf(".")).substring(1))#end
-#if(!$filetype)#set($filetype = "file")#end
-#if(!$supportedtypes.contains($filetype))#set($filetype = "file")#end
+##if(!$filetype)#set($filetype = "file")#end
+##if(!$supportedtypes.contains($filetype))#set($filetype = "file")#end
 <div class="result-title">
 ## Small file type icons from http://www.splitbrain.org/projects/file_icons (public domain)
 <img src="#{url_root}/img/filetypes/${filetype}.png" align="center">
@@ -29,7 +91,7 @@
 #if($ct) ($ct)#end
 </div>
 #if($doc.getFieldValue('author'))<div>Author: #field('author')</div>#end
-#if($doc.getFieldValue('last_modified'))<div>Last-modified: #field('last_modified')</div>#end
+#if($doc.getFieldValue('last_modified'))<div>last-modified: #field('last_modified')</div>#end
 <div class="result-body">#field('content')</div>
 <div class="mlt">
   #set($mlt = $mltResults.get($docId))

Modified: lucene/dev/branches/lucene4258/solr/site/html/tutorial.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/site/html/tutorial.html?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/site/html/tutorial.html (original)
+++ lucene/dev/branches/lucene4258/solr/site/html/tutorial.html Sun Mar 10 15:04:57 2013
@@ -310,7 +310,7 @@ make many changes to an index in a batch
 There is also an <span class="codefrag">optimize</span> command that does the 
 same things as <span class="codefrag">commit</span>, but also forces all index 
 segments to be merged into a single segment -- this can be very resource 
-intsenive, but may be worthwhile for improving search speed if your index 
+intensive, but may be worthwhile for improving search speed if your index
 changes very infrequently.
 </p>
 <p>
@@ -411,7 +411,7 @@ and is useful when testing or debugging 
 <h2 class="boxed">Highlighting</h2>
 <div class="section">
 <p>
-    Hit highlighting returns relevent snippets of each returned document, and highlights
+    Hit highlighting returns relevant snippets of each returned document, and highlights
     terms from the query within those context snippets.
   </p>
 <p>
@@ -522,7 +522,7 @@ Try it out at
 <p>
     The <a href="http://wiki.apache.org/solr/SchemaXml">schema</a> defines
     the fields in the index and what type of analysis is applied to them.  The current schema your collection is using
-    may be viewed directly via the <a href="http://localhost:8983/solr/#/collection1/schema">Schema tab</a> in the Admin UI, or explored dynamicly using the <a href="http://localhost:8983/solr/#/collection1/schema-browser">Schema Browser tab</a>.
+    may be viewed directly via the <a href="http://localhost:8983/solr/#/collection1/schema">Schema tab</a> in the Admin UI, or explored dynamically using the <a href="http://localhost:8983/solr/#/collection1/schema-browser">Schema Browser tab</a>.
 </p>
 <p>
 The best analysis components (tokenization and filtering) for your textual 
@@ -616,7 +616,7 @@ Mousing over the section label to the le
 <p>
 When both <a href="http://localhost:8983/solr/#/collection1/analysis?analysis.fieldvalue=Canon+Power-Shot+SD500&amp;analysis.query=power+shot+sd-500&amp;analysis.fieldtype=text_en_splitting&amp;verbose_output=0">Index and Query</a>
 values are provided, two tables will be displayed side by side showing the 
-results of each chain.  Terms in the Index chain results that are equivilent 
+results of each chain.  Terms in the Index chain results that are equivalent
 to the final terms produced by the Query chain will be highlighted.
 </p>
 <p>

Modified: lucene/dev/branches/lucene4258/solr/solrj/ivy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/ivy.xml?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/ivy.xml (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/ivy.xml Sun Mar 10 15:04:57 2013
@@ -21,11 +21,25 @@
 
     <dependencies>
       <dependency org="org.apache.zookeeper" name="zookeeper" rev="3.4.5" transitive="false"/>
-      <dependency org="org.slf4j" name="log4j-over-slf4j" rev="1.6.4" transitive="false"/>
-      <dependency org="org.apache.httpcomponents" name="httpcore" rev="4.1.4" transitive="false"/>
-      <dependency org="org.apache.httpcomponents" name="httpclient" rev="4.1.3" transitive="false"/>
-      <dependency org="org.apache.httpcomponents" name="httpmime" rev="4.1.3" transitive="false"/>
-      <dependency org="commons-io" name="commons-io" rev="2.1" transitive="false"/>
+      <dependency org="org.apache.httpcomponents" name="httpclient" rev="4.2.3" transitive="false"/>
+      <!--
+        The httpmime rev should be kept in sync with the httpclient rev, since both the
+        httpclient and the httpmime modules are sub-modules of the httpcomponents-client
+        module, and both sub-modules draw their version from the httpcomponents-client
+        parent POM.
+       -->
+      <dependency org="org.apache.httpcomponents" name="httpmime" rev="4.2.3" transitive="false"/>
+      <!--
+        The httpcore rev should be drawn from the httpcomponents-client POM (the parent POM
+        of the httpclient POM - see the comment above) - the httpclient version and the httpcore
+        version are NOT always in sync with each other.
+
+        E.g. httpclient v4.2.3 depends on httpcore v4.2.2 - see the httpcomponents-client POM
+        - look for <httpcore.version> under <properties>:
+        https://svn.apache.org/repos/asf/httpcomponents/httpclient/tags/4.2.3/pom.xml
+       -->
+      <dependency org="org.apache.httpcomponents" name="httpcore" rev="4.2.2" transitive="false"/>
+      <dependency org="commons-io" name="commons-io" rev="${commons-io.version}" transitive="false"/>
       <dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.6.4" transitive="false"/>
       <dependency org="org.codehaus.woodstox" name="wstx-asl" rev="3.2.7" transitive="false"/>
       <dependency org="org.slf4j" name="slf4j-api" rev="1.6.4" transitive="false"/>

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/SolrQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/SolrQuery.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/SolrQuery.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/SolrQuery.java Sun Mar 10 15:04:57 2013
@@ -25,7 +25,10 @@ import org.apache.solr.common.params.Sta
 import org.apache.solr.common.params.TermsParams;
 import org.apache.solr.common.util.DateUtil;
 
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Date;
+import java.util.List;
 import java.util.Locale;
 import java.util.regex.Pattern;
 
@@ -44,6 +47,9 @@ public class SolrQuery extends Modifiabl
       return (this == asc) ? desc : asc;
     }
   }
+
+  /** Maintains a map of current sorts */
+  private List<SortClause> sortClauses;
   
   public SolrQuery() {
     super();
@@ -529,38 +535,230 @@ public class SolrQuery extends Modifiabl
     return this.get(HighlightParams.SIMPLE_POST, "");
   }
 
+  /**
+   * Replaces the sort string with a single sort field.
+   * @deprecated Use {@link #setSort(SortClause)} instead, which is part
+   * of an api handling a wider range of sort specifications.
+   */
+  @Deprecated
   public SolrQuery setSortField(String field, ORDER order) {
     this.remove(CommonParams.SORT);
     addValueToParam(CommonParams.SORT, toSortString(field, order));
     return this;
   }
   
+  /**
+   * Adds a sort field to the end of the sort string.
+   * @deprecated Use {@link #addSort(SortClause)} instead, which is part
+   * of an api handling a wider range of sort specifications.
+   */
+  @Deprecated
   public SolrQuery addSortField(String field, ORDER order) {
     return addValueToParam(CommonParams.SORT, toSortString(field, order));
   }
 
+  /**
+   * Removes a sort field to the end of the sort string.
+   * @deprecated Use {@link #removeSort(SortClause)} instead, which is part
+   * of an api handling a wider range of sort specifications.
+   */
+  @Deprecated
   public SolrQuery removeSortField(String field, ORDER order) {
-    String s = this.get(CommonParams.SORT);
-    String removeSort = toSortString(field, order);
-    if (s != null) {
-      String[] sorts = s.split(",");
-      s = join(sorts, ", ", removeSort);
+    String[] sorts = getSortFields();
+    if (sorts != null) {
+      String removeSort = toSortString(field, order);
+      String s = join(sorts, ",", removeSort);
       if (s.length()==0) s=null;
       this.set(CommonParams.SORT, s);
     }
     return this;
   }
   
+  /**
+   * Gets an array of sort specifications.
+   * @deprecated Use {@link #getSorts()} instead, which is part
+   * of an api handling a wider range of sort specifications.
+   */
+  @Deprecated
   public String[] getSortFields() {
     String s = getSortField();
     if (s==null) return null;
-    return s.split(",");
+    return s.trim().split(", *");
   }
 
+  /**
+   * Gets the raw sort field, as it will be sent to Solr.
+   * <p>
+   * The returned sort field will always contain a serialized version
+   * of the sort string built using {@link #setSort(SortClause)},
+   * {@link #addSort(SortClause)}, {@link #addOrUpdateSort(SortClause)},
+   * {@link #removeSort(SortClause)}, {@link #clearSorts()} and 
+   * {@link #setSorts(List)}.
+   */
   public String getSortField() {
     return this.get(CommonParams.SORT);
   }
   
+  /**
+   * Clears current sort information.
+   *
+   * @return the modified SolrQuery object, for easy chaining
+   * @since 4.2
+   */
+  public SolrQuery clearSorts() {
+    sortClauses = null;
+    serializeSorts();
+    return this;
+  }
+
+  /**
+   * Replaces the current sort information.
+   *
+   * @return the modified SolrQuery object, for easy chaining
+   * @since 4.2
+   */
+  public SolrQuery setSorts(List<SortClause> value) {
+    sortClauses = new ArrayList<SortClause>(value);
+    serializeSorts();
+    return this;
+  }
+
+  /**
+   * Gets an a list of current sort clauses.
+   *
+   * @return an immutable list of current sort clauses
+   * @since 4.2
+   */
+  public List<SortClause> getSorts() {
+    if (sortClauses == null) return Collections.emptyList();
+    else return Collections.unmodifiableList(sortClauses);
+  }
+
+  /**
+   * Replaces the current sort information with a single sort clause
+   *
+   * @return the modified SolrQuery object, for easy chaining
+   * @since 4.2
+   */
+  public SolrQuery setSort(String field, ORDER order) {
+    return setSort(new SortClause(field, order));
+  }
+
+  /**
+   * Replaces the current sort information with a single sort clause
+   *
+   * @return the modified SolrQuery object, for easy chaining
+   * @since 4.2
+   */
+  public SolrQuery setSort(SortClause sortClause) {
+    clearSorts();
+    return addSort(sortClause);
+  }
+
+  /**
+   * Adds a single sort clause to the end of the current sort information.
+   *
+   * @return the modified SolrQuery object, for easy chaining
+   * @since 4.2
+   */
+  public SolrQuery addSort(String field, ORDER order) {
+    return addSort(new SortClause(field, order));
+  }
+
+  /**
+   * Adds a single sort clause to the end of the query.
+   *
+   * @return the modified SolrQuery object, for easy chaining
+   * @since 4.2
+   */
+  public SolrQuery addSort(SortClause sortClause) {
+    if (sortClauses == null) sortClauses = new ArrayList<SortClause>();
+    sortClauses.add(sortClause);
+    serializeSorts();
+    return this;
+  }
+
+  /**
+   * Updates or adds a single sort clause to the query.
+   * If the field is already used for sorting, the order
+   * of the existing field is modified; otherwise, it is
+   * added to the end.
+   * <p>
+   * @return the modified SolrQuery object, for easy chaining
+   * @since 4.2
+   */
+  public SolrQuery addOrUpdateSort(String field, ORDER order) {
+    return addOrUpdateSort(new SortClause(field, order));
+  }
+
+  /**
+   * Updates or adds a single sort field specification to the current sort
+   * information. If the sort field already exist in the sort information map,
+   * it's position is unchanged and the sort order is set; if it does not exist,
+   * it is appended at the end with the specified order..
+   *
+   * @return the modified SolrQuery object, for easy chaining
+   * @since 4.2
+   */
+  public SolrQuery addOrUpdateSort(SortClause sortClause) {
+    if (sortClauses != null) {
+      for (int index=0 ; index<sortClauses.size() ; index++) {
+        SortClause existing = sortClauses.get(index);
+        if (existing.getItem().equals(sortClause.getItem())) {
+          sortClauses.set(index, sortClause);
+          serializeSorts();
+          return this;
+        }
+      }
+    }
+    return addSort(sortClause);
+  }
+
+  /**
+   * Removes a single sort field from the current sort information.
+   *
+   * @return the modified SolrQuery object, for easy chaining
+   * @since 4.2
+   */
+  public SolrQuery removeSort(SortClause sortClause) {
+    return removeSort(sortClause.getItem());
+  }
+
+  /**
+   * Removes a single sort field from the current sort information.
+   *
+   * @return the modified SolrQuery object, for easy chaining
+   * @since 4.2
+   */
+  public SolrQuery removeSort(String itemName) {
+    if (sortClauses != null) {
+      for (SortClause existing : sortClauses) {
+        if (existing.getItem().equals(itemName)) {
+          sortClauses.remove(existing);
+          if (sortClauses.isEmpty()) sortClauses = null;
+          serializeSorts();
+          break;
+        }
+      }
+    }
+    return this;
+  }
+
+  private void serializeSorts() {
+    if (sortClauses == null || sortClauses.isEmpty()) {
+      remove(CommonParams.SORT);
+    } else {
+      StringBuilder sb = new StringBuilder();
+      for (SortClause sortClause : sortClauses) {
+        if (sb.length() > 0) sb.append(",");
+        sb.append(sortClause.getItem());
+        sb.append(" ");
+        sb.append(sortClause.getOrder());
+      }
+      set(CommonParams.SORT, sb.toString());
+    }
+  }
+
   public void setGetFieldStatistics( boolean v )
   {
     this.set( StatsParams.STATS, v );
@@ -823,13 +1021,126 @@ public class SolrQuery extends Modifiabl
   private String join(String[] vals, String sep, String removeVal) {
     StringBuilder sb = new StringBuilder();
     for (int i=0; i<vals.length; i++) {
-      if (removeVal==null || !vals[i].equals(removeVal)) {
-        sb.append(vals[i]);
-        if (i<vals.length-1) {
+      if (!vals[i].equals(removeVal)) {
+        if (sb.length() > 0) {
           sb.append(sep);
         }
+        sb.append(vals[i]);
       }
     }
     return sb.toString().trim();
   }
+
+  /**
+   * A single sort clause, encapsulating what to sort and the sort order.
+   * <p>
+   * The item specified can be "anything sortable" by solr; some examples
+   * include a simple field name, the constant string {@code score}, and functions
+   * such as {@code sum(x_f, y_f)}.
+   * <p>
+   * A SortClause can be created through different mechanisms:
+   * <PRE><code>
+   * new SortClause("product", SolrQuery.ORDER.asc);
+   * new SortClause("product", "asc");
+   * SortClause.asc("product");
+   * SortClause.desc("product");
+   * </code></PRE>
+   */
+  public static class SortClause implements java.io.Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    private final String item;
+    private final ORDER order;
+
+    /**
+     * Creates a SortClause based on item and order
+     * @param item item to sort on
+     * @param order direction to sort
+     */
+    public SortClause(String item, ORDER order) {
+      this.item = item;
+      this.order = order;
+    }
+
+    /**
+     * Creates a SortClause based on item and order
+     * @param item item to sort on
+     * @param order string value for direction to sort
+     */
+    public SortClause(String item, String order) {
+      this(item, ORDER.valueOf(order));
+    }
+
+    /**
+     * Creates an ascending SortClause for an item
+     * @param item item to sort on
+     */
+    public static SortClause create (String item, ORDER order) {
+      return new SortClause(item, order);
+    }
+
+    /**
+     * Creates a SortClause based on item and order
+     * @param item item to sort on
+     * @param order string value for direction to sort
+     */
+    public static SortClause create(String item, String order) {
+      return new SortClause(item, ORDER.valueOf(order));
+    }
+
+    /**
+     * Creates an ascending SortClause for an item
+     * @param item item to sort on
+     */
+    public static SortClause asc (String item) {
+      return new SortClause(item, ORDER.asc);
+    }
+
+    /**
+     * Creates a decending SortClause for an item
+     * @param item item to sort on
+     */
+    public static SortClause desc (String item) {
+      return new SortClause(item, ORDER.desc);
+    }
+
+    /**
+     * Gets the item to sort, typically a function or a fieldname
+     * @return item to sort
+     */
+    public String getItem() {
+      return item;
+    }
+
+    /**
+     * Gets the order to sort
+     * @return order to sort
+     */
+    public ORDER getOrder() {
+      return order;
+    }
+
+    public boolean equals(Object other){
+      if (this == other) return true;
+      if (!(other instanceof SortClause)) return false;
+      final SortClause that = (SortClause) other;
+      return this.getItem().equals(that.getItem()) && this.getOrder().equals(that.getOrder());
+    }
+
+    public int hashCode(){
+      return this.getItem().hashCode();
+    }
+
+    /**
+     * Gets a human readable description of the sort clause.
+     * <p>
+     * The returned string is not suitable for passing to Solr,
+     * but may be useful in debug output and the like.
+     * @return a description of the current sort clause
+     */
+    public String toString() {
+      return "[" + getClass().getSimpleName() + ": item=" + getItem() + "; order=" + getOrder() + "]";
+    }
+  }
 }

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/SolrResponse.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/SolrResponse.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/SolrResponse.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/SolrResponse.java Sun Mar 10 15:04:57 2013
@@ -17,19 +17,47 @@
 
 package org.apache.solr.client.solrj;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.io.Serializable;
 
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrException.ErrorCode;
 import org.apache.solr.common.util.NamedList;
 
 
 /**
  * 
- *
+ * 
  * @since solr 1.3
  */
-public abstract class SolrResponse implements Serializable
-{
+public abstract class SolrResponse implements Serializable {
   public abstract long getElapsedTime();
-  public abstract void setResponse(  NamedList<Object> rsp );
+  
+  public abstract void setResponse(NamedList<Object> rsp);
+  
   public abstract NamedList<Object> getResponse();
+  
+  public static byte[] serializable(SolrResponse response) {
+    try {
+      ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+      ObjectOutputStream outputStream = new ObjectOutputStream(byteStream);
+      outputStream.writeObject(response);
+      return byteStream.toByteArray();
+    } catch (Exception e) {
+      throw new SolrException(ErrorCode.SERVER_ERROR, e);
+    }
+  }
+  
+  public static SolrResponse deserialize(byte[] bytes) {
+    try {
+      ByteArrayInputStream byteStream = new ByteArrayInputStream(bytes);
+      ObjectInputStream inputStream = new ObjectInputStream(byteStream);
+      return (SolrResponse) inputStream.readObject();
+    } catch (Exception e) {
+      throw new SolrException(ErrorCode.SERVER_ERROR, e);
+    }
+  }
 }

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java Sun Mar 10 15:04:57 2013
@@ -114,7 +114,9 @@ public class DocumentObjectBinder {
     }
 
     for (AccessibleObject member : members) {
-      if (member.isAnnotationPresent(Field.class)) {
+      // TODO: Fix below code to use c.isAnnotationPresent(). It was changed
+      // to the null check to work around a bug in JDK 8 b78 (see LUCENE-4808).
+      if (member.getAnnotation(Field.class) != null) {
         member.setAccessible(true);
         fields.add(new DocField(member));
       }

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java Sun Mar 10 15:04:57 2013
@@ -19,10 +19,13 @@ package org.apache.solr.client.solrj.imp
 
 import java.io.IOException;
 import java.net.MalformedURLException;
+import java.net.URLDecoder;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Random;
@@ -36,6 +39,8 @@ import org.apache.solr.client.solrj.Solr
 import org.apache.solr.client.solrj.request.IsUpdateRequest;
 import org.apache.solr.client.solrj.util.ClientUtils;
 import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrException.ErrorCode;
+import org.apache.solr.common.cloud.Aliases;
 import org.apache.solr.common.cloud.ClusterState;
 import org.apache.solr.common.cloud.Slice;
 import org.apache.solr.common.cloud.ZkCoreNodeProps;
@@ -183,13 +188,13 @@ public class CloudSolrServer extends Sol
       reqParams = new ModifiableSolrParams();
     }
     List<String> theUrlList = new ArrayList<String>();
-    if (request.getPath().equals("/admin/collections")) {
+    if (request.getPath().equals("/admin/collections") || request.getPath().equals("/admin/cores")) {
       Set<String> liveNodes = clusterState.getLiveNodes();
       for (String liveNode : liveNodes) {
         int splitPointBetweenHostPortAndContext = liveNode.indexOf("_");
         theUrlList.add("http://"
             + liveNode.substring(0, splitPointBetweenHostPortAndContext) + "/"
-            + liveNode.substring(splitPointBetweenHostPortAndContext + 1));
+            + URLDecoder.decode(liveNode, "UTF-8").substring(splitPointBetweenHostPortAndContext + 1));
       }
     } else {
       String collection = reqParams.get("collection", defaultCollection);
@@ -199,9 +204,21 @@ public class CloudSolrServer extends Sol
             "No collection param specified on request and no default collection has been set.");
       }
       
-      // Extract each comma separated collection name and store in a List.
-      List<String> collectionList = StrUtils.splitSmart(collection, ",", true);
+      Set<String> collectionsList = getCollectionList(clusterState, collection);
+      if (collectionsList.size() == 0) {
+        throw new SolrException(ErrorCode.BAD_REQUEST, "Could not find collection: " + collection);
+      }
+      collection = collectionsList.iterator().next();
       
+      StringBuilder collectionString = new StringBuilder();
+      Iterator<String> it = collectionsList.iterator();
+      for (int i = 0; i < collectionsList.size(); i++) {
+        String col = it.next(); 
+        collectionString.append(col);
+        if (i < collectionsList.size() - 1) {
+          collectionString.append(",");
+        }
+      }
       // TODO: not a big deal because of the caching, but we could avoid looking
       // at every shard
       // when getting leaders if we tweaked some things
@@ -210,9 +227,12 @@ public class CloudSolrServer extends Sol
       // specified,
       // add it to the Map of slices.
       Map<String,Slice> slices = new HashMap<String,Slice>();
-      for (String collectionName : collectionList) {
-        ClientUtils.addSlices(slices, collectionName,
-            clusterState.getSlices(collectionName), true);
+      for (String collectionName : collectionsList) {
+        Collection<Slice> colSlices = clusterState.getSlices(collectionName);
+        if (colSlices == null) {
+          throw new SolrServerException("Could not find collection:" + collectionName);
+        }
+        ClientUtils.addSlices(slices, collectionName, colSlices, true);
       }
       Set<String> liveNodes = clusterState.getLiveNodes();
       
@@ -287,6 +307,30 @@ public class CloudSolrServer extends Sol
     return rsp.getResponse();
   }
 
+  private Set<String> getCollectionList(ClusterState clusterState,
+      String collection) {
+    // Extract each comma separated collection name and store in a List.
+    List<String> rawCollectionsList = StrUtils.splitSmart(collection, ",", true);
+    Set<String> collectionsList = new HashSet<String>();
+    // validate collections
+    for (String collectionName : rawCollectionsList) {
+      if (!clusterState.getCollections().contains(collectionName)) {
+        Aliases aliases = zkStateReader.getAliases();
+        String alias = aliases.getCollectionAlias(collectionName);
+        if (alias != null) {
+          List<String> aliasList = StrUtils.splitSmart(alias, ",", true); 
+          collectionsList.addAll(aliasList);
+          continue;
+        }
+        
+        throw new SolrException(ErrorCode.BAD_REQUEST, "Collection not found: " + collectionName);
+      }
+      
+      collectionsList.add(collectionName);
+    }
+    return collectionsList;
+  }
+
   @Override
   public void shutdown() {
     if (zkStateReader != null) {

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrServer.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrServer.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrServer.java Sun Mar 10 15:04:57 2013
@@ -79,8 +79,7 @@ public class ConcurrentUpdateSolrServer 
   final int threadCount;
 
   /**
-   * Uses an internal ThreadSafeClientConnManager to manage http
-   * connections.
+   * Uses an internaly managed HttpClient instance.
    * 
    * @param solrServerUrl
    *          The Solr server URL
@@ -95,9 +94,7 @@ public class ConcurrentUpdateSolrServer 
   }
 
   /**
-   * Uses the supplied HttpClient to send documents to the Solr server, the
-   * HttpClient should be instantiated using a 
-   * ThreadSafeClientConnManager.
+   * Uses the supplied HttpClient to send documents to the Solr server.
    */
   public ConcurrentUpdateSolrServer(String solrServerUrl,
       HttpClient client, int queueSize, int threadCount) {

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpClientUtil.java Sun Mar 10 15:04:57 2013
@@ -35,8 +35,10 @@ import org.apache.http.client.HttpClient
 import org.apache.http.client.params.ClientParamBean;
 import org.apache.http.entity.HttpEntityWrapper;
 import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.impl.client.SystemDefaultHttpClient;
 import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
-import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
+import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager; // jdoc
+import org.apache.http.impl.conn.PoolingClientConnectionManager;
 import org.apache.http.params.HttpConnectionParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.solr.common.params.ModifiableSolrParams;
@@ -94,14 +96,12 @@ public class HttpClientUtil {
    * 
    * @param params
    *          http client configuration, if null a client with default
-   *          configuration (no additional configuration) is created that uses
-   *          ThreadSafeClientConnManager.
+   *          configuration (no additional configuration) is created. 
    */
   public static HttpClient createClient(final SolrParams params) {
     final ModifiableSolrParams config = new ModifiableSolrParams(params);
     logger.info("Creating new http client, config:" + config);
-    final ThreadSafeClientConnManager mgr = new ThreadSafeClientConnManager();
-    final DefaultHttpClient httpClient = new DefaultHttpClient(mgr);
+    final DefaultHttpClient httpClient = new SystemDefaultHttpClient();
     configureClient(httpClient, config);
     return httpClient;
   }
@@ -153,25 +153,35 @@ public class HttpClientUtil {
 
   /**
    * Set max connections allowed per host. This call will only work when
-   * {@link ThreadSafeClientConnManager} is used.
+   * {@link ThreadSafeClientConnManager} or
+   * {@link PoolingClientConnectionManager} is used.
    */
   public static void setMaxConnectionsPerHost(HttpClient httpClient,
       int max) {
-    if(httpClient.getConnectionManager() instanceof ThreadSafeClientConnManager) {
+    // would have been nice if there was a common interface
+    if (httpClient.getConnectionManager() instanceof ThreadSafeClientConnManager) {
       ThreadSafeClientConnManager mgr = (ThreadSafeClientConnManager)httpClient.getConnectionManager();
       mgr.setDefaultMaxPerRoute(max);
+    } else if (httpClient.getConnectionManager() instanceof PoolingClientConnectionManager) {
+      PoolingClientConnectionManager mgr = (PoolingClientConnectionManager)httpClient.getConnectionManager();
+      mgr.setDefaultMaxPerRoute(max);
     }
   }
 
   /**
    * Set max total connections allowed. This call will only work when
-   * {@link ThreadSafeClientConnManager} is used.
+   * {@link ThreadSafeClientConnManager} or
+   * {@link PoolingClientConnectionManager} is used.
    */
   public static void setMaxConnections(final HttpClient httpClient,
       int max) {
-    if(httpClient.getConnectionManager() instanceof ThreadSafeClientConnManager) {
+    // would have been nice if there was a common interface
+    if (httpClient.getConnectionManager() instanceof ThreadSafeClientConnManager) {
       ThreadSafeClientConnManager mgr = (ThreadSafeClientConnManager)httpClient.getConnectionManager();
       mgr.setMaxTotal(max);
+    } else if (httpClient.getConnectionManager() instanceof PoolingClientConnectionManager) {
+      PoolingClientConnectionManager mgr = (PoolingClientConnectionManager)httpClient.getConnectionManager();
+      mgr.setMaxTotal(max);
     }
   }
   

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java Sun Mar 10 15:04:57 2013
@@ -346,6 +346,7 @@ public class HttpSolrServer extends Solr
     method.addHeader("User-Agent", AGENT);
     
     InputStream respBody = null;
+    boolean shouldClose = true;
     
     try {
       // Execute the method.
@@ -378,6 +379,8 @@ public class HttpSolrServer extends Solr
         // no processor specified, return raw stream
         NamedList<Object> rsp = new NamedList<Object>();
         rsp.add("stream", respBody);
+        // Only case where stream should not be closed
+        shouldClose = false;
         return rsp;
       }
       String charset = EntityUtils.getContentCharSet(response.getEntity());
@@ -413,7 +416,7 @@ public class HttpSolrServer extends Solr
       throw new SolrServerException(
           "IOException occured when talking to server at: " + getBaseURL(), e);
     } finally {
-      if (respBody != null && processor!=null) {
+      if (respBody != null && shouldClose) {
         try {
           respBody.close();
         } catch (Throwable t) {} // ignore

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrServer.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrServer.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttpSolrServer.java Sun Mar 10 15:04:57 2013
@@ -37,8 +37,16 @@ import java.util.*;
 /**
  * LBHttpSolrServer or "LoadBalanced HttpSolrServer" is a load balancing wrapper around
  * {@link org.apache.solr.client.solrj.impl.HttpSolrServer}. This is useful when you
- * have multiple SolrServers and the requests need to be Load Balanced among them. This should <b>NOT</b> be used for
- * indexing. Also see the <a href="http://wiki.apache.org/solr/LBHttpSolrServer">wiki</a> page.
+ * have multiple SolrServers and the requests need to be Load Balanced among them.
+ *
+ * Do <b>NOT</b> use this class for indexing in master/slave scenarios since documents must be sent to the
+ * correct master; no inter-node routing is done.
+ *
+ * In SolrCloud (leader/replica) scenarios, this class may be used for updates since updates will be forwarded
+ * to the appropriate leader.
+ *
+ * Also see the <a href="http://wiki.apache.org/solr/LBHttpSolrServer">wiki</a> page.
+ *
  * <p/>
  * It offers automatic failover when a server goes down and it detects when the server comes back up.
  * <p/>
@@ -46,7 +54,7 @@ import java.util.*;
  * <p/>
  * If a request to a server fails by an IOException due to a connection timeout or read timeout then the host is taken
  * off the list of live servers and moved to a 'dead server list' and the request is resent to the next live server.
- * This process is continued till it tries all the live servers. If atleast one server is alive, the request succeeds,
+ * This process is continued till it tries all the live servers. If at least one server is alive, the request succeeds,
  * and if not it fails.
  * <blockquote><pre>
  * SolrServer lbHttpSolrServer = new LBHttpSolrServer("http://host1:8080/solr/","http://host2:8080/solr","http://host2:8080/solr");

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/request/CoreAdminRequest.java Sun Mar 10 15:04:57 2013
@@ -42,6 +42,7 @@ public class CoreAdminRequest extends So
 {
   protected String core = null;
   protected String other = null;
+  protected boolean isIndexInfoNeeded = true;
   protected CoreAdminParams.CoreAdminAction action = null;
   
   //a create core request
@@ -55,6 +56,7 @@ public class CoreAdminRequest extends So
     private Integer numShards;
     private String shardId;
     private String roles;
+    private String coreNodeName;
 
     public Create() {
       action = CoreAdminAction.CREATE;
@@ -69,6 +71,7 @@ public class CoreAdminRequest extends So
     public void setNumShards(int numShards) {this.numShards = numShards;}
     public void setShardId(String shardId) {this.shardId = shardId;}
     public void setRoles(String roles) {this.roles = roles;}
+    public void setCoreNodeName(String coreNodeName) {this.coreNodeName = coreNodeName;}
     
     public String getInstanceDir() { return instanceDir; }
     public String getSchemaName()  { return schemaName; }
@@ -78,6 +81,7 @@ public class CoreAdminRequest extends So
     public String getCollection() { return collection; }
     public String getShardId() { return shardId; }
     public String getRoles() { return roles; }
+    public String getCoreNodeName() { return coreNodeName; }
     
     @Override
     public SolrParams getParams() {
@@ -116,6 +120,9 @@ public class CoreAdminRequest extends So
       if (roles != null) {
         params.set( CoreAdminParams.ROLES, roles);
       }
+      if (coreNodeName != null) {
+        params.set( CoreAdminParams.CORE_NODE_NAME, coreNodeName);
+      }
       return params;
     }
 
@@ -383,6 +390,10 @@ public class CoreAdminRequest extends So
   {
     this.other = otherCoreName;
   }
+
+  public final void setIndexInfoNeeded(boolean isIndexInfoNeeded) {
+    this.isIndexInfoNeeded = isIndexInfoNeeded;
+  }
   
   //---------------------------------------------------------------------------------------
   //
@@ -406,6 +417,7 @@ public class CoreAdminRequest extends So
     ModifiableSolrParams params = new ModifiableSolrParams();
     params.set( CoreAdminParams.ACTION, action.toString() );
     params.set( CoreAdminParams.CORE, core );
+    params.set(CoreAdminParams.INDEX_INFO, (isIndexInfoNeeded ? "true" : "false"));
     if (other != null) {
       params.set(CoreAdminParams.OTHER, other);
     }

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java Sun Mar 10 15:04:57 2013
@@ -23,8 +23,13 @@ import java.io.Writer;
 import java.net.URLEncoder;
 import java.text.DateFormat;
 import java.text.ParseException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.Map;
 import java.util.Map.Entry;
+import java.util.TimeZone;
 import java.nio.ByteBuffer;
 
 import org.apache.solr.common.SolrDocument;
@@ -32,7 +37,11 @@ import org.apache.solr.common.SolrInputD
 import org.apache.solr.common.SolrInputField;
 import org.apache.solr.common.cloud.Slice;
 import org.apache.solr.common.params.SolrParams;
-import org.apache.solr.common.util.*;
+import org.apache.solr.common.util.Base64;
+import org.apache.solr.common.util.ContentStream;
+import org.apache.solr.common.util.ContentStreamBase;
+import org.apache.solr.common.util.DateUtil;
+import org.apache.solr.common.util.XML;
 
 
 /**
@@ -147,8 +156,12 @@ public class ClientUtils 
     } else {
       if( boost != 1.0f ) {
         XML.writeXML(writer, "field", v.toString(), "name", name, "boost", boost, "update", update);
-      } else if (v != null) {
-        XML.writeXML(writer, "field", v.toString(), "name", name, "update", update);
+      } else {
+        if (v == null)  {
+          XML.writeXML(writer, "field", null, "name", name, "update", update, "null", true);
+        } else  {
+          XML.writeXML(writer, "field", v.toString(), "name", name, "update", update);
+        }
       }
     }
   }

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java Sun Mar 10 15:04:57 2013
@@ -108,7 +108,13 @@ public class SolrDocument implements Map
   /**
    * This will add a field to the document.  If fields already exist with this
    * name it will append value to the collection. If the value is Collection,
-   * each value will be added independently.
+   * each value will be added independently. 
+   * 
+   * The class type of value and the name parameter should match schema.xml. 
+   * schema.xml can be found in conf directory under the solr home by default.
+   * 
+   * @param name Name of the field, should match one of the field names defined under "fields" tag in schema.xml.
+   * @param value Value of the field, should be of same class type as defined by "type" attribute of the corresponding field in schema.xml. 
    */
   @SuppressWarnings("unchecked")
   public void addField(String name, Object value) 

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/SolrInputDocument.java Sun Mar 10 15:04:57 2013
@@ -63,9 +63,12 @@ public class SolrInputDocument implement
   /** 
    * Add a field with implied null value for boost.
    * 
+   * The class type of value and the name parameter should match schema.xml. 
+   * schema.xml can be found in conf directory under the solr home by default.
+   * 
+   * @param name Name of the field, should match one of the field names defined under "fields" tag in schema.xml.
+   * @param value Value of the field, should be of same class type as defined by "type" attribute of the corresponding field in schema.xml. 
    * @see #addField(String, Object, float)
-   * @param name name of the field to add
-   * @param value value of the field
    */
   public void addField(String name, Object value) 
   {
@@ -132,8 +135,11 @@ public class SolrInputDocument implement
    * field, with the new boost. If the value is a collection, then each of its
    * values will be added to the field.
    *
-   * @param name Name of the field to add
-   * @param value Value of the field
+   * The class type of value and the name parameter should match schema.xml. 
+   * schema.xml can be found in conf directory under the solr home by default.
+   * 
+   * @param name Name of the field, should match one of the field names defined under "fields" tag in schema.xml.
+   * @param value Value of the field, should be of same class type as defined by "type" attribute of the corresponding field in schema.xml. 
    * @param boost Boost value for the field
    */
   public void addField(String name, Object value, float boost ) 

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java Sun Mar 10 15:04:57 2013
@@ -17,13 +17,11 @@ package org.apache.solr.common.cloud;
  * limitations under the License.
  */
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
-import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
@@ -31,7 +29,6 @@ import java.util.Set;
 import org.apache.noggit.JSONWriter;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrException.ErrorCode;
-import org.apache.solr.common.cloud.DocRouter.Range;
 import org.apache.zookeeper.KeeperException;
 import org.apache.zookeeper.data.Stat;
 import org.slf4j.Logger;
@@ -117,6 +114,12 @@ public class ClusterState implements JSO
     if (coll == null) return null;
     return coll.getSlicesMap();
   }
+  
+  public Map<String, Slice> getAllSlicesMap(String collection) {
+    DocCollection coll = collectionStates.get(collection);
+    if (coll == null) return null;
+    return coll.getAllSlicesMap();
+  }
 
   public Collection<Slice> getSlices(String collection) {
     DocCollection coll = collectionStates.get(collection);
@@ -161,7 +164,7 @@ public class ClusterState implements JSO
    * @param coreNodeName in the form of nodeName_coreName (the name of the replica)
    */
   public String getShardId(String coreNodeName) {
-     // System.out.println("###### getShardId("+coreNodeName+") in " + collectionStates);
+    //  System.out.println("###### getShardId("+coreNodeName+") in " + collectionStates);
     for (DocCollection coll : collectionStates.values()) {
       for (Slice slice : coll.getSlices()) {
         if (slice.getReplicasMap().containsKey(coreNodeName)) return slice.getName();
@@ -223,6 +226,15 @@ public class ClusterState implements JSO
     // System.out.println("######## ClusterState.load result:" + collections);
     return new ClusterState(version, liveNodes, collections);
   }
+  
+  public static Aliases load(byte[] bytes) {
+    if (bytes == null || bytes.length == 0) {
+      return new Aliases();
+    }
+    Map<String,Map<String,String>> aliasMap = (Map<String,Map<String,String>>) ZkStateReader.fromJSON(bytes);
+
+    return new Aliases(aliasMap);
+  }
 
   private static DocCollection collectionFromObjects(String name, Map<String,Object> objs) {
     Map<String,Object> props;

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/DocCollection.java Sun Mar 10 15:04:57 2013
@@ -23,6 +23,7 @@ import org.apache.noggit.JSONWriter;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
@@ -35,6 +36,7 @@ public class DocCollection extends ZkNod
 
   private final String name;
   private final Map<String, Slice> slices;
+  private final Map<String, Slice> allSlices;
   private final DocRouter router;
 
   /**
@@ -45,7 +47,17 @@ public class DocCollection extends ZkNod
   public DocCollection(String name, Map<String, Slice> slices, Map<String, Object> props, DocRouter router) {
     super( props==null ? Collections.<String,Object>emptyMap() : props);
     this.name = name;
-    this.slices = slices;
+
+    this.allSlices = slices;
+    this.slices = new HashMap<String, Slice>();
+
+    Iterator<Map.Entry<String, Slice>> iter = slices.entrySet().iterator();
+
+    while (iter.hasNext()) {
+      Map.Entry<String, Slice> slice = iter.next();
+      if (slice.getValue().getState().equals(Slice.ACTIVE))
+        this.slices.put(slice.getKey(), slice.getValue());
+    }
     this.router = router;
 
     assert name != null && slices != null;
@@ -60,23 +72,38 @@ public class DocCollection extends ZkNod
   }
 
   public Slice getSlice(String sliceName) {
-    return slices.get(sliceName);
+    return allSlices.get(sliceName);
   }
 
   /**
-   * Gets the list of slices for this collection.
+   * Gets the list of active slices for this collection.
    */
   public Collection<Slice> getSlices() {
     return slices.values();
   }
 
+
+  /**
+   * Return the list of all slices for this collection.
+   */
+  public Collection<Slice> getAllSlices() {
+    return allSlices.values();
+  }
+
   /**
-   * Get the map of slices (sliceName->Slice) for this collection.
+   * Get the map of active slices (sliceName->Slice) for this collection.
    */
   public Map<String, Slice> getSlicesMap() {
     return slices;
   }
 
+  /**
+   * Get the map of all slices (sliceName->Slice) for this collection.
+   */
+  public Map<String, Slice> getAllSlicesMap() {
+    return allSlices;
+  }
+
   public DocRouter getRouter() {
     return router;
   }
@@ -88,9 +115,9 @@ public class DocCollection extends ZkNod
 
   @Override
   public void write(JSONWriter jsonWriter) {
-    LinkedHashMap<String,Object> all = new LinkedHashMap<String,Object>(slices.size()+1);
+    LinkedHashMap<String, Object> all = new LinkedHashMap<String, Object>(allSlices.size() + 1);
     all.putAll(propMap);
-    all.put(SHARDS, slices);
+    all.put(SHARDS, allSlices);
     jsonWriter.write(all);
   }
 }

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/Replica.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/Replica.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/Replica.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/Replica.java Sun Mar 10 15:04:57 2013
@@ -30,7 +30,6 @@ public class Replica extends ZkNodeProps
     super(propMap);
     this.name = name;
     nodeName = (String)propMap.get(ZkStateReader.NODE_NAME_PROP);
-    assert nodeName == null || name.startsWith(nodeName);
   }
 
   public String getName() {

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/Slice.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/Slice.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/Slice.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/Slice.java Sun Mar 10 15:04:57 2013
@@ -31,13 +31,16 @@ import java.util.Map;
 public class Slice extends ZkNodeProps {
   public static String REPLICAS = "replicas";
   public static String RANGE = "range";
+  public static String STATE = "state";
   public static String LEADER = "leader";       // FUTURE: do we want to record the leader as a slice property in the JSON (as opposed to isLeader as a replica property?)
+  public static String ACTIVE = "active";
 
   private final String name;
   private final DocRouter.Range range;
   private final Integer replicationFactor;      // FUTURE: optional per-slice override of the collection replicationFactor
   private final Map<String,Replica> replicas;
   private final Replica leader;
+  private final String state;
 
   /**
    * @param name  The name of the slice
@@ -49,6 +52,12 @@ public class Slice extends ZkNodeProps {
     this.name = name;
 
     Object rangeObj = propMap.get(RANGE);
+    if (propMap.containsKey(STATE))
+      state = (String) propMap.get(STATE);
+    else {
+      state = ACTIVE;                         //Default to ACTIVE
+      propMap.put(STATE, this.state);
+    }
     DocRouter.Range tmpRange = null;
     if (rangeObj instanceof DocRouter.Range) {
       tmpRange = (DocRouter.Range)rangeObj;
@@ -135,6 +144,10 @@ public class Slice extends ZkNodeProps {
     return range;
   }
 
+  public String getState() {
+    return state;
+  }
+
   @Override
   public String toString() {
     return name + ':' + JSONUtil.toJSON(propMap);

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/ZkCoreNodeProps.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/ZkCoreNodeProps.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/ZkCoreNodeProps.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/ZkCoreNodeProps.java Sun Mar 10 15:04:57 2013
@@ -62,10 +62,6 @@ public class ZkCoreNodeProps {
     return nodeProps.toString();
   }
 
-  public String getCoreNodeName() {
-    return getNodeName() + "_" + getCoreName();
-  }
-
   public ZkNodeProps getNodeProps() {
     return nodeProps;
   }

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java Sun Mar 10 15:04:57 2013
@@ -51,6 +51,7 @@ public class ZkStateReader {
   
   public static final String BASE_URL_PROP = "base_url";
   public static final String NODE_NAME_PROP = "node_name";
+  public static final String CORE_NODE_NAME_PROP = "core_node_name";
   public static final String ROLES_PROP = "roles";
   public static final String STATE_PROP = "state";
   public static final String CORE_NAME_PROP = "core";
@@ -61,6 +62,7 @@ public class ZkStateReader {
   
   public static final String COLLECTIONS_ZKNODE = "/collections";
   public static final String LIVE_NODES_ZKNODE = "/live_nodes";
+  public static final String ALIASES = "/aliases.json";
   public static final String CLUSTER_STATE = "/clusterstate.json";
   
   public static final String RECOVERING = "recovering";
@@ -128,7 +130,9 @@ public class ZkStateReader {
   private boolean closeClient = false;
 
   private ZkCmdExecutor cmdExecutor;
-  
+
+  private Aliases aliases = new Aliases();
+
   public ZkStateReader(SolrZkClient zkClient) {
     this.zkClient = zkClient;
     initZkCmdExecutor(zkClient.getZkClientTimeout());
@@ -176,12 +180,17 @@ public class ZkStateReader {
     updateClusterState(true, true);
   }
   
+  public Aliases getAliases() {
+    return aliases;
+  }
+  
   public synchronized void createClusterStateWatchersAndUpdate() throws KeeperException,
       InterruptedException {
     // We need to fetch the current cluster state and the set of live nodes
     
     synchronized (getUpdateLock()) {
       cmdExecutor.ensureExists(CLUSTER_STATE, zkClient);
+      cmdExecutor.ensureExists(ALIASES, zkClient);
       
       log.info("Updating cluster state from ZooKeeper... ");
       
@@ -285,6 +294,49 @@ public class ZkStateReader {
       liveNodeSet.addAll(liveNodes);
       ClusterState clusterState = ClusterState.load(zkClient, liveNodeSet);
       this.clusterState = clusterState;
+      
+      zkClient.exists(ALIASES,
+          new Watcher() {
+            
+            @Override
+            public void process(WatchedEvent event) {
+              // session events are not change events,
+              // and do not remove the watcher
+              if (EventType.None.equals(event.getType())) {
+                return;
+              }
+              try {
+                synchronized (ZkStateReader.this.getUpdateLock()) {
+                  log.info("Updating aliases... ");
+
+                  // remake watch
+                  final Watcher thisWatch = this;
+                  Stat stat = new Stat();
+                  byte[] data = zkClient.getData(ALIASES, thisWatch, stat ,
+                      true);
+
+                  Aliases aliases = ClusterState.load(data);
+
+                  ZkStateReader.this.aliases = aliases;
+                }
+              } catch (KeeperException e) {
+                if (e.code() == KeeperException.Code.SESSIONEXPIRED
+                    || e.code() == KeeperException.Code.CONNECTIONLOSS) {
+                  log.warn("ZooKeeper watch triggered, but Solr cannot talk to ZK");
+                  return;
+                }
+                log.error("", e);
+                throw new ZooKeeperException(
+                    SolrException.ErrorCode.SERVER_ERROR, "", e);
+              } catch (InterruptedException e) {
+                // Restore the interrupted status
+                Thread.currentThread().interrupt();
+                log.warn("", e);
+                return;
+              }
+            }
+            
+          }, true);
     }
   }
   
@@ -438,26 +490,18 @@ public class ZkStateReader {
         : "");
   }
 
-  /**
-   * Get CoreNodeName for a core. This name is unique across the collection.  
-   * @param nodeName in form: 127.0.0.1:54065_solr
-   */
-  public static String getCoreNodeName(String nodeName, String coreName) {
-    return nodeName + "_" + coreName;
-  }
-
   public List<ZkCoreNodeProps> getReplicaProps(String collection,
-      String shardId, String thisNodeName, String coreName) {
-    return getReplicaProps(collection, shardId, thisNodeName, coreName, null);
+      String shardId, String thisCoreNodeName, String coreName) {
+    return getReplicaProps(collection, shardId, thisCoreNodeName, coreName, null);
   }
   
   public List<ZkCoreNodeProps> getReplicaProps(String collection,
-      String shardId, String thisNodeName, String coreName, String mustMatchStateFilter) {
-    return getReplicaProps(collection, shardId, thisNodeName, coreName, mustMatchStateFilter, null);
+      String shardId, String thisCoreNodeName, String coreName, String mustMatchStateFilter) {
+    return getReplicaProps(collection, shardId, thisCoreNodeName, coreName, mustMatchStateFilter, null);
   }
   
   public List<ZkCoreNodeProps> getReplicaProps(String collection,
-      String shardId, String thisNodeName, String coreName, String mustMatchStateFilter, String mustNotMatchStateFilter) {
+      String shardId, String thisCoreNodeName, String coreName, String mustMatchStateFilter, String mustNotMatchStateFilter) {
     ClusterState clusterState = this.clusterState;
     if (clusterState == null) {
       return null;
@@ -476,11 +520,12 @@ public class ZkStateReader {
     
     Map<String,Replica> shardMap = replicas.getReplicasMap();
     List<ZkCoreNodeProps> nodes = new ArrayList<ZkCoreNodeProps>(shardMap.size());
-    String filterNodeName = thisNodeName + "_" + coreName;
     for (Entry<String,Replica> entry : shardMap.entrySet()) {
       ZkCoreNodeProps nodeProps = new ZkCoreNodeProps(entry.getValue());
-      String coreNodeName = nodeProps.getNodeName() + "_" + nodeProps.getCoreName();
-      if (clusterState.liveNodesContain(nodeProps.getNodeName()) && !coreNodeName.equals(filterNodeName)) {
+      
+      String coreNodeName = entry.getValue().getName();
+      
+      if (clusterState.liveNodesContain(nodeProps.getNodeName()) && !coreNodeName.equals(thisCoreNodeName)) {
         if (mustMatchStateFilter == null || mustMatchStateFilter.equals(nodeProps.getState())) {
           if (mustNotMatchStateFilter == null || !mustNotMatchStateFilter.equals(nodeProps.getState())) {
             nodes.add(nodeProps);
@@ -499,5 +544,13 @@ public class ZkStateReader {
   public SolrZkClient getZkClient() {
     return zkClient;
   }
+
+  public void updateAliases() throws KeeperException, InterruptedException {
+    byte[] data = zkClient.getData(ALIASES, null, null, true);
+
+    Aliases aliases = ClusterState.load(data);
+
+    ZkStateReader.this.aliases = aliases;
+  }
   
 }

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/luke/FieldFlag.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/luke/FieldFlag.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/luke/FieldFlag.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/luke/FieldFlag.java Sun Mar 10 15:04:57 2013
@@ -25,6 +25,7 @@ public enum FieldFlag {
   INDEXED('I', "Indexed"), 
   TOKENIZED('T', "Tokenized"), 
   STORED('S', "Stored"), 
+  DOC_VALUES('D', "DocValues"),
   MULTI_VALUED('M', "Multivalued"),
   TERM_VECTOR_STORED('V', "TermVector Stored"), 
   TERM_VECTOR_OFFSET('o', "Store Offset With TermVector"),
@@ -32,6 +33,7 @@ public enum FieldFlag {
   OMIT_NORMS('O', "Omit Norms"), 
   OMIT_TF('F', "Omit Term Frequencies & Positions"), 
   OMIT_POSITIONS('P', "Omit Positions"),
+  STORE_OFFSETS_WITH_POSITIONS('H', "Store Offsets with Positions"),
   LAZY('L', "Lazy"), 
   BINARY('B', "Binary"), 
   SORT_MISSING_FIRST('f', "Sort Missing First"), 

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CollectionParams.java Sun Mar 10 15:04:57 2013
@@ -28,7 +28,7 @@ public interface CollectionParams 
 
 
   public enum CollectionAction {
-    CREATE, DELETE, RELOAD, SYNCSHARD;
+    CREATE, DELETE, RELOAD, SYNCSHARD, CREATEALIAS, DELETEALIAS;
     
     public static CollectionAction get( String p )
     {

Modified: lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CoreAdminParams.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CoreAdminParams.java?rev=1454862&r1=1454861&r2=1454862&view=diff
==============================================================================
--- lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CoreAdminParams.java (original)
+++ lucene/dev/branches/lucene4258/solr/solrj/src/java/org/apache/solr/common/params/CoreAdminParams.java Sun Mar 10 15:04:57 2013
@@ -28,6 +28,9 @@ public interface CoreAdminParams 
   /** What Core are we talking about **/
   public final static String CORE = "core";
 
+  /** Should the STATUS request include index info **/
+  public final static String INDEX_INFO = "indexInfo";
+
   /** Persistent -- should it save the cores state? **/
   public final static String PERSISTENT = "persistent";
   
@@ -73,6 +76,8 @@ public interface CoreAdminParams 
   
   public static final String ROLES = "roles";
   
+  public static final String CORE_NODE_NAME = "coreNodeName";
+  
   /** Prefix for core property name=value pair **/
   public final static String PROPERTY_PREFIX = "property.";
 
@@ -97,7 +102,9 @@ public interface CoreAdminParams 
     SPLIT,
     PREPRECOVERY,
     REQUESTRECOVERY, 
-    REQUESTSYNCSHARD;
+    REQUESTSYNCSHARD,
+    CREATEALIAS,
+    DELETEALIAS;
     
     public static CoreAdminAction get( String p )
     {



Mime
View raw message