Examples of ESClient


Examples of com.dotcms.content.elasticsearch.util.ESClient

        if(query.contains("+live:true") && !query.contains("+deleted:true"))
            indexToHit=info.live;
        else
            indexToHit=info.working;

        Client client=new ESClient().getClient();
        QueryStringQueryBuilder qb = QueryBuilders.queryString(qq);
        CountRequestBuilder crb = client.prepareCount();
        crb.setQuery(qb);
        crb.setIndices(indexToHit);
        return crb.execute().actionGet().getCount();
View Full Code Here

Examples of com.dotcms.content.elasticsearch.util.ESClient

      if(query.contains("+live:true") && !query.contains("+deleted:true"))
          indexToHit=info.live;
      else
          indexToHit=info.working;

      Client client=new ESClient().getClient();
      SearchResponse resp = null;
        try {

          SearchRequestBuilder srb = createRequest(client,qq);
View Full Code Here

Examples of com.dotcms.content.elasticsearch.util.ESClient

            indexName = SiteSearchAPI.ES_SITE_SEARCH_NAME + "_" + ESContentletIndexAPI.timestampFormatter.format( new Date() );
            APILocator.getSiteSearchAPI().createSiteSearchIndex( indexName, null, 1 );
            APILocator.getSiteSearchAPI().activateIndex( indexName );
        }

        Client client = new ESClient().getClient();
        SearchResponse resp;
        try {
            QueryStringQueryBuilder qb = QueryBuilders.queryString( qq );
            SearchRequestBuilder srb = client.prepareSearch();
            srb.setQuery( qb );
View Full Code Here

Examples of com.dotcms.content.elasticsearch.util.ESClient

                    }
                }
          }
          else if(!remoteQ.isEmpty()) {
              wait=false;
              Client client=new ESClient().getClient();
            BulkRequestBuilder bulk=client.prepareBulk();
            final ArrayList<IndexJournal<String>> recordsToDelete=new ArrayList<IndexJournal<String>>();
            while(!remoteQ.isEmpty()) {
                  IndexJournal<String> idx = remoteQ.removeFirst();
                  writeDocumentToIndex(bulk,idx);
View Full Code Here

Examples of com.dotcms.content.elasticsearch.util.ESClient

          contentlets=contAPI.search(query, limit, offset, "identifier", APILocator.getUserAPI().getSystemUser(), false);
            } catch (DotSecurityException e) {
                throw new RuntimeException(e);
            }

      BulkRequestBuilder bulk=new ESClient().getClient().prepareBulk();
      for(Contentlet cont : contentlets) {
          permissionCache.remove(cont.getPermissionId());
          indexAPI.addContentToIndex(cont, false, true, true, bulk);
      }
      if(bulk.numberOfActions()>0)
View Full Code Here

Examples of com.dotcms.content.elasticsearch.util.ESClient

        AdminClient client=null;

        JSONObject jsonNode = new JSONObject();

        try {
          client = new ESClient().getClient().admin();
        } catch (Exception e) {
          Logger.error(ClusterResource.class, "Error getting ES Client", e);
          jsonNode.put("error", e.getMessage());
          return responseResource.response( jsonNode.toString() );
        }
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.