mirror of https://github.com/apache/lucene.git
SOLR-6471
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1622773 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5af7459462
commit
6386f1760f
|
@ -77,28 +77,27 @@ public class UpdateRequestHandler extends ContentStreamHandlerBase {
|
|||
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;
|
||||
ContentStreamLoader loader = pathVsLoaders.get(req.getContext().get("path"));
|
||||
log.info("$$$$$$$ used the pathVsLoaders {} ",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());
|
||||
}
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
if(loader.getDefaultWT()!=null) {
|
||||
setDefaultWT(req,loader);
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ public class JsonLoader extends ContentStreamLoader {
|
|||
|
||||
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() {
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue