You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2014/09/06 01:07:07 UTC
svn commit: r1622815 - in /lucene/dev/branches/branch_4x: ./ solr/
solr/core/ solr/core/src/java/org/apache/solr/handler/
solr/core/src/java/org/apache/solr/handler/loader/ solr/example/
solr/example/example-schemaless/solr/collection1/conf/
Author: noble
Date: Fri Sep 5 23:07:07 2014
New Revision: 1622815
URL: http://svn.apache.org/r1622815
Log:
SOLR-6471
Modified:
lucene/dev/branches/branch_4x/ (props changed)
lucene/dev/branches/branch_4x/solr/ (props changed)
lucene/dev/branches/branch_4x/solr/core/ (props changed)
lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/UpdateRequestHandler.java
lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java
lucene/dev/branches/branch_4x/solr/example/ (props changed)
lucene/dev/branches/branch_4x/solr/example/example-schemaless/solr/collection1/conf/schema.xml
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/UpdateRequestHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/UpdateRequestHandler.java?rev=1622815&r1=1622814&r2=1622815&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/UpdateRequestHandler.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/UpdateRequestHandler.java Fri Sep 5 23:07:07 2014
@@ -77,27 +77,24 @@ public class UpdateRequestHandler extend
public void load(SolrQueryRequest req, SolrQueryResponse rsp,
ContentStream stream, UpdateRequestProcessor processor) throws Exception {
- ContentStreamLoader ldr = pathVsLoaders.get(req.getContext().get("path"));
- if(ldr != null){
- ldr.load(req,rsp,stream,processor);
- return;
- }
-
- String type = req.getParams().get(UpdateParams.ASSUME_CONTENT_TYPE);
- if(type == null) {
- type = stream.getContentType();
- }
- if( type == null ) { // Normal requests will not get here.
- throw new SolrException(ErrorCode.UNSUPPORTED_MEDIA_TYPE, "Missing ContentType");
- }
- int idx = type.indexOf(';');
- if(idx>0) {
- type = type.substring(0,idx);
- }
- ContentStreamLoader loader = loaders.get(type);
- if(loader==null) {
- throw new SolrException(ErrorCode.UNSUPPORTED_MEDIA_TYPE, "Unsupported ContentType: "
- +type+ " Not in: "+loaders.keySet());
+ ContentStreamLoader loader = pathVsLoaders.get(req.getContext().get("path"));
+ if(loader == null) {
+ String type = req.getParams().get(UpdateParams.ASSUME_CONTENT_TYPE);
+ if (type == null) {
+ type = stream.getContentType();
+ }
+ if (type == null) { // Normal requests will not get here.
+ throw new SolrException(ErrorCode.UNSUPPORTED_MEDIA_TYPE, "Missing ContentType");
+ }
+ int idx = type.indexOf(';');
+ if (idx > 0) {
+ type = type.substring(0, idx);
+ }
+ loader = loaders.get(type);
+ if (loader == null) {
+ throw new SolrException(ErrorCode.UNSUPPORTED_MEDIA_TYPE, "Unsupported ContentType: "
+ + type + " Not in: " + loaders.keySet());
+ }
}
if(loader.getDefaultWT()!=null) {
setDefaultWT(req,loader);
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java?rev=1622815&r1=1622814&r2=1622815&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java Fri Sep 5 23:07:07 2014
@@ -191,7 +191,7 @@ public class JsonLoader extends ContentS
private void handleSplitMode(String split, String[] fields) throws IOException {
if(split == null) split = "/";
- if(fields == null || fields.length ==0) fields = new String[]{"/*"};
+ if(fields == null || fields.length ==0) fields = new String[]{"/**"};
final boolean echo = "true".equals( req.getParams().get("echo"));
JsonRecordReader jsonRecordReader = JsonRecordReader.getInst(split, Arrays.asList(fields));
jsonRecordReader.streamRecords(parser,new JsonRecordReader.Handler() {
Modified: lucene/dev/branches/branch_4x/solr/example/example-schemaless/solr/collection1/conf/schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/example/example-schemaless/solr/collection1/conf/schema.xml?rev=1622815&r1=1622814&r2=1622815&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/example/example-schemaless/solr/collection1/conf/schema.xml (original)
+++ lucene/dev/branches/branch_4x/solr/example/example-schemaless/solr/collection1/conf/schema.xml Fri Sep 5 23:07:07 2014
@@ -1038,7 +1038,10 @@
</analyzer>
</fieldType>
-
+ <!-- catchall field, containing all other searchable text fields (implemented
+ via copyField) -->
+ <field name="_text" type="text_general" indexed="true" stored="false" multiValued="true"/>
+ <copyField source="*" dest="_text"/>
<!-- Similarity is the scoring routine for each document vs. a query.
A custom Similarity or SimilarityFactory may be specified here, but
the default is fine for most applications.