Re[2]: ES: Ways to work with frequently updated fields of document

2015-03-24 Thread Александр Свиридов
 By different systems do you mean database, ES etc?


Среда, 25 марта 2015, 8:32 +11:00 от Mark Walkom :
>Best best is to try to separate hot and cold/warm data so you are only 
>updating things which *need* to be updated.
>It may make sense to split this out into different systems, but this is really 
>up to you.
>
>On 25 March 2015 at 04:28, Александр Свиридов  < ooo_satu...@mail.ru > wrote:
>>I have forum. And every topic has such field as viewCount - how many times 
>>topic was viewed by forum users. 
>>
>>I wanted that all fields of topics were taken from ES (id,date,title,content 
>>and viewCount). However, this case after every topic view ES must reindex 
>>entire document again - I asked the question about particial update at stack 
>>-  
>>http://stackoverflow.com/questions/28937946/partial-update-on-field-that-is-not-indexed
>> .
>>
>>It means that if topic is viewed 1000 times ES will index it 1000 times. And 
>>if I have a lot of users many documents will be indexed again and again. This 
>>is first strategy.
>>
>>The second strategy, as I think is to take some fields of topic from index 
>>and some from database. At this case I take viewAcount from DB. However, then 
>>I can store all fields in DB and use index only as INDEX - to get ids of 
>>current topic.
>>
>>Are there better strategies? What is the best way to solve such problem?
>>
>>
>>-- 
>>Александр Свиридов
>>-- 
>>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/1427218099.583181766%40f355.i.mail.ru
>> .
>>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/CAEYi1X9P6L49jbDpOccA_z-ckKVFjz1o%2BXWWttN%2BYneL0YBfDg%40mail.gmail.com
> .
>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/1427261899.358293155%40f317.i.mail.ru.
For more options, visit https://groups.google.com/d/optout.


ES: Ways to work with frequently updated fields of document

2015-03-24 Thread Александр Свиридов
 I have forum. And every topic has such field as viewCount - how many times 
topic was viewed by forum users. 

I wanted that all fields of topics were taken from ES (id,date,title,content 
and viewCount). However, this case after every topic view ES must reindex 
entire document again - I asked the question about particial update at stack -  
http://stackoverflow.com/questions/28937946/partial-update-on-field-that-is-not-indexed
 .

It means that if topic is viewed 1000 times ES will index it 1000 times. And if 
I have a lot of users many documents will be indexed again and again. This is 
first strategy.

The second strategy, as I think is to take some fields of topic from index and 
some from database. At this case I take viewAcount from DB. However, then I can 
store all fields in DB and use index only as INDEX - to get ids of current 
topic.

Are there better strategies? What is the best way to solve such problem?


-- 
Александр Свиридов

-- 
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/1427218099.583181766%40f355.i.mail.ru.
For more options, visit https://groups.google.com/d/optout.


Re[2]: Best strategy for often updated documents.

2015-03-23 Thread Александр Свиридов
 Thank you for reply. I dont' need viewCount field to be indexed. I need this 
field only to be displayed, because data I take from ES. For example when user 
open forum section of the site he see topics (with information how many times 
each of them was viewed) from elastic. The problem is that one field is updated 
very often (even if I will reindex every minute,or 5 minutes). 

There are two terms - particial update and particial reindex. As I understand 
even when you do particial update (only one field of document) ES reindex 
entire document. 

As I understand you did this way - this often updated field you don't display 
by default. But I need to show it always.


Понедельник, 23 марта 2015, 6:23 -07:00 от Joel Potischman 
:
>One thing you might want to consider is whether or not you need your index to 
>stay perfectly in synch with your database. If a topic is viewed 1000 times 
>over the course of 2 minutes, is it important that Elasticsearch update after 
>every one? Maybe after each update you queue a reindexing, but you only 
>reindex once a minute and ignore duplicates. In this example instead of 
>reindexing 1000 times you'd reindex twice, and your index would still be 
>near-realtime. But that depends on the business requirements.
>
>If you absolutely need every update to be applied to your index ASAP you'd 
>have to use partial updates. If you don't need to search on viewCount at all, 
>then you shouldn't let an update to that field trigger a reindex/update at 
>all. We have a similar situation with a field that can be 
>incremented/decremented constantly and we ignore it in our ingestion process. 
>Search operates against the text fields and returns basic info - item 
>descriptions, etc. - and the URL to the canonical version of the resource in 
>our API. Clients that care about those dynamic fields can then hit the API to 
>get all fields including the up-to-the-millisecond count fields.
>
>On Saturday, March 21, 2015 at 4:24:25 AM UTC-4, ooo_saturn7 wrote:
>>I have forum. And every topic has such field as viewCount - how many times 
>>topic was viewed by forum users. 
>>
>>I wanted that all fields of topics were taken from ES (id,date,title,content 
>>and viewCount). However, this case after every topic view ES must reindex 
>>entire document again - I asked the question about particial update at stack 
>>-  
>>http://stackoverflow.com/questions/28937946/partial-update-on-field-that-is-not-indexed
>> .
>>
>>It means that if topic is viewed 1000 times ES will index it 1000 times. And 
>>if I have a lot of users many documents will be indexed again and again. This 
>>is first strategy.
>>
>>The second strategy, as I think is to take some fields of topic from index 
>>and some from database. At this case I take viewAcount from DB. However, then 
>>I can store all fields in DB and use index only as INDEX - to get ids of 
>>current topic.
>>
>>Are there better strategies? What is the best way to solve such problem?
>>
>>
>>-- 
>>Александр Свиридов

-- 
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/1427117659.226985795%40f229.i.mail.ru.
For more options, visit https://groups.google.com/d/optout.


Strategies for working with often updated documents

2015-03-23 Thread Александр Свиридов
 I have forum. And every topic has such field as viewCount - how many times 
topic was viewed by forum users. 

I wanted that all fields of topics were taken from ES (id,date,title,content 
and viewCount). However, this case after every topic view ES must reindex 
entire document again - I asked the question about particial update at stack -  
http://stackoverflow.com/questions/28937946/partial-update-on-field-that-is-not-indexed
 .

It means that if topic is viewed 1000 times ES will index it 1000 times. And if 
I have a lot of users many documents will be indexed again and again. This is 
first strategy.

The second strategy, as I think is to take some fields of topic from index and 
some from database. At this case I take viewAcount from DB. However, then I can 
store all fields in DB and use index only as INDEX - to get ids of current 
topic.

Are there better strategies? What is the best way to solve such problem? 
Please, help me.


-- 
Александр Свиридов

-- 
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/1427115143.616916807%40f207.i.mail.ru.
For more options, visit https://groups.google.com/d/optout.


Best strategy for often updated documents.

2015-03-21 Thread Александр Свиридов
 I have forum. And every topic has such field as viewCount - how many times 
topic was viewed by forum users. 

I wanted that all fields of topics were taken from ES (id,date,title,content 
and viewCount). However, this case after every topic view ES must reindex 
entire document again - I asked the question about particial update at stack -  
http://stackoverflow.com/questions/28937946/partial-update-on-field-that-is-not-indexed
 .

It means that if topic is viewed 1000 times ES will index it 1000 times. And if 
I have a lot of users many documents will be indexed again and again. This is 
first strategy.

The second strategy, as I think is to take some fields of topic from index and 
some from database. At this case I take viewAcount from DB. However, then I can 
store all fields in DB and use index only as INDEX - to get ids of current 
topic.

Are there better strategies? What is the best way to solve such problem?


-- 
Александр Свиридов

-- 
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/1426926256.618220498%40f392.i.mail.ru.
For more options, visit https://groups.google.com/d/optout.


Re[2]: Are documents of different types indexed via one index?

2015-03-20 Thread Александр Свиридов
 So, as I understand you ritgh all documents of all types in one index indexed 
together. Not as in databases - one table (ome type) - one index.


Пятница, 20 марта 2015, 14:19 -07:00 от Mark Walkom :
>You can mix types in a single index, but we recommend you separate them out.
>
>Obviously a search against 30 docs is a lot faster than one against 1 billion.
>
>On 20 March 2015 at 13:08, Александр Свиридов  < ooo_satu...@mail.ru > wrote:
>>From ES document I understood that index is like database and document type 
>>is like table. Every table has its own indexes.
>>
>>Let's suppose we have one ES index with two document types (posts and book) 
>>and we have 10 posts and 30 books. If I  search for some text 
>>expression in ONLY books will my query be very fast or  slow? By other words 
>>- documents of different types are indexed via one index or for every 
>>document type separate index is created?
>>
>>
>>-- 
>>Александр Свиридов
>>-- 
>>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/1426882118.273423714%40f319.i.mail.ru
>> .
>>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/CAEYi1X9JTafPbhBBeL4GLj3Bs_wenZsRP5DnutQVu0gU%3DdypLQ%40mail.gmail.com
> .
>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/1426887424.631597516%40f411.i.mail.ru.
For more options, visit https://groups.google.com/d/optout.


Are documents of different types indexed via one index?

2015-03-20 Thread Александр Свиридов
 From ES document I understood that index is like database and document type is 
like table. Every table has its own indexes.

Let's suppose we have one ES index with two document types (posts and book) and 
we have 10 posts and 30 books. If I  search for some text expression in 
ONLY books will my query be very fast or  slow? By other words - documents of 
different types are indexed via one index or for every document type separate 
index is created?


-- 
Александр Свиридов

-- 
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/1426882118.273423714%40f319.i.mail.ru.
For more options, visit https://groups.google.com/d/optout.


Multifield search using java api

2015-03-18 Thread Александр Свиридов
 I have three fields: authorId, title,content.

Could any one provide code how to make query that will find expression "english 
grammer" in title and content of the author with id=10?
Please, just a piece of code, as I've read MatchQuery, MultiMatch,BooleanQuery 
but can't understand how to do that.

SearchResponse response = client.prepareSearch("test")
    .setTypes("book")
    .setSearchType(SearchType.QUERY_AND_FETCH)
    .setQuery()
    .setFrom(startFrom).setSize(10).setExplain(true)
    .execute()
    .actionGet();

-- 
Александр Свиридов

-- 
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/1426702804.14201996%40f263.i.mail.ru.
For more options, visit https://groups.google.com/d/optout.


Explicit refresh with bulk request.

2015-03-18 Thread Александр Свиридов
 I insert documents using bulk request. If I set refresh interval to 60 seconds 
like this
 "settings":{
    "index.refresh_interval":"10"
    },

but at the same time I will do explicit refresh every 10 seconds using cron 
like this
client.admin().indices().refresh(new 
RefreshRequest("elasticsearch")).actionGet();

Will elastic do auto refresh every 60 seconds? The question is about from what 
point of time elastic will count these 60 seconds.

-- 
Александр Свиридов

-- 
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/1426695671.15906000%40f334.i.mail.ru.
For more options, visit https://groups.google.com/d/optout.


Re[2]: Java API TransportClient Threadpool

2015-03-18 Thread Александр Свиридов
 Can you say how we can configure this pool?


Среда, 18 марта 2015, 9:10 +01:00 от "joergpra...@gmail.com" 
:
>There is a connection pool. Netty connections are pooled, they can connect to 
>multiple nodes at the same time.
>
>All requests are submitted asynchronously. It means, submitting and receiving 
>may happen on different threads. They do not block.
>
>Jörg
>
>On Wed, Mar 18, 2015 at 8:47 AM, Abid Hussain  < huss...@novacom.mygbiz.com > 
>wrote:
>>Hi all,
>>
>>I would like to understand how TransportClient works in terms of how it uses 
>>it's thread pool.
>>*  As it uses a threadpool I assume that every request is performed in it's 
>>own thread - is that correct?
>>*  If so, does that mean that i.e. it's pool size is 20 and 21 search 
>>requests are coming at the same time the 21st one has to wait until one of 
>>the 20 running requests are finished? And, finally: why does it use a thread 
>>pool at all? I mean, all the work is done on server side and when I think of 
>>database clients I would have rather expected something like a connection 
>>pool.
>>
>>Best Regards,
>>
>>Abid
>>
>>
>>-- 
>>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/6bd05293-03f7-417e-9801-a5a6748bc1db%40googlegroups.com
>> .
>>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/CAKdsXoGsky2s5NoszHsSM%2BF0cwnzkgVTsVCw317N2ey%3DwUX07A%40mail.gmail.com
> .
>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/142581.846598748%40f177.i.mail.ru.
For more options, visit https://groups.google.com/d/optout.


Elasticsearch - transport client singleton

2015-03-17 Thread Александр Свиридов
 I am newbie in elastic and I don't understand how should I work with transport 
client connections. Should I use singleton for Client, something like

class ElasticClientManager {
  private static Client client;
 
 public static Client getClient(){
    if (client==null) {
  Settings settings = ImmutableSettings.settingsBuilder()
    .put("cluster.name", "elasticsearch")
    .put("client.transport.sniff", true).build();

   client = new TransportClient(settings)
    .addTransportAddress(new 
InetSocketTransportAddress("localhost",9300));
    }
   return client;
 }
}

By other words - I create one client and keep the reference in it in singleton. 
Every time I need to query elastic I do

Client client = ElasticClientManager.getClient();
GetResponse getResponse = client.prepareGet().execute().actionGet();

Is such approach right?


-- 
Александр Свиридов

-- 
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/1426616605.710285922%40f217.i.mail.ru.
For more options, visit https://groups.google.com/d/optout.


Elasticsearch - transport client singleton

2015-03-17 Thread Александр Свиридов
 I am newbie in elastic and I don't understand how should I work with transport 
client connections. Should I use singleton for Client, something like

class ElasticClientManager {
  private static Client client;
 
 public static Client getClient(){
    if (client==null) {
  Settings settings = ImmutableSettings.settingsBuilder()
    .put("cluster.name", "elasticsearch")
    .put("client.transport.sniff", true).build();

   client = new TransportClient(settings)
    .addTransportAddress(new 
InetSocketTransportAddress("localhost",9300));
    }
   return client;
 }
}

By other words - I create one client and keep the reference in it in singleton. 
Every time I need to query elastic I do

Client client = ElasticClientManager.getClient();
GetResponse getResponse = client.prepareGet().execute().actionGet();

Is such approach right? 

-- 
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/1426616386.538391541%40f217.i.mail.ru.
For more options, visit https://groups.google.com/d/optout.


Re[6]: Elasticsearch - node client does not connect to cluster

2015-03-17 Thread Александр Свиридов
 I agree with you that in single node environment only transport layer should 
be used. But I want to know how to make node client work because maybe I will 
need it in future and I want to know what I can do with elastic java api.


Вторник, 17 марта 2015, 11:56 -06:00 от Aaron Mefford :
>What is the advantage you expect from using the Node client, especially in a 
>single node environment?
>
>With client.transport.sniff true it should discover the other nodes, if other 
>nodes exist.
>
>On Tue, Mar 17, 2015 at 11:42 AM, Александр Свиридов  < ooo_satu...@mail.ru > 
>wrote:
>>Thank you. I did this way:
>>
>> Settings settings = ImmutableSettings.settingsBuilder()
>>    .put(" cluster.name ", "elasticsearch")
>>    .put("client.transport.sniff", true).build();
>>
>>    Client client = new TransportClient(settings)
>>    .addTransportAddress(new 
>>InetSocketTransportAddress("localhost",9300));
>>
>>And everything works fine. So, both cluster and index exist.
>>
>>However, as I understand it is not node client. What you sugget is transport 
>>client. Now I want to understand how to make node client work. 
>>
>>
>>Вторник, 17 марта 2015, 11:26 -06:00 от Aaron Mefford < aa...@definemg.com >:
>>>This is what I use in my code, not sure how correct it is given the abysmal 
>>>state of the the Java API documentation.
>>>
>>>import org.elasticsearch.common.settings.Settings;
>>>import org.elasticsearch.common.settings.ImmutableSettings;
>>>import org.elasticsearch.client.Client;
>>>import org.elasticsearch.client.transport.TransportClient;
>>>import org.elasticsearch.common.transport.InetSocketTransportAddress;
>>>
>>>
>>>
>>>        Settings settings = ImmutableSettings.settingsBuilder()
>>>                                .put(" cluster.name ", elasticClusterName)
>>>                                .put("client.transport.sniff", true).build();
>>>
>>>        esClient = new TransportClient(settings)
>>>            .addTransportAddress(new 
>>>InetSocketTransportAddress(elasticHost,elasticPort));
>>>
>>>
>>>On Tue, Mar 17, 2015 at 11:19 AM, Александр Свиридов  < ooo_satu...@mail.ru 
>>>> wrote:
>>>>I am quite newbie to elactis. Could you explain with java code what you 
>>>>mean?
>>>>
>>>>
>>>>Вторник, 17 марта 2015, 9:46 -07:00 от  aa...@definemg.com :
>>>>>Is there a reason not to just specify the IP address and to try and rely 
>>>>>on multicast?
>>>>>
>>>>>I realize this is all on one node as you have stated that, but that seems 
>>>>>even more reason that it would be little issue to specify the IP.  While 
>>>>>multicast makes it easy to stand up a cluster in an ideal situation, my 
>>>>>experience has been that it leads to more problems down the road, and 
>>>>>things generally work better when not using multicast.   I heard the same 
>>>>>suggestion repeatedly at Elastic{on}.
>>>>>
>>>>>Aaron
>>>>>
>>>>>On Tuesday, March 17, 2015 at 9:25:46 AM UTC-6, ooo_saturn7 wrote:
>>>>>>I have one physical server and I work only on it (no other servers).
>>>>>>At this server I have running elastic 1.4.2 - I use this version as this 
>>>>>>is the last version elastic osgi bundle is ready for. Also at this server 
>>>>>>I have glassfish 4.1 as java-ee server.
>>>>>>I run elastic node client inside my java-ee application. And I do it this 
>>>>>>way:
>>>>>>Node node = nodeBuilder().local(true).clusterName("elasticsearch").node();
>>>>>>Client client = node.client();
>>>>>>GetResponse getResponse = 
>>>>>>client.prepareGet("my.index-0.2.2","post","1").execute().actionGet();
>>>>>>Map source = getResponse.getSource();
>>>>>>System.out.println("--");
>>>>>>System.out.println("Index: "+ getResponse.getIndex());
>>>>>>System.out.println("Type: "+ getResponse.getType());
>>>>>>System.out.println("Id: "+ getResponse.getId());
>>>>>>System.out.println("Version: "+ getResponse.getVersion());
>>>>>

Re[4]: Elasticsearch - node client does not connect to cluster

2015-03-17 Thread Александр Свиридов
 Thank you. I did this way:

 Settings settings = ImmutableSettings.settingsBuilder()
    .put("cluster.name", "elasticsearch")
    .put("client.transport.sniff", true).build();

    Client client = new TransportClient(settings)
    .addTransportAddress(new 
InetSocketTransportAddress("localhost",9300));

And everything works fine. So, both cluster and index exist.

However, as I understand it is not node client. What you sugget is transport 
client. Now I want to understand how to make node client work. 


Вторник, 17 марта 2015, 11:26 -06:00 от Aaron Mefford :
>This is what I use in my code, not sure how correct it is given the abysmal 
>state of the the Java API documentation.
>
>import org.elasticsearch.common.settings.Settings;
>import org.elasticsearch.common.settings.ImmutableSettings;
>import org.elasticsearch.client.Client;
>import org.elasticsearch.client.transport.TransportClient;
>import org.elasticsearch.common.transport.InetSocketTransportAddress;
>
>
>
>        Settings settings = ImmutableSettings.settingsBuilder()
>                                .put(" cluster.name ", elasticClusterName)
>                                .put("client.transport.sniff", true).build();
>
>        esClient = new TransportClient(settings)
>            .addTransportAddress(new 
>InetSocketTransportAddress(elasticHost,elasticPort));
>
>
>On Tue, Mar 17, 2015 at 11:19 AM, Александр Свиридов  < ooo_satu...@mail.ru > 
>wrote:
>>I am quite newbie to elactis. Could you explain with java code what you mean?
>>
>>
>>Вторник, 17 марта 2015, 9:46 -07:00 от  aa...@definemg.com :
>>>Is there a reason not to just specify the IP address and to try and rely on 
>>>multicast?
>>>
>>>I realize this is all on one node as you have stated that, but that seems 
>>>even more reason that it would be little issue to specify the IP.  While 
>>>multicast makes it easy to stand up a cluster in an ideal situation, my 
>>>experience has been that it leads to more problems down the road, and things 
>>>generally work better when not using multicast.   I heard the same 
>>>suggestion repeatedly at Elastic{on}.
>>>
>>>Aaron
>>>
>>>On Tuesday, March 17, 2015 at 9:25:46 AM UTC-6, ooo_saturn7 wrote:
>>>>I have one physical server and I work only on it (no other servers).
>>>>At this server I have running elastic 1.4.2 - I use this version as this is 
>>>>the last version elastic osgi bundle is ready for. Also at this server I 
>>>>have glassfish 4.1 as java-ee server.
>>>>I run elastic node client inside my java-ee application. And I do it this 
>>>>way:
>>>>Node node = nodeBuilder().local(true).clusterName("elasticsearch").node();
>>>>Client client = node.client();
>>>>GetResponse getResponse = 
>>>>client.prepareGet("my.index-0.2.2","post","1").execute().actionGet();
>>>>Map source = getResponse.getSource();
>>>>System.out.println("--");
>>>>System.out.println("Index: "+ getResponse.getIndex());
>>>>System.out.println("Type: "+ getResponse.getType());
>>>>System.out.println("Id: "+ getResponse.getId());
>>>>System.out.println("Version: "+ getResponse.getVersion());
>>>>System.out.println(source);
>>>>
>>>>In log I see the following:
>>>>>[2015-03-17T12:57:44.447+0400] [glassfish 4.1] [INFO] [] 
>>>>>[org.elasticsearch.discovery] [tid: _ThreadID=30 
>>>>>_ThreadName=http-listener-1(1)] [timeMillis: 1426582664447] [levelValue: 
>>>>>800] [[ [Pistol] elasticsearch/SCKIrGHQTaC5eEYmYfZ0Iw]]
>>>>>[2015-03-17T12:57:44.449+0400] [glassfish 4.1] [INFO] [] 
>>>>>[org.elasticsearch.cluster.service] [tid: _ThreadID=128 
>>>>>_ThreadName=elasticsearch[Pistol][clusterService#updateTask][T#1]] 
>>>>>[timeMillis: 1426582664449] [levelValue: 800] [[ [Pistol] master {new 
>>>>>[Pistol][SCKIrGHQTaC5eEYmYfZ0Iw][ webserver1.com ][local[1]]{local=true}}, 
>>>>>removed {[Pistol][uwaWFb6KTy2Sdoc8TNwdSQ][ webserver1.com 
>>>>>][local[1]]{local=true},}, reason: local-disco-initial_connect(master)]]
>>>>>[2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] [] 
>>>>>[org.elasticsearch.http] [tid: _ThreadID=30 
>>>>>_ThreadName=ht

Re[2]: Elasticsearch - node client does not connect to cluster

2015-03-17 Thread Александр Свиридов
 I am quite newbie to elactis. Could you explain with java code what you mean?


Вторник, 17 марта 2015, 9:46 -07:00 от aa...@definemg.com:
>Is there a reason not to just specify the IP address and to try and rely on 
>multicast?
>
>I realize this is all on one node as you have stated that, but that seems even 
>more reason that it would be little issue to specify the IP.  While multicast 
>makes it easy to stand up a cluster in an ideal situation, my experience has 
>been that it leads to more problems down the road, and things generally work 
>better when not using multicast.   I heard the same suggestion repeatedly at 
>Elastic{on}.
>
>Aaron
>
>On Tuesday, March 17, 2015 at 9:25:46 AM UTC-6, ooo_saturn7 wrote:
>>I have one physical server and I work only on it (no other servers).
>>At this server I have running elastic 1.4.2 - I use this version as this is 
>>the last version elastic osgi bundle is ready for. Also at this server I have 
>>glassfish 4.1 as java-ee server.
>>I run elastic node client inside my java-ee application. And I do it this way:
>>Node node = nodeBuilder().local(true).clusterName("elasticsearch").node();
>>Client client = node.client();
>>GetResponse getResponse = 
>>client.prepareGet("my.index-0.2.2","post","1").execute().actionGet();
>>Map source = getResponse.getSource();
>>System.out.println("--");
>>System.out.println("Index: "+ getResponse.getIndex());
>>System.out.println("Type: "+ getResponse.getType());
>>System.out.println("Id: "+ getResponse.getId());
>>System.out.println("Version: "+ getResponse.getVersion());
>>System.out.println(source);
>>
>>In log I see the following:
>>>[2015-03-17T12:57:44.447+0400] [glassfish 4.1] [INFO] [] 
>>>[org.elasticsearch.discovery] [tid: _ThreadID=30 
>>>_ThreadName=http-listener-1(1)] [timeMillis: 1426582664447] [levelValue: 
>>>800] [[ [Pistol] elasticsearch/SCKIrGHQTaC5eEYmYfZ0Iw]]
>>>[2015-03-17T12:57:44.449+0400] [glassfish 4.1] [INFO] [] 
>>>[org.elasticsearch.cluster.service] [tid: _ThreadID=128 
>>>_ThreadName=elasticsearch[Pistol][clusterService#updateTask][T#1]] 
>>>[timeMillis: 1426582664449] [levelValue: 800] [[ [Pistol] master {new 
>>>[Pistol][SCKIrGHQTaC5eEYmYfZ0Iw][ webserver1.com ][local[1]]{local=true}}, 
>>>removed {[Pistol][uwaWFb6KTy2Sdoc8TNwdSQ][ webserver1.com 
>>>][local[1]]{local=true},}, reason: local-disco-initial_connect(master)]]
>>>[2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] [] 
>>>[org.elasticsearch.http] [tid: _ThreadID=30 _ThreadName=http-listener-1(1)] 
>>>[timeMillis: 1426582664502] [levelValue: 800] [[ [Pistol] bound_address 
>>>{inet[/0:0:0:0:0:0:0:0:9202]}, publish_address {inet[/SERVER IP:9202]}]]
>>>[2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] [] 
>>>[org.elasticsearch.node] [tid: _ThreadID=30 _ThreadName=http-listener-1(1)] 
>>>[timeMillis: 1426582664502] [levelValue: 800] [[ [Pistol] started]]
>>and I get this exeption: ...
>>Caused by: 
>> org.elasticsearch.indices.IndexMissingException:[my.index-0.2.2] missing
at 
org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:768)
at 
org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:691)
at 
org.elasticsearch.cluster.metadata.MetaData.concreteSingleIndex(MetaData.java:748)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:139)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:116)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:89)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:55)
at 
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:75)
at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:98)
at 
org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:193)
at 
org.elasticsearch.action.get.GetRequestBuilder.doExecute(GetRequestBuilder.java:201)
at 
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:91)
at 
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:65)
>>
>>So it can't find the index - my.index-0.2.2. However this index exists! 
>>Besides, when I do curl -XGET ' http://localhost:9200/_cluster/state?pretty=1 
>>' I see there only one node and this  is not SCKIrGHQTaC5eEYmYfZ0Iw. I 
>>suppose that the node I create using java API creates new cluster and dosn't 
>>connect to my existing cluster - that's why it says - it's master. Or I don't 
>>understand something I have problem with code. Besides I've checked tha name 
>>of cluster it's elasticsearch. So, how can I connect to my existing 
>>elasticsearch cluster?
>-- 
>You

Elasticsearch - node client does not connect to cluster

2015-03-17 Thread Александр Свиридов

I have one physical server and I work only on it (no other servers).
At this server I have running elastic 1.4.2 - I use this version as this is the 
last version elastic osgi bundle is ready for. Also at this server I have 
glassfish 4.1 as java-ee server.
I run elastic node client inside my java-ee application. And I do it this way:
Node node = nodeBuilder().local(true).clusterName("elasticsearch").node();
Client client = node.client();
GetResponse getResponse = 
client.prepareGet("my.index-0.2.2","post","1").execute().actionGet();
Map source = getResponse.getSource();
System.out.println("--");
System.out.println("Index: "+ getResponse.getIndex());
System.out.println("Type: "+ getResponse.getType());
System.out.println("Id: "+ getResponse.getId());
System.out.println("Version: "+ getResponse.getVersion());
System.out.println(source);

In log I see the following:
>[2015-03-17T12:57:44.447+0400] [glassfish 4.1] [INFO] [] 
>[org.elasticsearch.discovery] [tid: _ThreadID=30 
>_ThreadName=http-listener-1(1)] [timeMillis: 1426582664447] [levelValue: 800] 
>[[ [Pistol] elasticsearch/SCKIrGHQTaC5eEYmYfZ0Iw]]
>[2015-03-17T12:57:44.449+0400] [glassfish 4.1] [INFO] [] 
>[org.elasticsearch.cluster.service] [tid: _ThreadID=128 
>_ThreadName=elasticsearch[Pistol][clusterService#updateTask][T#1]] 
>[timeMillis: 1426582664449] [levelValue: 800] [[ [Pistol] master {new 
>[Pistol][SCKIrGHQTaC5eEYmYfZ0Iw][ webserver1.com ][local[1]]{local=true}}, 
>removed {[Pistol][uwaWFb6KTy2Sdoc8TNwdSQ][ webserver1.com 
>][local[1]]{local=true},}, reason: local-disco-initial_connect(master)]]
>[2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] [] 
>[org.elasticsearch.http] [tid: _ThreadID=30 _ThreadName=http-listener-1(1)] 
>[timeMillis: 1426582664502] [levelValue: 800] [[ [Pistol] bound_address 
>{inet[/0:0:0:0:0:0:0:0:9202]}, publish_address {inet[/SERVER IP:9202]}]]
>[2015-03-17T12:57:44.502+0400] [glassfish 4.1] [INFO] [] 
>[org.elasticsearch.node] [tid: _ThreadID=30 _ThreadName=http-listener-1(1)] 
>[timeMillis: 1426582664502] [levelValue: 800] [[ [Pistol] started]]
and I get this exeption: ...
Caused by: org.elasticsearch.indices.IndexMissingException:[my.index-0.2.2] 
missing
at 
org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:768)
at 
org.elasticsearch.cluster.metadata.MetaData.concreteIndices(MetaData.java:691)
at 
org.elasticsearch.cluster.metadata.MetaData.concreteSingleIndex(MetaData.java:748)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:139)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction$AsyncSingleAction.(TransportShardSingleOperationAction.java:116)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:89)
at 
org.elasticsearch.action.support.single.shard.TransportShardSingleOperationAction.doExecute(TransportShardSingleOperationAction.java:55)
at 
org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:75)
at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:98)
at 
org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:193)
at 
org.elasticsearch.action.get.GetRequestBuilder.doExecute(GetRequestBuilder.java:201)
at 
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:91)
at 
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:65)

So it can't find the index - my.index-0.2.2. However this index exists! 
Besides, when I do  curl -XGET ' http://localhost:9200/_cluster/state?pretty=1 
' I see there only one node and this  is not SCKIrGHQTaC5eEYmYfZ0Iw. I suppose 
that the node I create using java API creates new cluster and dosn't connect to 
my existing cluster - that's why it says - it's master. Or I don't understand 
something I have problem with code. Besides I've checked tha name of cluster 
it's  elasticsearch . So, how can I connect to my existing elasticsearch 
cluster?

-- 
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/1426605929.302531214%40f430.i.mail.ru.
For more options, visit https://groups.google.com/d/optout.