Package org.apache.solr.common.params

Examples of org.apache.solr.common.params.MultiMapSolrParams


      }
      catch( UnsupportedEncodingException uex ) {
        throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, uex );
      }
    }
    return new MultiMapSolrParams( map );
  }
View Full Code Here


  {
    if( !ServletFileUpload.isMultipartContent(req) ) {
      throw new SolrException( SolrException.ErrorCode.BAD_REQUEST, "Not multipart content! "+req.getContentType() );
    }
   
    MultiMapSolrParams params = SolrRequestParsers.parseQueryString( req.getQueryString() );
   
    // Create a factory for disk-based file items
    DiskFileItemFactory factory = new DiskFileItemFactory();

    // Set factory constraints
    // TODO - configure factory.setSizeThreshold(yourMaxMemorySize);
    // TODO - configure factory.setRepository(yourTempDirectory);

    // Create a new file upload handler
    ServletFileUpload upload = new ServletFileUpload(factory);
    upload.setSizeMax( uploadLimitKB*1024 );

    // Parse the request
    List items = upload.parseRequest(req);
    Iterator iter = items.iterator();
    while (iter.hasNext()) {
        FileItem item = (FileItem) iter.next();

        // If its a form field, put it in our parameter map
        if (item.isFormField()) {
          MultiMapSolrParams.addParam(
            item.getFieldName(),
            item.getString(), params.getMap() );
        }
        // Only add it if it actually has something...
        else if( item.getSize() > 0 ) {
          streams.add( new FileItemContentStream( item ) );
        }
View Full Code Here

    }
    if (query!=null) map.put(CommonParams.Q, new String[]{query});
    if (qtype!=null) map.put(CommonParams.QT, new String[]{qtype});
    map.put(CommonParams.START, new String[]{Integer.toString(start)});
    map.put(CommonParams.ROWS, new String[]{Integer.toString(limit)});
    return new MultiMapSolrParams(map);
  }
View Full Code Here

  public LocalSolrQueryRequest(SolrCore core, NamedList args) {
    super(core, SolrParams.toSolrParams(args));
  }

  public LocalSolrQueryRequest(SolrCore core, Map<String,String[]> args) {
    super(core, new MultiMapSolrParams(args));
  }
View Full Code Here

      Map<String, String[]> tmp = new HashMap();
      for (Map.Entry<String,Collection<String>> entry : cellParams.asMap().entrySet()) {
        tmp.put(entry.getKey(), entry.getValue().toArray(new String[entry.getValue().size()]));
      }
      this.solrParams = new MultiMapSolrParams(tmp);
      validateArguments();
    }
View Full Code Here

      Map<String, String[]> tmp = new HashMap();
      for (Map.Entry<String,Collection<String>> entry : cellParams.asMap().entrySet()) {
        tmp.put(entry.getKey(), entry.getValue().toArray(new String[entry.getValue().size()]));
      }
      this.solrParams = new MultiMapSolrParams(tmp);
      validateArguments();
    }
View Full Code Here

TOP

Related Classes of org.apache.solr.common.params.MultiMapSolrParams

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.