Need Help Regarding design multivalue column field in elasticsearch from river

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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/c81e61d2-c73d-42f9-82ac-86ced59f7316%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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, phani.nadiminti@goktree.com 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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGw8M0vxkrQGcWhLL_UcRNc71t554UYr5tdYZOvs6rD-w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

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, <phani.n...@goktree.com <javascript:>>
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 elasticsearc...@googlegroups.com <javascript:>.
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9d1abbe3-d63d-435c-8a48-44b6bfb11144%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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, phani.nadiminti@goktree.com 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, phani.n...@goktree.com 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 elasticsearc...@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
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.

Hi Jorg,

Thanks for the reply.The list of DescriptionIds is a string field it
contains data " 10,20,24,56,78,90,87" as a string in database table for one
record.

The following is the mapping information for the above descriptionIds in
elasticsearch.

 {
  "temp_new": {
  "mappings": {
     "tempv1new": {
        "properties": {
           "GenericDescription": {
              "type": "string"
           },
           "GenericId": {
              "type": "string"
           },
           "GroupNo": {
              "type": "string"
           },
           "ListofDescriptionIDs": {
              "type": "string"
           }
        }
     }
  }

}
}

            If listofDescriptionIds is a string please post me what are 

our alternatives. if I create index like this(as said before ==> array
mapping) will it be searchable field.
Thanks,

phani

On Tuesday, October 7, 2014 5:05:58 PM UTC+5:30, Jörg Prante wrote:

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, <phani.n...@goktree.com <javascript:>>
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, phani.n...@goktree.com 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 elasticsearc...@googlegroups.com.
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 elasticsearc...@googlegroups.com <javascript:>.
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d0b5771b-f227-43df-9fa2-9928bd7888bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yes, in the mapping, the JDBC river automatically sets field type "string".
This is because the bracket notation mode does not examine the exploded
values for types like integer but simply assumes "string". "string" is ok
for search.

If you want numeric values with type "integer" you have to define the
mapping for field "ListofDescriptionIDs" manually before the river
auto-creates it. ES will then coerce the values into "integer".

Jörg

On Tue, Oct 7, 2014 at 2:10 PM, phani.nadiminti@goktree.com wrote:

Hi Jorg,

Thanks for the reply.The list of DescriptionIds is a string field it
contains data " 10,20,24,56,78,90,87" as a string in database table for one
record.

The following is the mapping information for the above descriptionIds
in elasticsearch.

 {
  "temp_new": {
  "mappings": {
     "tempv1new": {
        "properties": {
           "GenericDescription": {
              "type": "string"
           },
           "GenericId": {
              "type": "string"
           },
           "GroupNo": {
              "type": "string"
           },
           "ListofDescriptionIDs": {
              "type": "string"
           }
        }
     }
  }

}
}

            If listofDescriptionIds is a string please post me what

are our alternatives. if I create index like this(as said before ==> array
mapping) will it be searchable field.
Thanks,

phani

On Tuesday, October 7, 2014 5:05:58 PM UTC+5:30, Jörg Prante wrote:

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, phani.n...@goktree.com 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, phani.n...@goktree.com 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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/c81e61d2-c73d-42f9-82ac-86ced59f7316%40goo
glegroups.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 elasticsearc...@googlegroups.com.
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/d0b5771b-f227-43df-9fa2-9928bd7888bd%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/d0b5771b-f227-43df-9fa2-9928bd7888bd%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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoGwdUyC3c2ZswNBBc-y%3DjVXuyK2Sft4BDTANoMZyCctng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi Jorg,

I believe that there is difference between normal string mapping and
dynamic array mapping using bracket notation in elastic search . If we do
normal string type for "ListofDescriptionIds" in elastic search where i can
find exact difference in searching data in dynamic array and normal string
field in elastic search.

Dynamic array of type string in elasticsearch.
"ListofDescriptionIDs": [
"10",
"20",
"61",
"71",
"73",
"74",
"77",
"110",
"116"
]
Normal string notation:

"ListofDescriptionIDs": "10,20,61,71,73,74,77,110,116"

Thanks
phani

On Tuesday, October 7, 2014 5:58:02 PM UTC+5:30, Jörg Prante wrote:

Yes, in the mapping, the JDBC river automatically sets field type
"string". This is because the bracket notation mode does not examine the
exploded values for types like integer but simply assumes "string".
"string" is ok for search.

If you want numeric values with type "integer" you have to define the
mapping for field "ListofDescriptionIDs" manually before the river
auto-creates it. ES will then coerce the values into "integer".

Jörg

On Tue, Oct 7, 2014 at 2:10 PM, <phani.n...@goktree.com <javascript:>>
wrote:

Hi Jorg,

Thanks for the reply.The list of DescriptionIds is a string field it
contains data " 10,20,24,56,78,90,87" as a string in database table for one
record.

The following is the mapping information for the above descriptionIds
in elasticsearch.

 {
  "temp_new": {
  "mappings": {
     "tempv1new": {
        "properties": {
           "GenericDescription": {
              "type": "string"
           },
           "GenericId": {
              "type": "string"
           },
           "GroupNo": {
              "type": "string"
           },
           "ListofDescriptionIDs": {
              "type": "string"
           }
        }
     }
  }

}
}

            If listofDescriptionIds is a string please post me what 

are our alternatives. if I create index like this(as said before ==> array
mapping) will it be searchable field.
Thanks,

phani

On Tuesday, October 7, 2014 5:05:58 PM UTC+5:30, Jörg Prante wrote:

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, phani.n...@goktree.com 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, phani.n...@goktree.com 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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/elasticsearch/c81e61d2-c73d-42f9-82ac-86ced59f7316%40goo
glegroups.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 elasticsearc...@googlegroups.com.
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/d0b5771b-f227-43df-9fa2-9928bd7888bd%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/d0b5771b-f227-43df-9fa2-9928bd7888bd%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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/4761615e-5221-47f9-b5b6-a9aa686b038a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.