-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,942 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- Licensed to Elasticsearch under one or more contributor | ||
license agreements. See the NOTICE file distributed with this work for additional | ||
information regarding copyright ownership. ElasticSearch licenses this file to you | ||
under the Apache License, Version 2.0 (the "License"); you may not use this | ||
file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by | ||
applicable law or agreed to in writing, software distributed under the License | ||
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. --> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.elasticsearch.plugin</groupId> | ||
<artifactId>elasticsearch-delete-by-query</artifactId> | ||
|
||
<packaging>jar</packaging> | ||
<name>Elasticsearch Delete By Query plugin</name> | ||
<description>The Delete By Query plugin allows to delete documents in Elasticsearch with a single query.</description> | ||
|
||
<parent> | ||
<groupId>org.elasticsearch</groupId> | ||
<artifactId>elasticsearch-plugin</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<properties> | ||
<!-- You can add any specific project property here --> | ||
<tests.jvms>1</tests.jvms> | ||
|
||
</properties> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0"?> | ||
<!-- Licensed to ElasticSearch under one or more contributor | ||
license agreements. See the NOTICE file distributed with this work for additional | ||
information regarding copyright ownership. ElasticSearch licenses this file to you | ||
under the Apache License, Version 2.0 (the "License"); you may not use this | ||
file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by | ||
applicable law or agreed to in writing, software distributed under the License | ||
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. --> | ||
|
||
<assembly> | ||
<id>plugin</id> | ||
<formats> | ||
<format>zip</format> | ||
</formats> | ||
<includeBaseDirectory>false</includeBaseDirectory> | ||
<dependencySets> | ||
<dependencySet> | ||
<outputDirectory>/</outputDirectory> | ||
<useProjectArtifact>true</useProjectArtifact> | ||
<useTransitiveFiltering>true</useTransitiveFiltering> | ||
<excludes> | ||
<exclude>org.elasticsearch:elasticsearch</exclude> | ||
</excludes> | ||
</dependencySet> | ||
<dependencySet> | ||
<outputDirectory>/</outputDirectory> | ||
<useProjectArtifact>true</useProjectArtifact> | ||
<useTransitiveFiltering>true</useTransitiveFiltering> | ||
</dependencySet> | ||
</dependencySets> | ||
</assembly> |
48 changes: 48 additions & 0 deletions
48
...ns/delete-by-query/src/main/java/org/elasticsearch/deletebyquery/DeleteByQueryModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.elasticsearch.deletebyquery; | ||
|
||
import org.elasticsearch.action.ActionModule; | ||
import org.elasticsearch.common.inject.AbstractModule; | ||
import org.elasticsearch.common.inject.Module; | ||
import org.elasticsearch.common.inject.PreProcessModule; | ||
import org.elasticsearch.deletebyquery.action.DeleteByQueryAction; | ||
import org.elasticsearch.deletebyquery.action.TransportDeleteByQueryAction; | ||
import org.elasticsearch.deletebyquery.rest.RestDeleteByQueryAction; | ||
import org.elasticsearch.rest.RestModule; | ||
|
||
public class DeleteByQueryModule extends AbstractModule implements PreProcessModule { | ||
|
||
@Override | ||
public void processModule(Module module) { | ||
if (module instanceof RestModule) { | ||
RestModule restModule = (RestModule) module; | ||
restModule.addRestAction(RestDeleteByQueryAction.class); | ||
} | ||
if (module instanceof ActionModule) { | ||
ActionModule actionModule = (ActionModule) module; | ||
actionModule.registerAction(DeleteByQueryAction.INSTANCE, TransportDeleteByQueryAction.class); | ||
} | ||
} | ||
|
||
@Override | ||
protected void configure() { | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...ns/delete-by-query/src/main/java/org/elasticsearch/deletebyquery/DeleteByQueryPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.elasticsearch.deletebyquery; | ||
|
||
import org.elasticsearch.common.inject.Module; | ||
import org.elasticsearch.common.settings.Settings; | ||
import org.elasticsearch.plugins.AbstractPlugin; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
|
||
public class DeleteByQueryPlugin extends AbstractPlugin { | ||
|
||
public static final String NAME = "delete-by-query"; | ||
|
||
@Override | ||
public String name() { | ||
return NAME; | ||
} | ||
|
||
@Override | ||
public String description() { | ||
return "Elasticsearch Delete-By-Query Plugin"; | ||
} | ||
|
||
@Override | ||
public Collection<Module> modules(Settings settings) { | ||
Collection<Module> modules = new ArrayList<>(); | ||
modules.add(new DeleteByQueryModule()); | ||
return modules; | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...te-by-query/src/main/java/org/elasticsearch/deletebyquery/action/DeleteByQueryAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.elasticsearch.deletebyquery.action; | ||
|
||
import org.elasticsearch.action.Action; | ||
import org.elasticsearch.client.ElasticsearchClient; | ||
|
||
public class DeleteByQueryAction extends Action<DeleteByQueryRequest, DeleteByQueryResponse, DeleteByQueryRequestBuilder> { | ||
|
||
public static final DeleteByQueryAction INSTANCE = new DeleteByQueryAction(); | ||
public static final String NAME = "indices:data/write/delete/by_query"; | ||
|
||
private DeleteByQueryAction() { | ||
super(NAME); | ||
} | ||
|
||
@Override | ||
public DeleteByQueryResponse newResponse() { | ||
return new DeleteByQueryResponse(); | ||
} | ||
|
||
@Override | ||
public DeleteByQueryRequestBuilder newRequestBuilder(ElasticsearchClient client) { | ||
return new DeleteByQueryRequestBuilder(client, this); | ||
} | ||
} |
Oops, something went wrong.