is there a way to define mapping in java with a simple string?

2015-03-25 Thread Sai Asuka
Is there a way to simply pass mapping information in a json formatted 
string "{... }" without having to create an object and do a bunch of .put 
on it within Java?

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/c66a0784-29cc-4a42-958b-d7e189a0b17a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is java elasticsearch a joke?

2015-03-25 Thread Sai Asuka
No changes to elasticsearch.yml except for clusterName.

The telnet command fails:

telnet localhost:9300

Error from executing telnet:
localhost:9300: nodename nor servname provided, or not known
Version used is 1.5.0

On Wednesday, March 25, 2015 at 2:15:57 PM UTC-4, Andrew Selden wrote:
>
>
> Have you made any changes to elasticsearch.yml? If so, please post. 
>
> Also, can you check that you can telnet to localhost:9300?
>
>
> On Mar 25, 2015, at 7:50 AM, Sai Asuka > 
> wrote:
>
> I don't "think" have any firewall rules on my machine. I have been able to 
> use python's elasticsearch library to create a new index successfully with 
> the default. 
> Unless there is something different with python to ES vs Java to ES 
> despite the libraries being "official" libraries.
>
> I am using the elasticsearch-java library, no plugins installed. The node 
> was installed using brew install elasticsearch, then elasticsearch start.
> In the web browser I can see my node:
> localhost:9200
>
> I am running locally. What baffles me is whenever I find a thread related 
> to a similar issue, it appears that no matter how new or old they are, it 
> appears there is no resolution.
>
> Does anyone have ideas? Is there some step that is unique to OSX, or 
> something else that needs to be done like flushing or something?
>
>
> On Wednesday, March 25, 2015 at 2:55:03 AM UTC-4, David Pilato wrote:
>>
>> Wondering if you have any firewall issue so discovery does not work here?
>>
>> I suppose that you are not using any plugin and that your node is 
>> correctly running locally?
>>
>> --
>> David ;-)
>> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
>>
>> Le 25 mars 2015 à 05:53, Sai Asuka  a écrit :
>>
>> Yes, which is why I was baffled. In fact, the code I used was straight 
>> out of that specific page.
>> The client code also came straight from the docs. (
>> http://www.elastic.co/guide/en/elasticsearch/client/java-api/current/client.html
>> ):
>>
>> So the code I used from the documentation that appears so basic does not 
>> work even though my cluster is running. The docs make it very simple, so I 
>> am surprised it does not work out of the box on my local machine with a 
>> single node (running on my local machine on OSX installed using brew for 
>> latest ES 1.5, the Java Elasticsearch jar is also 1.5:
>>
>> Node node = nodeBuilder().clusterName("yourclustername").node(); // I 
>> replaced yourclustername with my cluster name
>> //Node node = 
>> nodeBuilder().clusterName("yourclustername").client(true).node(); // this 
>> does not work either
>> Client client = node.client();
>>
>> String json = "{" +
>> "\"user\":\"kimchy\"," +
>> "\"postDate\":\"2013-01-30\"," +
>> "\"message\":\"trying out Elasticsearch\"" +
>> "}";
>>
>> IndexResponse response = client.prepareIndex("twitter", "tweet")
>> .setSource(json)
>> .execute()
>> .actionGet();
>>
>> What is the problem?
>>
>>
>>
>>
>>
>> On Wednesday, March 25, 2015 at 12:34:49 AM UTC-4, Mark Walkom wrote:
>>>
>>> I don't mean to be rude, but just because it doesn't work doesn't make 
>>> it a joke.
>>>
>>> Have you read the docs? 
>>> http://www.elastic.co/guide/en/elasticsearch/client/java-api/current/index.html
>>>
>>> On 25 March 2015 at 14:44, Sai Asuka  wrote:
>>>
>>>> The problem is in either case, I see no new index or anything.
>>>>
>>>> On Tuesday, March 24, 2015 at 11:43:49 PM UTC-4, Sai Asuka wrote:
>>>>>
>>>>> I am using elasticsearch java client, indexing a document "looks" 
>>>>> simple.
>>>>> I know 100% my cluster is running, and my name is create.
>>>>>
>>>>> Node node  = nodeBuilder().clusterName("mycluster").node();
>>>>>
>>>>> Client client = node.client();
>>>>>
>>>>> String json = "{" +
>>>>>
>>>>> "\"user\":\"kimchy\"," +
>>>>>
>>>>> "\"postDate\":\"2013-01-30\"," +
>>>>>
>>>>> "\"message\":\"trying out Elasticsearch\"" +
>>>>>

Elasticsearch index settings in pig?

2015-03-25 Thread Sai Asuka
Is it possible using the elasticsearch-hadoop connector in pig to create an 
index or set settings when the index autocreates such that it applies the 
following setting?

$ curl -XPUT 'http://localhost:9200/twitter/' -d '{

"settings" : {

"index" : {

"number_of_shards" : 3,

"number_of_replicas" : 2

}

}

}'


Or does the index have to be created before the pig script is run?

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/542e654e-f0a8-429e-8e0a-52297d0459ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is java elasticsearch a joke?

2015-03-25 Thread Sai Asuka
I don't "think" have any firewall rules on my machine. I have been able to 
use python's elasticsearch library to create a new index successfully with 
the default. 
Unless there is something different with python to ES vs Java to ES despite 
the libraries being "official" libraries.

I am using the elasticsearch-java library, no plugins installed. The node 
was installed using brew install elasticsearch, then elasticsearch start.
In the web browser I can see my node:
localhost:9200

I am running locally. What baffles me is whenever I find a thread related 
to a similar issue, it appears that no matter how new or old they are, it 
appears there is no resolution.

Does anyone have ideas? Is there some step that is unique to OSX, or 
something else that needs to be done like flushing or something?


On Wednesday, March 25, 2015 at 2:55:03 AM UTC-4, David Pilato wrote:
>
> Wondering if you have any firewall issue so discovery does not work here?
>
> I suppose that you are not using any plugin and that your node is 
> correctly running locally?
>
> --
> David ;-)
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
>
> Le 25 mars 2015 à 05:53, Sai Asuka > a 
> écrit :
>
> Yes, which is why I was baffled. In fact, the code I used was straight out 
> of that specific page.
> The client code also came straight from the docs. (
> http://www.elastic.co/guide/en/elasticsearch/client/java-api/current/client.html
> ):
>
> So the code I used from the documentation that appears so basic does not 
> work even though my cluster is running. The docs make it very simple, so I 
> am surprised it does not work out of the box on my local machine with a 
> single node (running on my local machine on OSX installed using brew for 
> latest ES 1.5, the Java Elasticsearch jar is also 1.5:
>
> Node node = nodeBuilder().clusterName("yourclustername").node(); // I 
> replaced yourclustername with my cluster name
> //Node node = 
> nodeBuilder().clusterName("yourclustername").client(true).node(); // this 
> does not work either
> Client client = node.client();
>
> String json = "{" +
> "\"user\":\"kimchy\"," +
> "\"postDate\":\"2013-01-30\"," +
> "\"message\":\"trying out Elasticsearch\"" +
> "}";
>
> IndexResponse response = client.prepareIndex("twitter", "tweet")
> .setSource(json)
> .execute()
> .actionGet();
>
> What is the problem?
>
>
>
>
>
> On Wednesday, March 25, 2015 at 12:34:49 AM UTC-4, Mark Walkom wrote:
>>
>> I don't mean to be rude, but just because it doesn't work doesn't make it 
>> a joke.
>>
>> Have you read the docs? 
>> http://www.elastic.co/guide/en/elasticsearch/client/java-api/current/index.html
>>
>> On 25 March 2015 at 14:44, Sai Asuka  wrote:
>>
>>> The problem is in either case, I see no new index or anything.
>>>
>>> On Tuesday, March 24, 2015 at 11:43:49 PM UTC-4, Sai Asuka wrote:
>>>>
>>>> I am using elasticsearch java client, indexing a document "looks" 
>>>> simple.
>>>> I know 100% my cluster is running, and my name is create.
>>>>
>>>> Node node  = nodeBuilder().clusterName("mycluster").node();
>>>>
>>>> Client client = node.client();
>>>>
>>>> String json = "{" +
>>>>
>>>> "\"user\":\"kimchy\"," +
>>>>
>>>> "\"postDate\":\"2013-01-30\"," +
>>>>
>>>> "\"message\":\"trying out Elasticsearch\"" +
>>>>
>>>> "}";
>>>>
>>>>
>>>> IndexResponse response = client.prepareIndex("twitter", "tweet")
>>>>
>>>> .setSource(json)
>>>>
>>>> .execute()
>>>>
>>>> .actionGet();
>>>>
>>>> I read somewhere that you should shove ".client(true)", but I get:
>>>>
>>>>
>>>> org.elasticsearch.discovery.MasterNotDiscoveredException
>>>>
>>>> What gives?
>>>>
>>>  -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "elasticsearch" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to elasticsearc...@googlegroups.com.
>>> To view this d

Re: Is java elasticsearch a joke?

2015-03-24 Thread Sai Asuka
Yes, which is why I was baffled. In fact, the code I used was straight out 
of that specific page.
The client code also came straight from the docs. 
(http://www.elastic.co/guide/en/elasticsearch/client/java-api/current/client.html):

So the code I used from the documentation that appears so basic does not 
work even though my cluster is running. The docs make it very simple, so I 
am surprised it does not work out of the box on my local machine with a 
single node (running on my local machine on OSX installed using brew for 
latest ES 1.5, the Java Elasticsearch jar is also 1.5:

Node node = nodeBuilder().clusterName("yourclustername").node(); // I 
replaced yourclustername with my cluster name
//Node node = 
nodeBuilder().clusterName("yourclustername").client(true).node(); // this 
does not work either
Client client = node.client();

String json = "{" +
"\"user\":\"kimchy\"," +
"\"postDate\":\"2013-01-30\"," +
"\"message\":\"trying out Elasticsearch\"" +
"}";

IndexResponse response = client.prepareIndex("twitter", "tweet")
.setSource(json)
.execute()
.actionGet();

What is the problem?





On Wednesday, March 25, 2015 at 12:34:49 AM UTC-4, Mark Walkom wrote:
>
> I don't mean to be rude, but just because it doesn't work doesn't make it 
> a joke.
>
> Have you read the docs? 
> http://www.elastic.co/guide/en/elasticsearch/client/java-api/current/index.html
>
> On 25 March 2015 at 14:44, Sai Asuka > 
> wrote:
>
>> The problem is in either case, I see no new index or anything.
>>
>> On Tuesday, March 24, 2015 at 11:43:49 PM UTC-4, Sai Asuka wrote:
>>>
>>> I am using elasticsearch java client, indexing a document "looks" simple.
>>> I know 100% my cluster is running, and my name is create.
>>>
>>> Node node  = nodeBuilder().clusterName("mycluster").node();
>>>
>>> Client client = node.client();
>>>
>>> String json = "{" +
>>>
>>> "\"user\":\"kimchy\"," +
>>>
>>> "\"postDate\":\"2013-01-30\"," +
>>>
>>> "\"message\":\"trying out Elasticsearch\"" +
>>>
>>> "}";
>>>
>>>
>>> IndexResponse response = client.prepareIndex("twitter", "tweet")
>>>
>>> .setSource(json)
>>>
>>> .execute()
>>>
>>> .actionGet();
>>>
>>> I read somewhere that you should shove ".client(true)", but I get:
>>>
>>>
>>> org.elasticsearch.discovery.MasterNotDiscoveredException
>>>
>>> What gives?
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "elasticsearch" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to elasticsearc...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elasticsearch/4c62ee1f-6224-4749-bd28-16e47a200b09%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/elasticsearch/4c62ee1f-6224-4749-bd28-16e47a200b09%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/252076e0-b1d9-4142-b108-72b47f7841dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is java elasticsearch a joke?

2015-03-24 Thread Sai Asuka
The problem is in either case, I see no new index or anything.

On Tuesday, March 24, 2015 at 11:43:49 PM UTC-4, Sai Asuka wrote:
>
> I am using elasticsearch java client, indexing a document "looks" simple.
> I know 100% my cluster is running, and my name is create.
>
> Node node  = nodeBuilder().clusterName("mycluster").node();
>
> Client client = node.client();
>
> String json = "{" +
>
> "\"user\":\"kimchy\"," +
>
> "\"postDate\":\"2013-01-30\"," +
>
> "\"message\":\"trying out Elasticsearch\"" +
>
> "}";
>
>
> IndexResponse response = client.prepareIndex("twitter", "tweet")
>
> .setSource(json)
>
> .execute()
>
> .actionGet();
>
> I read somewhere that you should shove ".client(true)", but I get:
>
>
> org.elasticsearch.discovery.MasterNotDiscoveredException
>
> What gives?
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/4c62ee1f-6224-4749-bd28-16e47a200b09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Is java elasticsearch a joke?

2015-03-24 Thread Sai Asuka
I am using elasticsearch java client, indexing a document "looks" simple.
I know 100% my cluster is running, and my name is create.

Node node  = nodeBuilder().clusterName("mycluster").node();

Client client = node.client();

String json = "{" +

"\"user\":\"kimchy\"," +

"\"postDate\":\"2013-01-30\"," +

"\"message\":\"trying out Elasticsearch\"" +

"}";


IndexResponse response = client.prepareIndex("twitter", "tweet")

.setSource(json)

.execute()

.actionGet();

I read somewhere that you should shove ".client(true)", but I get:


org.elasticsearch.discovery.MasterNotDiscoveredException

What gives?

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/e6b7b18e-69a5-41c3-a192-27cf37b230fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to index data from s3 into elasticsearch?

2015-03-18 Thread Sai Asuka
What is the easiest way to get data out of s3 and into elasticsearch for a 
simple JSON file?

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/7cdf7209-849b-41f1-961a-ba38c9f8b90e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Elasticsearch Index Polygons?

2015-02-24 Thread Sai Asuka
Can additional, searchable properties fields be added to this? Say I wanted 
to do a geosearch by location and by time property?

Is it recommended to shove it into a properties: {} field like geojson? Or 
is it supposed to be peer to location or does it not really matter?

On Tuesday, February 24, 2015 at 3:52:50 AM UTC-5, Georgi Ivanov wrote:
>
> Like Jun said,
> You need geo shape type.
>
> The problem is, it is very slow to index shapes (except POINT).
>
> I tried with line-strings and it is extremely slow with linestring 10 
> points long or longer.
>
> It is just killing the CPU.
>
>
>
> On Tuesday, February 24, 2015 at 6:38:37 AM UTC+1, Sai Asuka wrote:
>>
>> So I see the elasticsearch claims to use "GeoJSON" as the format for 
>> indexing... but when I look at the docs.. the same it gives is:
>>
>>
>> {
>> "location" : {
>> "type" : "polygon",
>> "coordinates" : [
>> [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], 
>> [100.0, 0.0] ]
>> ]
>> }
>> }
>>
>>
>> Doesn't GeoJSON look like this?
>>
>> {
>> "type": "Feature",
>> "properties": {
>>"name": "Sparkle",
>>"age": 11
>> },
>> geometry: {
>>   "type" : "polygon",
>>   "coordinates" : [[[100.0, 0.0], [101.0,0.0], [101.0, 1.0], [100.0], 
>> [100.0, 0.0]]]
>> }
>> }
>>
>> My question is how do I index polygons in elasticsearch if I want to 
>> attach properties to it? If I wanted to perform a bulk load for example, 
>> what does one document look like that has polygon information that I can 
>> perform geospatial queries on?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/cdb3c63b-a58f-4c0a-bc76-6bc10b163513%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Elasticsearch Index Polygons?

2015-02-23 Thread Sai Asuka
So I see the elasticsearch claims to use "GeoJSON" as the format for 
indexing... but when I look at the docs.. the same it gives is:


{
"location" : {
"type" : "polygon",
"coordinates" : [
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 
0.0] ]
]
}
}


Doesn't GeoJSON look like this?

{
"type": "Feature",
"properties": {
   "name": "Sparkle",
   "age": 11
},
geometry: {
  "type" : "polygon",
  "coordinates" : [[[100.0, 0.0], [101.0,0.0], [101.0, 1.0], [100.0], 
[100.0, 0.0]]]
}
}

My question is how do I index polygons in elasticsearch if I want to attach 
properties to it? If I wanted to perform a bulk load for example, what does 
one document look like that has polygon information that I can perform 
geospatial queries on?

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/41cd2d8a-e5e1-450b-bb2f-d9ddac69633b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.