Package org.apache.solr.common.params

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


        ShardRequest sreq = new ShardRequest();
        sreq.purpose = ShardRequest.PURPOSE_GET_FIELDS;

        sreq.shards = new String[]{shardDocs.iterator().next().shard};

        sreq.params = new ModifiableSolrParams();

        // add original params
        sreq.params.add(rb.req.getParams());
        sreq.params.remove(CommonParams.Q);//remove the query
        ArrayList<String> ids = new ArrayList<String>(shardDocs.size());
View Full Code Here


   * @deprecated Use {@link org.apache.solr.client.solrj.request.AbstractUpdateRequest.ACTION} instead
   */
  @Deprecated
  public UpdateRequest setAction(ACTION action, boolean waitFlush, boolean waitSearcher, int maxSegments ) {
    if (params == null)
      params = new ModifiableSolrParams();

    if( action == ACTION.OPTIMIZE ) {
      params.set( UpdateParams.OPTIMIZE, "true" );
      params.set(UpdateParams.MAX_OPTIMIZE_SEGMENTS, maxSegments);
    }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public SolrParams getParams() {
    ModifiableSolrParams params = new ModifiableSolrParams();
    params.set(AnalysisParams.FIELD_VALUE, fieldValue);
    if (query != null) {
      params.add(AnalysisParams.QUERY, query);
      params.add(AnalysisParams.SHOW_MATCH, String.valueOf(showMatch));
    }
    if (fieldNames != null) {
      String fieldNameValue = listToCommaDelimitedString(fieldNames);
      params.add(AnalysisParams.FIELD_NAME, fieldNameValue);
    }
    if (fieldTypes != null) {
      String fieldTypeValue = listToCommaDelimitedString(fieldTypes);
      params.add(AnalysisParams.FIELD_TYPE, fieldTypeValue);
    }
    return params;
  }
View Full Code Here

   
    int depth=req.getParams().getInt("__higo_ms_depth__", 0);
    HttpCommComponent comm = new HttpCommComponent(depth);

    ShardRequest sreq = new ShardRequest();
    sreq.params = new ModifiableSolrParams(rb.req.getParams());

    for (SearchComponent c : components) {
    c.modifyRequest(rb, c, sreq);
    c.distributedProcess(rb);
    }

    sreq.responses = new ArrayList<ShardResponse>();

    for (int i=0;i<scheduleInfo.shards.length;i++) {
        ModifiableSolrParams params = new ModifiableSolrParams(sreq.params);
        params.remove(ShardParams.SHARDS);      // not a top-level request
      params.remove("indent");
    params.remove(ShardParams.PARTIONS);
      params.remove(CommonParams.HEADER_ECHO_PARAMS);
      params.set(ShardParams.IS_SHARD, true)// a sub (shard) request
      if(scheduleInfo.partions!=null)
        {
            params.set(ShardParams.PARTIONS, scheduleInfo.partions);
        }
        if(scheduleInfo.hasSubShards)
        {
           params.set(ShardParams.SHARDS,scheduleInfo.subShards[i]);
        }
       
//        params.set(FacetParams.IS_SUB_SHARDS, true);
    params.set(FacetParams.FACET_CROSS_OFFSET, 0);
        params.set(FacetParams.FACET_CROSS_LIMIT, MdrillGroupBy.MAX_CROSS_ROWS);
     
        params.remove(CommonParams.QT);
        comm.submit( scheduleInfo,sreq, scheduleInfo.shards[i], params,depth);
    }
 
    while (true) {
      ShardResponse srsp = comm.takeCompletedOrError();
View Full Code Here

        checkResponse.setQparser(ultimateResponse.getQparser());
        checkResponse.setFilters(ultimateResponse.getFilters());
        checkResponse.setQueryString(collationQueryStr);
        checkResponse.components = Arrays.asList(new SearchComponent[] { queryComponent });

        ModifiableSolrParams params = new ModifiableSolrParams(ultimateResponse.req.getParams());
        params.set(CommonParams.Q, collationQueryStr);
        params.remove(CommonParams.START);
        params.set(CommonParams.FL, "id");
        params.set(CommonParams.ROWS, "0");
        // creating a request here... make sure to close it!
        checkResponse.req = new LocalSolrQueryRequest(ultimateResponse.req.getCore(), params);
        checkResponse.rsp = new SolrQueryResponse();

        try {
View Full Code Here

      // log.info("###start commit. pending=null");
      pending = null// allow a new commit to be scheduled
    }

    SolrQueryRequest req = new LocalSolrQueryRequest(core,
        new ModifiableSolrParams());
    try {
      CommitUpdateCommand command = new CommitUpdateCommand(false);
      command.waitSearcher = waitSearcher;
      // no need for command.maxOptimizeSegments = 1; since it is not optimizing
View Full Code Here

          throws XMLStreamException, IOException, FactoryConfigurationError,
          InstantiationException, IllegalAccessException,
          TransformerConfigurationException {
    AddUpdateCommand addCmd = null;
    // Need to instansiate a SolrParams, even if req is null, for backward compat with legacyUpdate
    SolrParams params = (req != null) ? req.getParams() : new ModifiableSolrParams();
    while (true) {
      int event = parser.next();
      switch (event) {
        case XMLStreamConstants.END_DOCUMENT:
          parser.close();
View Full Code Here

   * XXXX=YYYY as a param to the custom param list
   * @param params The original SolrParams
   * @return The new Params
   */
  protected SolrParams getCustomParams(String dictionary, SolrParams params, boolean shardRequest) {
    ModifiableSolrParams result = new ModifiableSolrParams();
    Iterator<String> iter = params.getParameterNamesIterator();
    String prefix = SpellingParams.SPELLCHECK_PREFIX + "." + dictionary + ".";
    while (iter.hasNext()){
      String nxt = iter.next();
      if (nxt.startsWith(prefix)){
        result.add(nxt.substring(prefix.length()), params.getParams(nxt));
      }
    }
    if(shardRequest)
    {
      result.add(ShardParams.IS_SHARD, "true");
    }
    return result;
  }
View Full Code Here

        return readOuterMostDocIterator(fis);
      }

      private List readOuterMostDocIterator(FastInputStream fis) throws IOException {
        NamedList params = (NamedList) namedList[0].getVal(0);
        updateRequest.setParams(new ModifiableSolrParams(SolrParams.toSolrParams(params)));
        if (handler == null) return super.readIterator(fis);
        while (true) {
          Object o = readVal(fis);
          if (o == END_OBJ) break;
          handler.document(listToSolrInputDocument((List<NamedList>) o), updateRequest);
View Full Code Here

  public SolrParams getParams()
  {
    if( action == null ) {
      throw new RuntimeException( "no action specified!" );
    }
    ModifiableSolrParams params = new ModifiableSolrParams();
    params.set( CoreAdminParams.ACTION, action.toString() );
    params.set( CoreAdminParams.CORE, core );
    if (other != null) {
      params.set(CoreAdminParams.OTHER, other);
    }
    return params;
  }
View Full Code Here

TOP

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

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.