Package org.apache.solr.client.solrj

Examples of org.apache.solr.client.solrj.SolrRequest.process()


  /**
   * Return the number of documents currently indexed.
   */
  public int getNumberOfDocuments() throws SolrServerException, IOException {
    final SolrRequest request = new FastLukeRequest();
    final LukeResponse response = (LukeResponse) request.process(this.getServer());
    return response.getNumDocs();
  }

  public String[] search(final SolrQuery query, final String retrievedField)
  throws SolrServerException, IOException {
View Full Code Here


              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

              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
Copyright © 2018 www.massapi.com. 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.