Re: Storing auto generated _id under different name

2014-06-20 Thread Johny Lam
I'm using elasticsearch as the database for a service. It would make things 
easier. For example, I could just return the _source field when other apps 
query my service. Related to that is that on the javascript client side, I 
am inserting the _id field into the _source JSON object as "id" and using 
that as the model for two way data-binding. If the id field was in the 
source already, I wouldn't have to keep track of this.

On Tuesday, June 17, 2014 4:26:07 PM UTC-7, Adrien Grand wrote:
>
> No, it isn't possible.
>
> Why would you like to have the id of the document included in _source?
>
>
> On Tue, Jun 17, 2014 at 8:16 PM, Johny Lam  > wrote:
>
>> Is it possible to have the _id be auto-generated and store it so that 
>> it's in the _source field under a different name, like say "id" instead of 
>> "_id"?
>>  
>> -- 
>> 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/1eb03930-64c8-44ac-9f69-7ad2ff6b563e%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/elasticsearch/1eb03930-64c8-44ac-9f69-7ad2ff6b563e%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Adrien Grand
>  

-- 
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/a1b9d878-47cc-4e06-ae02-0b32375cf3bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Storing auto generated _id under different name

2014-06-17 Thread Johny Lam
Is it possible to have the _id be auto-generated and store it so that it's 
in the _source field under a different name, like say "id" instead of "_id"?

-- 
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/1eb03930-64c8-44ac-9f69-7ad2ff6b563e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Simple Node program using official library takes long time to terminate

2014-01-27 Thread Johny Lam
I have a simple program:

  elasticsearch = require('elasticsearch');

  client = new elasticsearch.Client({
hosts: 'localhost:9200',
log: 'trace'
  });

  client.ping({
  requestTimeout: 1000,
  // undocumented params are appended to the query string
  hello: "elasticsearch!"
}, function (error) {
  if (error) {
console.error('elasticsearch cluster is down!');
  } else {
console.log('All is well');
  }
});

It's just code taken from the elastic search website. But it takes several 
minutes to terminate on its own. 

Is there something else I need to include to terminate the program? I've 
tried adding client.close() at the end but that doesn't do the trick.

-- 
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/1fa90d02-bc8b-4f22-98b4-7d0e92dca8b6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.