Package org.apache.solr.client.solrj

Examples of org.apache.solr.client.solrj.SolrRequest


        solrQuery.setQuery("*");
        solrQuery.setFacet(true);
        solrQuery.setFacetMinCount(1);
        solrQuery.setFacetLimit(8);
        solrQuery.addFacetField("lastname");
        SolrRequest request = new QueryRequest(solrQuery, METHOD.POST);
        // request.setPath(getRequestPath());
        QueryResponse response = new QueryResponse(customerSolrServer.request(request), customerSolrServer);
        List<CustomerSolr> customerSolrList = response.getBeans(CustomerSolr.class);
        List<FacetField> customerSolrFacetFieldList = response.getFacetFields();
        CustomerResponseBean customerResponseBean = new CustomerResponseBean();
View Full Code Here


        final SolrServer solr = new HttpSolrServer(baseURL + "/" + index);
        final ModifiableSolrParams params = new ModifiableSolrParams();
        params.set("qt", "/");
        params.set("q", field + ":" + term);
        final SolrRequest req = new QueryRequest(params);

        final QueryResponse resp = solr.query(params);
        System.out.println("resp: " + resp);
    }
View Full Code Here

    solrTemplate.saveBean(new DocumentWithIndexAnnotations());

    ArgumentCaptor<SolrRequest> requestCaptor = ArgumentCaptor.forClass(SolrRequest.class);
    Mockito.verify(solrServerMock, Mockito.times(3)).request(requestCaptor.capture());

    SolrRequest capturedRequest = requestCaptor.getValue();

    Assert.assertThat(capturedRequest.getMethod(), IsEqual.equalTo(SolrRequest.METHOD.POST));
    Assert.assertThat(capturedRequest.getPath(), IsEqual.equalTo("/schema/fields"));
    Assert.assertThat(capturedRequest.getContentStreams(), IsNull.notNullValue());
  }
View Full Code Here

              logger.info("[{}]: sending: {}...", core, xmlFile);
              // Ensure it's in UTF-8 encoding
              Reader reader = new InputStreamReader(
                  new FileInputStream(xmlFile), "UTF-8");
              String body = IOUtils.toString(reader);
              SolrRequest request = new DirectXmlRequest("/update", body);
              /** Post the document to the Index */
              request.process(server);
              IOUtils.closeQuietly(reader);
            }
            // Commit the changes
            server.commit();
          } catch (Exception ex) {
View Full Code Here

              logger.info("[{}]: sending: {}...", core, xmlFile);
              // Ensure it's in UTF-8 encoding
              Reader reader = new InputStreamReader(
                  new FileInputStream(xmlFile), "UTF-8");
              String body = IOUtils.toString(reader);
              SolrRequest request = new DirectXmlRequest("/update", body);
              /** Post the document to the Index */
              request.process(server);
              IOUtils.closeQuietly(reader);
            }
            // Commit the changes
            server.commit();
          } catch (Exception ex) {
View Full Code Here

TOP

Related Classes of org.apache.solr.client.solrj.SolrRequest

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.