Package org.apache.solr.client.solrj.request

Examples of org.apache.solr.client.solrj.request.QueryRequest


        break;
      default:
        throw new IllegalArgumentException("Admin operation: " + adminOp + " is not supported!");
    }

    QueryRequest request = new QueryRequest(modParams);
    request.setPath("/admin/collections");
    return request;
  }
View Full Code Here


          params.remove(CommonParams.VERSION);

          SolrServer server = new CommonsHttpSolrServer(url, client);
          // SolrRequest req = new QueryRequest(SolrRequest.METHOD.POST, "/select");
          // use generic request to avoid extra processing of queries
          QueryRequest req = new QueryRequest(params);
          req.setMethod(SolrRequest.METHOD.POST);
          req.setResponseParser(new BinaryResponseParser())// this sets the wt param
          // srsp.rsp = server.request(req);
          // srsp.rsp = server.query(sreq.params);

          ssr.nl = server.request(req);
        } catch (Throwable th) {
View Full Code Here

    catch (Exception ex) {
    }

    // now Make sure AAA is in 0 and BBB in 1
    SolrQuery q = new SolrQuery();
    QueryRequest r = new QueryRequest(q);
    q.setQuery("id:AAA");
    assertEquals(1, r.process(getSolrCore0()).getResults().size());
    assertEquals(0, r.process(getSolrCore1()).getResults().size());

    // Now test Changing the default core
    assertEquals(1, getSolrCore0().query(new SolrQuery("id:AAA")).getResults().size());
    assertEquals(0, getSolrCore0().query(new SolrQuery("id:BBB")).getResults().size());
View Full Code Here

    }
    catch( Exception ex ) {}
   
    // now Make sure AAA is in 0 and BBB in 1
    SolrQuery q = new SolrQuery();
    QueryRequest r = new QueryRequest( q );
    q.setQuery( "id:AAA" );
    assertEquals( 1, r.process( getSolrCore0() ).getResults().size() );
    assertEquals( 0, r.process( getSolrCore1() ).getResults().size() );
   
    // Now test Changing the default core
    assertEquals( 1, getSolrCore0().query( new SolrQuery( "id:AAA" ) ).getResults().size() );
    assertEquals( 0, getSolrCore0().query( new SolrQuery( "id:BBB" ) ).getResults().size() );
View Full Code Here

    SolrQuery query = new SolrQuery("*:*");
    query.set(CommonParams.QT, "/spellCheckCompRH");
    query.set("spellcheck", true);
    query.set(SpellingParams.SPELLCHECK_Q, "samsang");
    query.set(SpellingParams.SPELLCHECK_BUILD, true);
    QueryRequest request = new QueryRequest(query);
    SpellCheckResponse response = request.process(server).getSpellCheckResponse();
    Assert.assertEquals("Incorrect spelling results", "samsung", response.getFirstSuggestion("samsang"));
  }
View Full Code Here

    query.set(CommonParams.QT, "/spellCheckCompRH");
    query.set("spellcheck", true);
    query.set(SpellingParams.SPELLCHECK_Q, "samsang");
    query.set(SpellingParams.SPELLCHECK_BUILD, true);
    query.set(SpellingParams.SPELLCHECK_EXTENDED_RESULTS, true);
    QueryRequest request = new QueryRequest(query);
    SpellCheckResponse response = request.process(server).getSpellCheckResponse();
    Assert.assertEquals("Incorrect spelling results", "samsung", response.getFirstSuggestion("samsang"));
  }
View Full Code Here

  public SolrPingResponse ping() throws SolrServerException, IOException {
    return new SolrPing().process( this );
  }

  public QueryResponse query(SolrParams params) throws SolrServerException {
    return new QueryRequest( params ).process( this );
  }
View Full Code Here

  public QueryResponse query(SolrParams params) throws SolrServerException {
    return new QueryRequest( params ).process( this );
  }
 
  public QueryResponse query(SolrParams params, METHOD method) throws SolrServerException {
    return new QueryRequest( params, method ).process( this );
  }
View Full Code Here

                                             CollectionAction adminOp,
                                             String collectionName) throws Exception {
    String originalUser = getAuthenticatedUser();
    try {
      setAuthenticationUser(solrUserName);
      QueryRequest request = populateCollectionAdminParams(adminOp, collectionName);
      CloudSolrServer solrServer = createNewCloudSolrServer();
      try {
        NamedList<Object> result = solrServer.request(request);
        if (adminOp.compareTo(CollectionAction.CREATE) == 0) {
          // Wait for collection creation to complete.
View Full Code Here

    String originalUser = getAuthenticatedUser();
    try {
      setAuthenticationUser(solrUserName);
      try {
        QueryRequest request = populateCollectionAdminParams(adminOp, collectionName);
        CloudSolrServer solrServer = createNewCloudSolrServer();
        try {
          NamedList<Object> result = solrServer.request(request);
          if (adminOp.compareTo(CollectionAction.CREATE) == 0) {
            // Wait for collection creation to complete.
View Full Code Here

TOP

Related Classes of org.apache.solr.client.solrj.request.QueryRequest

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.