Package org.apache.solr.client.solrj.impl

Examples of org.apache.solr.client.solrj.impl.XMLResponseParser


      else
        localClient.getCredentialsProvider().setCredentials(AuthScope.ANY, credentials);
    }

    String httpSolrServerUrl = protocol + "://" + server + ":" + port + location;
    HttpSolrServer httpSolrServer = new ModifiedHttpSolrServer(httpSolrServerUrl, localClient, new XMLResponseParser());
    // Set the solrj instance we want to use
    solrServer = httpSolrServer;
  }
View Full Code Here


      else
        localClient.getCredentialsProvider().setCredentials(AuthScope.ANY, credentials);
    }

    String httpSolrServerUrl = protocol + "://" + server + ":" + port + location;
    HttpSolrServer httpSolrServer = new ModifiedHttpSolrServer(httpSolrServerUrl, localClient, new XMLResponseParser());
    // Set the solrj instance we want to use
    solrServer = httpSolrServer;
  }
View Full Code Here

        /*System.setProperty("solr.solr.home", "/home/shalinsmangar/work/oss/branch-1.3/example/solr");
        CoreContainer.Initializer initializer = new CoreContainer.Initializer();
        CoreContainer coreContainer = initializer.initialize();
        EmbeddedSolrServer server = new EmbeddedSolrServer(coreContainer, "");*/
     
      httpServer.setParser(new XMLResponseParser());
      this.solrServer = (SolrServer) httpServer;
     
    } catch (MalformedURLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

      else
        localClient.getCredentialsProvider().setCredentials(AuthScope.ANY, credentials);
    }

    String httpSolrServerUrl = protocol + "://" + server + ":" + port + location;
    HttpSolrServer httpSolrServer = new ModifiedHttpSolrServer(httpSolrServerUrl, localClient, new XMLResponseParser());
    // Set the solrj instance we want to use
    solrServer = httpSolrServer;
  }
View Full Code Here

    start = System.currentTimeMillis();
    writerName = writerName.intern();
    for (int i=0; i<decIter; i++) {
      ResponseParser rp = null;
      if (writerName == "xml") {
        rp = new XMLResponseParser();
      } else if (writerName == "javabin") {
        rp = new BinaryResponseParser();
      } else {
        break;
      }
View Full Code Here

        // choose format
        if (server instanceof CommonsHttpSolrServer) {
          if (random.nextBoolean()) {
            ((CommonsHttpSolrServer) server).setParser(new BinaryResponseParser());
          } else {
            ((CommonsHttpSolrServer) server).setParser(new XMLResponseParser());
          }
        }

        int numDocs = _TestUtil.nextInt(random, 1, 100);
       
View Full Code Here

* @since solr 1.3
*/
public class QueryResponseTest extends LuceneTestCase {
  @Test
  public void testDateFacets() throws Exception   {
    XMLResponseParser parser = new XMLResponseParser();
    InputStream is = new SolrResourceLoader(null, null).openResource("sampleDateFacetResponse.xml");
    assertNotNull(is);
    Reader in = new InputStreamReader(is, "UTF-8");
    NamedList<Object> response = parser.processResponse(in);
    in.close();
   
    QueryResponse qr = new QueryResponse(response, null);
    Assert.assertNotNull(qr);
   
View Full Code Here

public class TestDocumentObjectBinder extends LuceneTestCase
{
  public void testSimple() throws Exception {
    DocumentObjectBinder binder = new DocumentObjectBinder();
    XMLResponseParser parser = new XMLResponseParser();
    NamedList<Object> nl = null;
    nl = parser.processResponse(new StringReader(xml));
    QueryResponse res = new QueryResponse(nl, null);
    SolrDocumentList solDocList = res.getResults();
    List<Item> l = binder.getBeans(Item.class,res.getResults());
    Assert.assertEquals(solDocList.size(), l.size());
    Assert.assertEquals(solDocList.get(0).getFieldValue("features"), l.get(0).features);
View Full Code Here

  }

  public void testDynamicFieldBinding(){
    DocumentObjectBinder binder = new DocumentObjectBinder();
    XMLResponseParser parser = new XMLResponseParser();
    NamedList<Object> nl = parser.processResponse(new StringReader(xml));
    QueryResponse res = new QueryResponse(nl, null);
    List<Item> l = binder.getBeans(Item.class,res.getResults());
    Assert.assertArrayEquals(new String[]{"Mobile Store","iPod Store","CCTV Store"}, l.get(3).getAllSuppliers());
    Assert.assertTrue(l.get(3).supplier.containsKey("supplier_1"));
    Assert.assertTrue(l.get(3).supplier.containsKey("supplier_2"));
View Full Code Here

    start = System.currentTimeMillis();
    writerName = writerName.intern();
    for (int i=0; i<decIter; i++) {
      ResponseParser rp = null;
      if (writerName == "xml") {
        rp = new XMLResponseParser();
      } else if (writerName == "javabin") {
        rp = new BinaryResponseParser();
      } else {
        break;
      }
View Full Code Here

TOP

Related Classes of org.apache.solr.client.solrj.impl.XMLResponseParser

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.