Re: Search Plugin to intercept search response

2014-10-20 Thread Tomislav Poljak
Hi Jörg,
I understand and what you described is exactly what I did: deployed
plugin to both elasticsearch node/server (running single node cluster
atm) and to the client code classpath which uses TransportClient ->
both log INFO 'simple action plugin loaded' on start, yet I can't
execute simple action successfully from client using TransportClient
(without NPE).

So, I'm wondering if custom actions can be executed thru the
TransportClient at all or are custom TransportActions actually
'internal node actions' which can only be executed on node (which
expands query and reduces results from other nodes/shards on the
client node - inside client jvm).

I wonder because seems to me like its not even plugin loading related
issue, but actually a problem of 'internal' type of call execution ->
for example, I get the same NPE when executing typical search request
using SearchAction.INSTANCE 'internal approach':

SearchRequestBuilder builder = new SearchRequestBuilder(client);
SearchResponse response = client.execute(SearchAction.INSTANCE,
builder.request()).actionGet();

over TransportClient, while again this call works perfectly fine over
node client.

Do you have some setup where you consume custom actions using
TransportClient (not rest and not node type of client)?

Thanks,
Tomislav

2014-10-20 17:21 GMT+02:00 joergpra...@gmail.com :
> If you use TransportClient, implementing custom actions like SimpleAction
> gets a bit tricky: you must install the plugin both on the cluster on all
> nodes *and* on the TransportClient classpath.
>
> The reason is, the TransportClient initiates a proxy action to ask the
> cluster to execute the action for him. A NodeClient runs in a single JVM
> with a cluster node and does not need such a proxy action.
>
> Jörg
>
>
> On Mon, Oct 20, 2014 at 3:09 PM, Tomislav Poljak  wrote:
>>
>> Hi Jörg,
>> thanks for response!
>>
>> I use default 'elasticsearch' cluster name and 'ordinary' match_all (as
>> below)
>>
>> Client client = new TransportClient().addTransportAddress(new
>> InetSocketTransportAddress("localhost", 9300));
>> SearchResponse response = client.prepareSearch().execute().actionGet();
>>
>>  works fine (connects,executes and returns results). However, I can't
>> execute SimpleAction successfully over TransportClient (even with
>> cluster name set):
>>
>>
>> Client client = new
>> TransportClient(ImmutableSettings.settingsBuilder().put("cluster.name",
>> "elasticsearch")).addTransportAddress(new
>> InetSocketTransportAddress("localhost", 9300));
>>
>> SimpleRequestBuilder builder = new SimpleRequestBuilder(client);
>> SearchResponse response = client.execute(SimpleAction.INSTANCE,
>> builder.request()).actionGet();
>>
>> Both, elasticsearch server and client using TransportClient report
>> 'simple action' plugin loaded (in console INFO), but on execute I get
>> NPE  on the client's side with trace:
>>
>> org.elasticsearch.common.util.concurrent.UncategorizedExecutionException:
>> Failed execution
>> at
>> org.elasticsearch.action.support.AdapterActionFuture.rethrowExecutionException(AdapterActionFuture.java:90)
>> at
>> org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:50)
>> at
>> org.xbib.elasticsearch.action.simple.SimpleActionTest.testSimpleAction(SimpleActionTest.java:26)
>> ..
>>
>> Caused by: java.lang.NullPointerException
>> at
>> org.elasticsearch.action.search.SearchRequest.writeTo(SearchRequest.java:541)
>> at
>> org.xbib.elasticsearch.action.simple.SimpleRequest.writeTo(SimpleRequest.java:38)
>>
>> Am I missing or misunderstanding something?
>>
>> Tomislav
>>
>>
>>
>>
>>
>>
>> 2014-10-18 15:28 GMT+02:00 joergpra...@gmail.com :
>> > You must set up a cluster name in the settings for the TransportClient,
>> > otherwise connection requests will be rejected by the cluster.
>> >
>> > Also, a dynmaic "new TransportClient()" for client instantiation is
>> > discouraged. By doing this, you open up a new threadpool each time.
>> > Recommend is to use a singleton instantiation for the whole JVM, and a
>> > single close() call on the TransportClient instance when JVM exits.
>> >
>> > Jörg
>> >
>> > On Sat, Oct 18, 2014 at 12:55 PM, Tomislav Poljak 
>> > wrote:
>> >>
>> >> Hi,
>> >> if I understand correctly, seems it should be possible to use
>> >> SimpleRequest over TransportClie

Re: Search Plugin to intercept search response

2014-10-20 Thread Tomislav Poljak
Hi Jörg,
thanks for response!

I use default 'elasticsearch' cluster name and 'ordinary' match_all (as below)

Client client = new TransportClient().addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));
SearchResponse response = client.prepareSearch().execute().actionGet();

 works fine (connects,executes and returns results). However, I can't
execute SimpleAction successfully over TransportClient (even with
cluster name set):


Client client = new
TransportClient(ImmutableSettings.settingsBuilder().put("cluster.name",
"elasticsearch")).addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));

SimpleRequestBuilder builder = new SimpleRequestBuilder(client);
SearchResponse response = client.execute(SimpleAction.INSTANCE,
builder.request()).actionGet();

Both, elasticsearch server and client using TransportClient report
'simple action' plugin loaded (in console INFO), but on execute I get
NPE  on the client's side with trace:

org.elasticsearch.common.util.concurrent.UncategorizedExecutionException:
Failed execution
at 
org.elasticsearch.action.support.AdapterActionFuture.rethrowExecutionException(AdapterActionFuture.java:90)
at 
org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:50)
at 
org.xbib.elasticsearch.action.simple.SimpleActionTest.testSimpleAction(SimpleActionTest.java:26)
..

Caused by: java.lang.NullPointerException
at org.elasticsearch.action.search.SearchRequest.writeTo(SearchRequest.java:541)
at 
org.xbib.elasticsearch.action.simple.SimpleRequest.writeTo(SimpleRequest.java:38)

Am I missing or misunderstanding something?

Tomislav






2014-10-18 15:28 GMT+02:00 joergpra...@gmail.com :
> You must set up a cluster name in the settings for the TransportClient,
> otherwise connection requests will be rejected by the cluster.
>
> Also, a dynmaic "new TransportClient()" for client instantiation is
> discouraged. By doing this, you open up a new threadpool each time.
> Recommend is to use a singleton instantiation for the whole JVM, and a
> single close() call on the TransportClient instance when JVM exits.
>
> Jörg
>
> On Sat, Oct 18, 2014 at 12:55 PM, Tomislav Poljak  wrote:
>>
>> Hi,
>> if I understand correctly, seems it should be possible to use
>> SimpleRequest over TransportClient, is this correct?
>>
>> I couldn't get it to work using:
>>
>> Client client = new TransportClient().addTransportAddress(new
>> InetSocketTransportAddress("localhost", 9300));
>>
>> but when switched to node client, seems to work
>>
>> Node node = nodeBuilder().client(true).node();
>> Client client = node.client();
>>
>> I'm also interested in reducing results/aggs using some custom code,
>> but to have it executed on elasticsearch cluster not to transfer
>> results to client node and reduce it there, but I'm not sure if this
>> is possible with custom transport actions when using TransportClient.
>>
>> Any info on this would be appreciated,
>> Tomislav
>>
>>
>> 2014-09-11 20:44 GMT+02:00 joergpra...@gmail.com :
>> > Yes. I have checked in some code for a simple action plugin.
>> >
>> > https://github.com/jprante/elasticsearch-simple-action-plugin
>> >
>> > The plugin implements a simple "match_all" search action, by reusing
>> > much of
>> > the code of the search action.
>> >
>> > Best,
>> >
>> > Jörg
>> >
>> >
>> >
>> > On Thu, Sep 11, 2014 at 7:55 PM, Sandeep Ramesh Khanzode
>> >  wrote:
>> >>
>> >> Thanks for bearing with me till now :) Please provide one final input
>> >> on
>> >> this issue.
>> >>
>> >> Is there any example for a custom search action? If not, can you please
>> >> provide some details on how I can implement one?
>> >>
>> >> Thanks,
>> >> Sandeep
>> >>
>> >>
>> >> On Thu, Sep 11, 2014 at 4:53 PM, joergpra...@gmail.com
>> >>  wrote:
>> >>>
>> >>> You can not intercept the SearchResponse on the ES server itself.
>> >>> Instead, you must implement your custom search action.
>> >>>
>> >>> Jörg
>> >>>
>> >>> On Thu, Sep 11, 2014 at 10:00 AM, Sandeep Ramesh Khanzode
>> >>>  wrote:
>> >>>>
>> >>>> When you say, 'receive the SearchResponse', is that in the ES Server
>> >>>> node or the TransportClient node that spawned the request? I would
&g

Re: Search Plugin to intercept search response

2014-10-18 Thread Tomislav Poljak
Hi,
if I understand correctly, seems it should be possible to use
SimpleRequest over TransportClient, is this correct?

I couldn't get it to work using:

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

but when switched to node client, seems to work

Node node = nodeBuilder().client(true).node();
Client client = node.client();

I'm also interested in reducing results/aggs using some custom code,
but to have it executed on elasticsearch cluster not to transfer
results to client node and reduce it there, but I'm not sure if this
is possible with custom transport actions when using TransportClient.

Any info on this would be appreciated,
Tomislav


2014-09-11 20:44 GMT+02:00 joergpra...@gmail.com :
> Yes. I have checked in some code for a simple action plugin.
>
> https://github.com/jprante/elasticsearch-simple-action-plugin
>
> The plugin implements a simple "match_all" search action, by reusing much of
> the code of the search action.
>
> Best,
>
> Jörg
>
>
>
> On Thu, Sep 11, 2014 at 7:55 PM, Sandeep Ramesh Khanzode
>  wrote:
>>
>> Thanks for bearing with me till now :) Please provide one final input on
>> this issue.
>>
>> Is there any example for a custom search action? If not, can you please
>> provide some details on how I can implement one?
>>
>> Thanks,
>> Sandeep
>>
>>
>> On Thu, Sep 11, 2014 at 4:53 PM, joergpra...@gmail.com
>>  wrote:
>>>
>>> You can not intercept the SearchResponse on the ES server itself.
>>> Instead, you must implement your custom search action.
>>>
>>> Jörg
>>>
>>> On Thu, Sep 11, 2014 at 10:00 AM, Sandeep Ramesh Khanzode
>>>  wrote:

 When you say, 'receive the SearchResponse', is that in the ES Server
 node or the TransportClient node that spawned the request? I would want to
 intercept the SearchResponse when created at the ES Server itself, since I
 want to send the subset of Response to another process on the same node, 
 and
 it would not be very efficient to have the response sent back to the client
 node only to be sent back again.

 Thanks,
 Sandeep

 On Thu, Sep 11, 2014 at 12:43 PM, joergpra...@gmail.com
  wrote:
>
> You can receive the SearchResponse, process the response, and return
> the response with whatever format you want.
>
> Jörg
>
> On Wed, Sep 10, 2014 at 11:59 AM, Sandeep Ramesh Khanzode
>  wrote:
>>
>> Hi Jorg,
>>
>> Thanks for the links. I was checking the sources. There are relevant
>> to my functional use case. But I will be using the TransportClient Java 
>> API,
>> not the REST client.
>>
>> Can you please tell me how I can find/modify these classes/sources to
>> get the appropriate classes for inctercepting the Search Response when
>> invoked from a TransportClient?
>>
>>
>> Thanks,
>> Sandeep
>>
>> On Wed, Aug 27, 2014 at 6:38 PM, joergpra...@gmail.com
>>  wrote:
>>>
>>> Have a look at array-format or csv plugin, they are processing the
>>> SearchResponse to output it in another format:
>>>
>>> https://github.com/jprante/elasticsearch-arrayformat
>>>
>>> https://github.com/jprante/elasticsearch-csv
>>>
>>> Jörg
>>>
>>>
>>> On Wed, Aug 27, 2014 at 3:05 PM, 'Sandeep Ramesh Khanzode' via
>>> elasticsearch  wrote:

 Hi,

 Is there any action/module that I can extend/register/add so that I
 can intercept the SearchResponse on the server node before the 
 response is
 sent back to the TransportClient on the calling box?

 Thanks,
 Sandeep

 --
 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/559a5c68-4567-425f-9842-7f2fe6755095%40googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>> --
>>> You received this message because you are subscribed to a topic in
>>> the Google Groups "elasticsearch" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/elasticsearch/o6RZL4KwJVs/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> elasticsearch+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGJ_%3D5RnyFqMP_AX4744z6tdAp8cfLBi_OqzLM23_rqzw%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 "elas

Re: Kibana-MySQL connection

2014-06-06 Thread Tomislav Poljak
Hi Srinu,
Kibana is javascript search/visualisation front-end for elasticsearch
which is a distributed search engine which doesn't feature mysql
connection/integration out of the box. But, there is a plugin
https://github.com/jprante/elasticsearch-river-jdbc which you can use
to import data from mysql to elasticsearch and then use Kibana to
visualise it.

So steps would be:

1) Deploy elasticsearch
2) Install jdbc plugin with mysql driver in elasticsearch
3) Create and submit jdbc river configuration (with mysql connection
data and import query) which will import the data
4) Deploy kibana and visualise data

Hope this helps,
Tomislav



2014-06-06 10:02 GMT+02:00 srinu konda :
> Hi All,
>
> I need help on kibana, I need to Connect MySQL Database from Kibana. So
> please let me know I can achieve it, and me pseudo code if anyone can have
> it.
>
>
>
> Thanks & Regards,
> Srinivas.
>
> --
> 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/13cb6155-12e2-4ec5-952c-7f1996527903%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/CALuCJxjL%2B0zCCHct0-BVn2Z%2BiaCHFLEGj4YD1NioG7Td%2Bz5FrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tokenizing my field even with index not analyzed

2014-05-27 Thread Tomislav Poljak
Hi Josep,
problem of matching too much entries is not related to the analysis of
"Batch_name" field ('tokenization' of "Batch_name"), but actually its
in the way how you constructed URI search params. In your URL
.../_search?q=PID:25747&Batch_Name:ZEJININSP05...  '&' is actually
separating http params (like &pretty=true etc) and not used as AND in
the Lucene query (what I think you expect). So, you actually get all
matches for q=PID:25747 regardless of 'Batch_Name' value.

Try this instead
http://myserver.com:9200/batches-*/_search?q=PID:25747%20AND%20Batch_Name:ZEJININSP05&pretty=true

(not sure if its "Batch_Name" which is in the query or "Batch_name" in mapping)

If you check 
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-uri-request.html
for constructing URI search queries you'll see you need to use Lucene
syntax 
(http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax)
when building a query as URI param

Hope this helps,
Tomislav

2014-05-27 9:52 GMT+02:00 Josep Floriach Ventosinos
:
> Hi everyone,
>
> I have an index where two of the data fields is long type, and the other
> string type. They are PID and Batch_Name. I'm trying to do a query that
> returns me the entry with PID = 25747 and batch name = ZEJINNSP05.That's how
> I'm doing the query:
>
> http://myserver.com:9200/batches-*/_search?q=PID:25747&Batch_Name:ZEJININSP05&pretty=true
>
> The result of this query are two entries. One of both is correct. It have
> this PID and this batch name. the other one has the correct PID but the
> following batch name: ZEJINLECT32
>
> I guess that happens because ES is tokenizing my field. But I don't
> understand why, since I'm telling in my template that this field should not
> be tokenized.
>
> This is how looks my template:
>
> #!/bin/sh
> curl -XPUT 'localhost:9200/_template/batches_online' -d '{
> "template": "batches-*",
> "settings": {
> "number_of_shards": 1,
> "number_of_replicas": 0,
> "index.refresh_interval": "5s"
> },
>
> "mappings": {
> "logs": {
> "properties": {
> "Batch_name": {
> "type": "string",
> "index":"not_analyzed"
> }
> ... (more fields)
>
> What I'm doing wrong?
>
> --
> 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/077f7d0a-67b6-42fc-a056-f64d37ede808%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/CALuCJxjVXCrMy8k197fA7y%3D51fSt3Vnty5O8sP%3Dh9tckWP__yA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get term frequencies ?

2014-05-26 Thread Tomislav Poljak
Hi Thami,
the 'scope' is not quite clear, but if you need per document
term-frequencies maybe check
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-termvectors.html
-> it requires you to store term vectors (see
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-termvectors.html#_example
for mapping, indexing and query usage), but if that's not an overhead
for you, its the simplest way to go.

Hope this helps,
Tomislav

2014-05-26 17:47 GMT+02:00 Thami Inaflas :
> Hello everyone,
>
> I'm wondering if there is a way to get the term-frequencies that
> elasticsearch indexed with a request ?
>
> Note : I m using the current version of Elasticsearch (1.1.1)
>
> Thanks in advance for your help.
> If my question lacks some details or is unclear please let me know.
>
> --
> 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/b1ad3534-4f1b-420b-8797-026dd7b65972%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/CALuCJxg9PMoTCuBepHvBgy9j70QjdhuKPkyyb6KZeFWNvYEHiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mapping for Java HashMap

2014-03-17 Thread Tomislav Poljak
Hi,
I think first you need to define is what is the requirement (or
expectation) of hashMap (sub)object in index -> do you need to search
on key/value pairs?

Like for example, query = 'hashMap.N_10290607:XY' ?


If not, if you only need to store json serialization of haspmap as
part of bigger object inside index (_source) to retrieve it later, you
can define not to expand mapping dynamically  ("dynamic" : false) in
the 'hashMap' (sub)object - part of mapping for, like bellow:

...
"properties" : {
  "hashMap" : {
"dynamic" : false,
"properties" : {
..


This is done by a custom mapping. If you do not define a custom
mapping elasticsearch will, by default, create and expand mapping for
hashMap for all keys which will sooner or later create issues in
index. For more details check
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-object-type.html#_dynamic

If you don't know how to create mapping in the first place you can get
existing mapping
(http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-mapping.html),
remove fields added/recognised by elasticsearch automatically, define
"dynamic" : false for the 'hashMap' object and use new mapping when
reindexing data.


Hope this helps,

Tomislav

2014-03-12 19:37 GMT+01:00  :
> Hey Peter,
>
> Did you find a resolution for Hashmap mappings? Looking for the same thing.
>
> Thanks,
> Sangita.
>
>
> On Tuesday, January 14, 2014 9:03:35 AM UTC-5, Peter Webber wrote:
>>
>>
>> Hi Alex,
>>
>> thanks for your reply first of all. The problem is that I will have
>> millions of keys, and that ES creates a mapping for each. That will bloat
>> the mappings data structure and probably lead to some memory and/or
>> performance issues somewhere (I don't know enough about ES internals, to
>> know precisely where, but it cannot be good to have a few million entries in
>> the mapping where one would do.)
>>
>> Hope that helps!
>> Peter
>>
>>
>>
>> Am Dienstag, 14. Januar 2014 13:01:22 UTC+1 schrieb Alexander Reelsen:
>>>
>>> Hey Peter,
>>>
>>> can you tell me, where your problem with the above approach actually is?
>>> You feed a number of key/value pairs into elasticsearch, each key and each
>>> value is evaluated by its type and then put into the mapping, as each key
>>> becomes an own field in elasticsearch, which can be searched for. Wondering
>>> why this is a problem for you? Or why do you want to avoid that?
>>>
>>> Also, where and how do you want to change the mapping to?
>>>
>>> I am a bit confused what and why you are expecting to be different than
>>> it actually is. Maybe you should not think in java data structures but
>>> rather in JSON, which is being indexed and needs to create a mapping in
>>> order to be able to search for it. Happy to help, if I understand what you
>>> are trying to do. Please elaborate.
>>>
>>>
>>> --Alex
>>>
>>>
>>> On Mon, Jan 13, 2014 at 11:15 AM, Oliver B. Fischer
>>>  wrote:

 Hi Peter,

 ES allows you to defined dynamic mappings there you can determine the
 mapping of a property based on the evaluation of some conditions.


 http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-dynamic-mapping.html

 Oliver

 Am 12.01.14 17:16, schrieb Peter Webber:

>
> I had a look at the mapping ES created automatically for one of my
> indices, and found something that's not quite right:
>
> 
> |||  "annotations"| |: { |
> |||"properties"| |: { |
> |||"ids"| |: { |
> |||"properties"| |: { |
> |||"hashMap"| |: { |
> |||"properties"| |: { |
> |||"N_10290607"| |: { |
> |||"type"| |: ||"double"|
> |||}, |
> |||"A_1038408"| |: { |
> |||"type"| |: ||"double"|
> |||}, |
> |||"A_11585994"| |: { |
> |||"type"| |: ||"double"|
> |||}, |
> |||"B_1245677"| |: { |
> |||"type"| |: ||"double"|
> |||}, |
> |||"B_1269810"| |: { |
> |||"type"| |: ||"double"|
> |||}, |
> |||"C_15680034"| |: { |
> |||"type"| |: ||"double"|
> |||}, |
> |||"N_1654171"| |: { |
> |||"type"| |: ||"double"|
> |||},
> ...
>
> I use Gson to convert Java classes to Json and then directly put them
> into ES. One of the classes I use has a HashMap as a
> central piece, where it stores its key-value pairs. It's really just
> that: the keys are stings, the values doubles. ES however creates a
> mapping for every key of the hashmap as you can see above.
>
> Does someone here know what mapping I need to define to avoid that?
>
> Also: Can I change this mapping on the already existing index, or do I
> have to create a new index, then create a mapping, then copy over the
> data from the old index?
>
> Many Thanks!
> |
>
> --
> You received this message because you are subscribed to the Google
> Groups "elasticsearch" group

Re: [ANN] JDBC river 1.0.0.1 released

2014-02-17 Thread Tomislav Poljak
Hi Jörg,
seems I've missed docs update. Works correctly without the 'index'
section, thanks!

Tomislav

2014-02-16 19:41 GMT+01:00 joergpra...@gmail.com :
> There is no index section any more.
>
> Try
>
> curl -XPUT "http://localhost:9200/_river/table_river/_meta"; -d'{
> "type" : "jdbc",
> "jdbc" : {
> "url" : "jdbc:mysql://host/db",
> "user" : "x",
> "password" : "y",
> "sql" : "select * from table",
> "index" : "index_name",
> "type" : "type_name"
> }
> }'
>
> Jörg
>
>
>
> On Sun, Feb 16, 2014 at 7:28 PM, Tomislav Poljak  wrote:
>>
>> Hi,
>> I've tried new/latest jdbc river plugin for elasticsearch 1.0.0 (with
>> the latest es v1.0.0) and simple river definition:
>>
>> curl -XPUT "http://localhost:9200/_river/table_river/_meta"; -d'{
>> "type" : "jdbc",
>> "jdbc" : {
>> "driver" : "com.mysql.jdbc.Driver",
>> "url" : "jdbc:mysql://host/db",
>> "user" : "x",
>> "password" : "y",
>> "sql" : "select * from table"
>> },
>> "index" : {
>> "index" : "index_name",
>> "type" : "type_name"
>> }
>> }'
>>
>> ended up importing data into index named 'jdbc' (instead 'index_name')
>> and type set in indexed docs was also 'jdbc' (instead of type_name)
>>
>> Did something changed (completely) in how jdbc river is defined (I've
>> checked the docs didn't find anything) or is this a bug?
>>
>> Tomislav
>>
>> 2014-02-13 1:37 GMT+01:00 joergpra...@gmail.com :
>> > Hi,
>> >
>> > JDBC river plugin 1.0.0.1 for Elasticsearch 1.0.0 has been released.
>> >
>> > https://github.com/jprante/elasticsearch-river-jdbc
>> >
>> > Changes:
>> >
>> > - compiled against Elasticsearch 1.0.0
>> > - refactored some classes for preparing the move to a more robust data
>> > gathering plugin
>> > - improved JSON building when reading JSON out of a result column
>> > - possible to access river state (timestamp) as SQL parameter
>> > - reverted Collection to List in KeyValueStreamListener
>> > - some cleanups
>> >
>> > Best,
>> >
>> > Jörg
>> >
>> > --
>> > 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/CAKdsXoFrCUx6xB%3D40UTu6BgL8fKaQDrQ57ANexr569tfKVgGSg%40mail.gmail.com.
>> > For more options, visit https://groups.google.com/groups/opt_out.
>>
>> --
>> 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/CALuCJxgmZ%2BqWgNenAEuuo22R%2BhrXCHfXTzWyTL72Z4iwqZ962A%40mail.gmail.com.
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> 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/CAKdsXoHw%2Be5GLBR2sho0VJZva7w_sTiY0Kvfe-w0UpqQ%2BMu6Qg%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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/CALuCJxhe8M-Uym7m1%2BY_a4i7dhD2tBJ%3D2cCcwsirTwcFUMv6SQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [ANN] JDBC river 1.0.0.1 released

2014-02-16 Thread Tomislav Poljak
Hi,
I've tried new/latest jdbc river plugin for elasticsearch 1.0.0 (with
the latest es v1.0.0) and simple river definition:

curl -XPUT "http://localhost:9200/_river/table_river/_meta"; -d'{
"type" : "jdbc",
"jdbc" : {
"driver" : "com.mysql.jdbc.Driver",
"url" : "jdbc:mysql://host/db",
"user" : "x",
"password" : "y",
"sql" : "select * from table"
},
"index" : {
"index" : "index_name",
"type" : "type_name"
}
}'

ended up importing data into index named 'jdbc' (instead 'index_name')
and type set in indexed docs was also 'jdbc' (instead of type_name)

Did something changed (completely) in how jdbc river is defined (I've
checked the docs didn't find anything) or is this a bug?

Tomislav

2014-02-13 1:37 GMT+01:00 joergpra...@gmail.com :
> Hi,
>
> JDBC river plugin 1.0.0.1 for Elasticsearch 1.0.0 has been released.
>
> https://github.com/jprante/elasticsearch-river-jdbc
>
> Changes:
>
> - compiled against Elasticsearch 1.0.0
> - refactored some classes for preparing the move to a more robust data
> gathering plugin
> - improved JSON building when reading JSON out of a result column
> - possible to access river state (timestamp) as SQL parameter
> - reverted Collection to List in KeyValueStreamListener
> - some cleanups
>
> Best,
>
> Jörg
>
> --
> 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/CAKdsXoFrCUx6xB%3D40UTu6BgL8fKaQDrQ57ANexr569tfKVgGSg%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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/CALuCJxgmZ%2BqWgNenAEuuo22R%2BhrXCHfXTzWyTL72Z4iwqZ962A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.