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

Examples of org.apache.solr.client.solrj.impl.CloudSolrServer.query()


      CloudSolrServer cloudSolrServer = getCloudSolrServer(collectionName);
      assertNotNull("Solr query shouldn't be null.", solrQueryStr);
      SolrDocumentList solrDocs = null;
      try {
        SolrQuery query = new SolrQuery(solrQueryStr);
        QueryResponse response = cloudSolrServer.query(query);
        solrDocs = response.getResults();
        return solrDocs;
      } finally {
        cloudSolrServer.shutdown();
      }
View Full Code Here


      CloudSolrServer cloudSolrServer = getCloudSolrServer(collectionName);
      assertNotNull("Solr query shouldn't be null.", solrQueryStr);
      SolrDocumentList solrDocs = null;
      try {
        SolrQuery query = new SolrQuery(solrQueryStr);
        QueryResponse response = cloudSolrServer.query(query);
        solrDocs = response.getResults();
        return solrDocs;
      } finally {
        cloudSolrServer.shutdown();
      }
View Full Code Here

      SolrQuery query = new SolrQuery();
      query.setQuery("*:*");

      // as admin  -- should get the other half
      setAuthenticationUser("admin");
      QueryResponse  rsp = server.query(query);
      SolrDocumentList docList = rsp.getResults();
      assertEquals(NUM_DOCS / 2, docList.getNumFound());
      for (SolrDocument doc : docList) {
        String id = doc.getFieldValue("id").toString();
        assertEquals(1, Long.valueOf(id) % 2);
View Full Code Here

      }

      if (checkNonAdminUsers) {
        // as junit -- should get half the documents
        setAuthenticationUser("junit");
        rsp = server.query(query);
        docList = rsp.getResults();
        assertEquals(NUM_DOCS / 2, docList.getNumFound());
        for (SolrDocument doc : docList) {
          String id = doc.getFieldValue("id").toString();
          assertEquals(0, Long.valueOf(id) % 2);
View Full Code Here

          assertEquals(0, Long.valueOf(id) % 2);
        }

        // as docLevel -- should get all
        setAuthenticationUser("docLevel");
        rsp = server.query(query);
        assertEquals(NUM_DOCS, rsp.getResults().getNumFound());
      }
    } finally {
      server.shutdown();
    }
View Full Code Here

        SolrQuery query = new SolrQuery();
        query.setQuery("*:*");

        // as admin  -- should only get all roles token documents
        setAuthenticationUser("admin");
        QueryResponse rsp = server.query(query);
        SolrDocumentList docList = rsp.getResults();
        assertEquals(totalAllRolesAdded, docList.getNumFound());
        for (SolrDocument doc : docList) {
          String id = doc.getFieldValue("id").toString();
          assertEquals(0, Long.valueOf(id) % allRolesFactor);
View Full Code Here

          assertEquals(0, Long.valueOf(id) % allRolesFactor);
        }

        // as junit -- should get junit added + onlyAllRolesAdded
        setAuthenticationUser("junit");
        rsp = server.query(query);
        docList = rsp.getResults();
        assertEquals(totalJunitAdded + totalOnlyAllRolesAdded, docList.getNumFound());
        for (SolrDocument doc : docList) {
          String id = doc.getFieldValue("id").toString();
          boolean addedJunit = (Long.valueOf(id) % junitFactor) == 0;
View Full Code Here

      query.setQuery("*:*");

      setAuthenticationUser(deleteUser);
      server.deleteByQuery(deleteByQueryStr);
      server.commit();
      QueryResponse rsp =  server.query(query);
      long junitResults = rsp.getResults().getNumFound();
      assertEquals(0, junitResults);

      setAuthenticationUser(queryUser);
      rsp =  server.query(query);
View Full Code Here

      QueryResponse rsp =  server.query(query);
      long junitResults = rsp.getResults().getNumFound();
      assertEquals(0, junitResults);

      setAuthenticationUser(queryUser);
      rsp =  server.query(query);
      long docLevelResults = rsp.getResults().getNumFound();
      assertEquals(expectedQueryDocs, docLevelResults);
    } finally {
      server.shutdown();
    }
View Full Code Here

        allIds.add(Long.toString(i));
      }
      server.deleteById(allIds);
      server.commit();

      QueryResponse rsp =  server.query(query);
      long junitResults = rsp.getResults().getNumFound();
      assertEquals(0, junitResults);

      setAuthenticationUser("docLevel");
      rsp =  server.query(query);
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.