Delete a specific pin without an id

Hi Everyone,

I'm new to the elasticsearch and I'm with a doubt regarding geo
location feature.

In a project that I'm working on, we have a few tests that are
inserting a few locations to ElasticSearch with the following code:

final void index(final double latitude, final double longitude, final
String indexName) {
final XContentBuilder locationJson =
ElasticsearchUtil.createJsonForLocation(latitude, longitude);
client.prepareIndex(indexName,
PIN).setSource(locationJson).setOperationThreaded(false).execute().actionGet(timeout);
}

This works and we already have some tests searching inside a polygon
but now I want to remove a specific "pin" (location) but the only api
that I've available is the following:

client.prepareDelete("indexName", "pin",
id).setOperationThreaded(false).execute().actionGet(timeout);

But I'm not inserting any id for my location.

How should I delete a specific pin without an id?

Thanks and sorry about the basic question..

You can always delete by query: client.prepareDeleteByQuery(...)

--
Ivan

On Tue, Mar 27, 2012 at 5:11 PM, P.V. pedro@elanross.com wrote:

Hi Everyone,

I'm new to the elasticsearch and I'm with a doubt regarding geo
location feature.

In a project that I'm working on, we have a few tests that are
inserting a few locations to Elasticsearch with the following code:

final void index(final double latitude, final double longitude, final
String indexName) {
final XContentBuilder locationJson =
ElasticsearchUtil.createJsonForLocation(latitude, longitude);
client.prepareIndex(indexName,
PIN).setSource(locationJson).setOperationThreaded(false).execute().actionGet(timeout);
}

This works and we already have some tests searching inside a polygon
but now I want to remove a specific "pin" (location) but the only api
that I've available is the following:

client.prepareDelete("indexName", "pin",
id).setOperationThreaded(false).execute().actionGet(timeout);

But I'm not inserting any id for my location.

How should I delete a specific pin without an id?

Thanks and sorry about the basic question..