Yes. I wanted to join documents via a script, to avoid multiple round trips 
to the client. Could be used to autoload parent docs from child docs for 
example. I don't want to start a new node and client on each script call, 
for obvious reasons. I suppose a native script plugin could do the trick 
but I was wondering if there was any other way to invoke a shared node 
client from a script which could be used accross multiple requests. 

On Tuesday, April 1, 2014 9:46:17 PM UTC-7, David Pilato wrote:
>
> O_o starting a Node from a script? First time I see that... Looks like a 
> hack to me! :-)
>
> That said what is the use case here? Are you trying to perform some JOIN 
> using scripts?
>
>
>
> --
> David ;-)
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
>
>
> Le 2 avr. 2014 à 05:46, mat taylor <[email protected] <javascript:>> a 
> écrit :
>
> Figured this out, however the code below seems to restart a new node on 
> each request, and  is not cleaning up after itself.
> Is there a better way to do this - for example by exposing a shared node 
> object to the mvel script plugin ?
>
> PUT /test/user/1 
> { "name":"jane"
> , "partner":2
> }
>
> PUT /test/user/2
> { "name":"john"
> , "partner":1
> }
>
> GET /test/user/_search
> { "_source":true
> , "script_fields": 
>     { "partner": 
>       { 
> "script":"org.elasticsearch.node.NodeBuilder.nodeBuilder().node().client().prepareGet('test',
>  
> 'user',_source.partner).execute().actionGet().getSource()"
>     }
>   }
> }
>
>
>
>
>
> On Tuesday, April 1, 2014 4:44:40 PM UTC-7, mat taylor wrote:
>>
>> Is it possible to query the database from a script field by instantiating 
>> a java client and issuing a get request? 
>> Are there any examples of this? 
>>
>> Thanks
>> Mat
>>
>  -- 
> 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 [email protected] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/elasticsearch/a0f57ffc-cecf-4bc8-8082-9f5737faea87%40googlegroups.com<https://groups.google.com/d/msgid/elasticsearch/a0f57ffc-cecf-4bc8-8082-9f5737faea87%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/37072cd6-2c0a-4476-936a-23848c92c868%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to