I'm trying to register a GeoPoint type with an embedded ElasticSearch
node and am wondering what the correct API usage is.
I understand I have to use the PutMappingRequestBuilder...but what do
I use for the source Map? It lacks generics and as such, I'm confused
what I should add there.
final PutMappingRequestBuilder mappingRequestBuilder = new
PutMappingRequestBuilder(this.searchService.admin().indices());
I'm trying to register a GeoPoint type with an embedded Elasticsearch
node and am wondering what the correct API usage is.
I understand I have to use the PutMappingRequestBuilder...but what do
I use for the source Map? It lacks generics and as such, I'm confused
what I should add there.
final PutMappingRequestBuilder mappingRequestBuilder = new
PutMappingRequestBuilder(this.searchService.admin().indices());
So that means this API should not be used?
I would rather not have to deal with building JSON and let the API do
it.
This hides any changes to the Elasticsearch low level protocol away
from my code.
I'm trying to register a GeoPoint type with an embedded Elasticsearch
node and am wondering what the correct API usage is.
I understand I have to use the PutMappingRequestBuilder...but what do
I use for the source Map? It lacks generics and as such, I'm confused
what I should add there.
final PutMappingRequestBuilder mappingRequestBuilder = new
PutMappingRequestBuilder(this.searchService.admin().indices());
As far as I know this is the only way to set the mapping for an index,
is not that you're writing json on your own but instead using the java
API provided to do it.
So that means this API should not be used?
I would rather not have to deal with building JSON and let the API do
it.
This hides any changes to the Elasticsearch low level protocol away
from my code.
I'm trying to register a GeoPoint type with an embedded Elasticsearch
node and am wondering what the correct API usage is.
I understand I have to use the PutMappingRequestBuilder...but what do
I use for the source Map? It lacks generics and as such, I'm confused
what I should add there.
final PutMappingRequestBuilder mappingRequestBuilder = new
PutMappingRequestBuilder(this.searchService.admin().indices());
Using the Java API, what is the preferred way to index a GeoPoint?
Is this not valid?
final Map<String, Object> sourceMap = new HashMap<String, Object>();
sourceMap.put("coordinate", new GeoPoint(event.getLatitudeDeg(),
event.getLongitudeDeg()));
As far as I know this is the only way to set the mapping for an index,
is not that you're writing json on your own but instead using the java
API provided to do it.
So that means this API should not be used?
I would rather not have to deal with building JSON and let the API do
it.
This hides any changes to the Elasticsearch low level protocol away
from my code.
I'm trying to register a GeoPoint type with an embedded Elasticsearch
node and am wondering what the correct API usage is.
I understand I have to use the PutMappingRequestBuilder...but what do
I use for the source Map? It lacks generics and as such, I'm confused
what I should add there.
final PutMappingRequestBuilder mappingRequestBuilder = new
PutMappingRequestBuilder(this.searchService.admin().indices());
Same goes for Dates. What is the preferred way to get dates into and
out of the Elasticsearch API.
I don't imagine having to use the SimpleDateFormat from java.text do
I?
Using the Java API, what is the preferred way to index a GeoPoint?
Is this not valid?
final Map<String, Object> sourceMap = new HashMap<String, Object>();
sourceMap.put("coordinate", new GeoPoint(event.getLatitudeDeg(),
event.getLongitudeDeg()));
As far as I know this is the only way to set the mapping for an index,
is not that you're writing json on your own but instead using the java
API provided to do it.
So that means this API should not be used?
I would rather not have to deal with building JSON and let the API do
it.
This hides any changes to the Elasticsearch low level protocol away
from my code.
I'm trying to register a GeoPoint type with an embedded Elasticsearch
node and am wondering what the correct API usage is.
I understand I have to use the PutMappingRequestBuilder...but what do
I use for the source Map? It lacks generics and as such, I'm confused
what I should add there.
final PutMappingRequestBuilder mappingRequestBuilder = new
PutMappingRequestBuilder(this.searchService.admin().indices());
Yes, mappings can only be provided using their json representation, which
you can build however you want (read it from a file, build it using
your favorite json lib, or use elasticsearch XContent).
As far as I know this is the only way to set the mapping for an index,
is not that you're writing json on your own but instead using the java
API provided to do it.
So that means this API should not be used?
I would rather not have to deal with building JSON and let the API do
it.
This hides any changes to the Elasticsearch low level protocol away
from my code.
I'm trying to register a GeoPoint type with an embedded Elasticsearch
node and am wondering what the correct API usage is.
I understand I have to use the PutMappingRequestBuilder...but what do
I use for the source Map? It lacks generics and as such, I'm confused
what I should add there.
final PutMappingRequestBuilder mappingRequestBuilder = new
PutMappingRequestBuilder(this.searchService.admin().indices());
GeoPoint will not help, its an internal class used in ES, not meant to
construct points to be indexed. Just build the structure you want to index
that maps to the document.
Using the Java API, what is the preferred way to index a GeoPoint?
Is this not valid?
final Map<String, Object> sourceMap = new HashMap<String, Object>();
sourceMap.put("coordinate", new
GeoPoint(event.getLatitudeDeg(),
event.getLongitudeDeg()));
As far as I know this is the only way to set the mapping for an index,
is not that you're writing json on your own but instead using the java
API provided to do it.
So that means this API should not be used?
I would rather not have to deal with building JSON and let the API do
it.
This hides any changes to the Elasticsearch low level protocol away
from my code.
I'm trying to register a GeoPoint type with an embedded
Elasticsearch
node and am wondering what the correct API usage is.
I understand I have to use the PutMappingRequestBuilder...but what
do
I use for the source Map? It lacks generics and as such, I'm
confused
what I should add there.
final PutMappingRequestBuilder mappingRequestBuilder = new
PutMappingRequestBuilder(this.searchService.admin().indices());
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.