Delete bulk docs async.

@param index              the index
@param type               the type
@param filterQueryBuilder the filter query builder
339162
public void deleteBulkDocsAsync(String index, String type,
            QueryBuilder filterQueryBuilder) {
        executeBulkRequestAsync(buildDeleteBulkRequestBuilder(
                buildExtractDeleteRequestBuilderList(index, type,
                        filterQueryBuilder)));
    }
1215430
public function removeDocuments(array $ids, $index, $type = '')
    {
        if (empty($type)) {
            $type = $this->typeName;
        }

        $client = $this->getClient();
        $index = $client->getIndex($index);

        $client->deleteIds($ids, $index, $type);

        // Refresh index because bulk deletions are slow
        $index->refresh();
    }
834206
public void deleteBulkDocsAsync(List<String> indexList,
            List<String> typeList, QueryBuilder filterQueryBuilder) {
        indexList.forEach(index -> typeList.forEach(
                type -> deleteBulkDocsAsync(index, type, filterQueryBuilder)));
    }
1204021
protected void appendFilterQuery(SolrQuery solrQuery, List<FilterQuery> filterQueries,
			@Nullable Class<?> domainType) {

		if (CollectionUtils.isEmpty(filterQueries)) {
			return;
		}

		List<String> filterQueryStrings = getFilterQueryStrings(filterQueries, domainType);

		if (!filterQueryStrings.isEmpty()) {
			solrQuery.setFilterQueries(convertStringListToArray(filterQueryStrings));
		}
	}
733474
public function queryFilter(string $filterType, $filterOptions, string $clauseType = 'must'): ElasticSearchQueryBuilder
    {
        $this->request->queryFilter($filterType, $filterOptions, $clauseType);

        return $this;
    }
949743
public void delete(Query query) {
        Log.debug("Deleting by query %s", query);
        try {
            indexWriter.deleteDocuments(query);
        } catch (IOException e) {
            Log.error(e, "Error while deleting by query %s", query);
            throw new RuntimeException(e);
        }
    }
268652
protected void deleteTypeVertex(AtlasVertex instanceVertex, boolean force) throws AtlasBaseException {
        LOG.debug("Deleting {}", string(instanceVertex));
        String typeName = GraphHelper.getTypeName(instanceVertex);


        AtlasType parentType = typeRegistry.getType(typeName);

        if (parentType instanceof AtlasStructType) {
            AtlasStructType structType   = (AtlasStructType) parentType;
            boolean         isEntityType = (parentType instanceof AtlasEntityType);

            for (AtlasStructType.AtlasAttribute attributeInfo : structType.getAllAttributes().values()) {
                LOG.debug("Deleting attribute {} for {}", attributeInfo.getName(), string(instanceVertex));
                boolean isOwned = isEntityType && attributeInfo.isOwnedRef();

                AtlasType attrType = attributeInfo.getAttributeType();

                String edgeLabel = AtlasGraphUtilsV1.getAttributeEdgeLabel(structType, attributeInfo.getName());

                switch (attrType.getTypeCategory()) {
                case OBJECT_ID_TYPE:
                    //If its class attribute, delete the reference
                    deleteEdgeReference(instanceVertex, edgeLabel, attrType.getTypeCategory(), isOwned);
                    break;

                case STRUCT:
                    //If its struct attribute, delete the reference
                    deleteEdgeReference(instanceVertex, edgeLabel, attrType.getTypeCategory(), false);
                    break;

                case ARRAY:
                    //For array attribute, if the element is struct/class, delete all the references
                    AtlasArrayType arrType = (AtlasArrayType) attrType;
                    AtlasType elemType = arrType.getElementType();
                    if (AtlasGraphUtilsV1.isReference(elemType.getTypeCategory())) {
                        Iterator<AtlasEdge> edges = graphHelper.getOutGoingEdgesByLabel(instanceVertex, edgeLabel);
                        if (edges != null) {
                            while (edges.hasNext()) {
                                AtlasEdge edge = edges.next();
                                deleteEdgeReference(edge, elemType.getTypeCategory(), isOwned, false);
                            }
                        }
                    }
                    break;

                case MAP:
                    //For map attribute, if the value type is struct/class, delete all the references
                    AtlasMapType mapType = (AtlasMapType) attrType;
                    AtlasType keyType = mapType.getKeyType();
                    TypeCategory valueTypeCategory = mapType.getValueType().getTypeCategory();
                    String propertyName = AtlasGraphUtilsV1.getQualifiedAttributePropertyKey(structType, attributeInfo.getName());

                    if (AtlasGraphUtilsV1.isReference(valueTypeCategory)) {
                        List<Object> keys = EntityGraphMapper.getArrayElementsProperty(keyType, instanceVertex, propertyName);
                        if (keys != null) {
                            for (Object key : keys) {
                                String mapEdgeLabel = GraphHelper.getQualifiedNameForMapKey(edgeLabel, (String) key);
                                deleteEdgeReference(instanceVertex, mapEdgeLabel, valueTypeCategory, isOwned);
                            }
                        }
                    }
                }
            }
        }

        deleteVertex(instanceVertex, force);
    }
97741
public  <T> ESDatas<T> searchAll(String index,  int fetchSize ,Class<T> type) throws ElasticSearchException{
		return searchAll(index,  fetchSize ,(ScrollHandler<T>) null,type);
	}
1329929
@Override
	public synchronized void deleteAllUrlsForType(int type) throws DatabaseException {
    	SqlPreparedStatementWrapper psDeleteAllUrlsForType = null;
        try {
        	psDeleteAllUrlsForType = DbSQL.getSingleton().getPreparedStatement("sessionurl.ps.deleteurlsfortype");
			psDeleteAllUrlsForType.getPs().setInt(1, type);
			psDeleteAllUrlsForType.getPs().executeUpdate();
		} catch (SQLException e) {
			throw new DatabaseException(e);
		} finally {
			DbSQL.getSingleton().releasePreparedStatement(psDeleteAllUrlsForType);
		}
    }
965081
public BulkRequestBuilder buildDeleteBulkRequestBuilder(
            List<DeleteRequestBuilder> deleteRequestBuilderList) {
        BulkRequestBuilder bulkRequestBuilder = jmESClient.prepareBulk();
        for (DeleteRequestBuilder deleteRequestBuilder : deleteRequestBuilderList)
            bulkRequestBuilder.add(deleteRequestBuilder);
        return bulkRequestBuilder;
    }
1063871
@Subscribe
    public void handleIndexDeletion(final IndicesDeletedEvent event) {
        event.indices().forEach(indexName -> {
            LOG.debug("Removing field type information for deleted index <{}>", indexName);
            dbService.delete(indexName);
        });
    }
459698
def query_delete(query)
      @dir.synchronize do
        ensure_writer_open()
        ensure_searcher_open()
        query = do_process_query(query)
        @searcher.search_each(query, :limit => :all) do |doc, score|
          @reader.delete(doc)
        end
        flush() if @auto_flush
      end
    end
1002395
private static void removeIndexInElasticsearch(RestClient client, String index) throws Exception {
		logger.trace("removeIndex([{}])", index);

		assert client != null;
		assert index != null;

		Response response = client.performRequest(new Request("DELETE", "/" + index));
		if (response.getStatusLine().getStatusCode() != 200) {
			logger.warn("Could not delete index [{}]", index);
			throw new Exception("Could not delete index ["+index+"].");
		}

		logger.trace("/removeIndex([{}])", index);
	}
735212
public SearchResponse searchAllWithTargetCount(String index, String type) {
        return searchAllWithTargetCount(index, type, null, null);
    }
1239020
@Override
	public synchronized void deleteAllUrlsForType(int type) throws DatabaseException {
    	try {
			psDeleteAllUrlsForType.setInt(1, type);
			psDeleteAllUrlsForType.executeUpdate();
		} catch (SQLException e) {
			throw new DatabaseException(e);
		}
    }
783980
public void deleteByQuery(String index, String type) throws IOException {
        logger.debug("deleteByQuery [{}]/[{}]", index, type);

        String deleteByQuery = "{\n" +
                "  \"query\": {\n" +
                "    \"match_all\": {}\n" +
                "  }\n" +
                "}";

        Request request = new Request("POST", "/" + index + "/" + type + "/_delete_by_query");
        request.setJsonEntity(deleteByQuery);
        Response restResponse = client.getLowLevelClient().performRequest(request);
        Map<String, Object> response = asMap(restResponse);
        logger.debug("reindex response: {}", response);
    }
1270596
public static IndexingResult delete(EsClient client, IndexType indexType, SearchRequestBuilder searchRequest) {
    BulkIndexer bulk = new BulkIndexer(client, indexType, Size.REGULAR);
    bulk.start();
    bulk.addDeletion(searchRequest);
    return bulk.stop();
  }