Is the database field for "ListofDescriptionIDs" a numeric field? This
would be interesting because the river should map JDBC integers to JSON
integers automatically.

You have the following options to enforce integer type:

- create index before running the river, together with desired mappings
(preferred)

- declare an index type mapping in the JDBC river definition with
`type_mapping` parameter

Jörg


On Tue, Oct 7, 2014 at 1:20 PM, <[email protected]> wrote:

> Hi Jorg,
>
>     Thanks for quick reply. I tried the bracket notation from the river
> query itself .I tried the following query and got the result.
>
>     " SELECT GenericDescription,GenericId,GroupNo,ListofDescriptionIDs AS
> `ListofDescriptionIDs[]` FROM  temp"
>
>     it worked for me for list of descriptionIDs it is created as array.
>
>      {
>             "_index": "test",
>             "_type": "testv1",
>             "_id": "uYTwn2iBSKGBPt0Auz834w",
>             "_score": 1,
>             "_source": {
>                "GenericDescription": "test",
>                "GenericId": "1",
>                "GroupNo": "35",
>                "ListofDescriptionIDs": [
>                   "10",
>                   "20",
>                   "61",
>                   "71",
>                   "73",
>                   "74",
>                   "77",
>                   "110",
>                   "116"
>                ]
>             }
>          },
>
>        the mapping directly created by river itself in es server. the type
> for ListofDescriptionIDs created as "string".but it is taking data as
> arrays from query. is this "string " is correct for the
> ListofDescriptionIDs field. eventhough we declared as string how ES
> consider as array for this field?
>
>
> Thanks,
> phani.
>
>
>
> On Monday, October 6, 2014 7:25:26 PM UTC+5:30, Jörg Prante wrote:
>>
>> The mail is hard to read, the layout is scrambled.
>>
>> For simple integer array, you do not need type "nested".
>>
>> What is the SQL statement you tried for JDBC river? You have seen the
>> examples for bracket notation?
>>
>> Jörg
>>
>>
>> On Mon, Oct 6, 2014 at 2:04 PM, <[email protected]> wrote:
>>
>>> Hi All,
>>>
>>>   I have a scenario like, I need to build an index with four fields
>>> (Generic Description,GenericId ,GroupNo, List of Catalogsids ).
>>>
>>>   Here is sample example of mysql table.
>>>
>>>       Generic Description  GenericId        GroupNo
>>> List of Catalogsids   FrameKit
>>> 1 35 10,20,24,56,78,90,87   Pulley 3480 23 36   Bypass Pulley
>>>
>>> 4133 7 55
>>>
>>>
>>>
>>> The fourth column in above table field contains multiple values for one
>>> row. Now i want to create index using above mysql table via river
>>> concept so that fourth column in the table sholud be represented as
>>> array in elastic search i tried this concept but i am not getting a good
>>> way to solve this.please help me in this.
>>>
>>> Mapping i used:
>>>
>>>     PUT /temp
>>> {
>>>  "mappings": {
>>>   "tempv1" : {
>>>      "properties" : {
>>>         "GenericDescription" : {"type" : "string"},
>>>         "GenericId" : {"type" : "string"},
>>>         "GroupNo" : {"type" : "string"},
>>>         "descriptionids" : {
>>>                 "type" : "nested",
>>>                     "properties" : {
>>>                         "ListofDescriptionIDs" : {"type" : "integer"}
>>>                         }
>>>                     }
>>>                 }
>>>             }
>>>         }
>>>     }
>>>
>>> Thanks in advance.
>>> phani 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 [email protected].
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/elasticsearch/c81e61d2-c73d-42f9-82ac-86ced59f7316%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/elasticsearch/c81e61d2-c73d-42f9-82ac-86ced59f7316%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/9d1abbe3-d63d-435c-8a48-44b6bfb11144%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/9d1abbe3-d63d-435c-8a48-44b6bfb11144%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/CAKdsXoHoU%2B2Pr4y_z2n%2Bi2AzrD3KeLs%2BY9LChMrCR%2BbJEX15AA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to