Need help to create array type field in elastic search

Hi All,

I have a scenario like In elastic search i want to create custom
mapping.The data will be insert into index using java API . Now i have a
field with multi values like "1,2,3" .Field name is categories. can you
please tell me how to create a custom mapping for type array so that when i
insert data in to elastic search index the categories type is need to be an
string array which can hold multi values.(string array).

catgories : [
"1",
"2",
"3"
]

    I used river bracket notation to dynamically create array at 

elastic search using bracket notation.but from java API how can we create
custom mapping so that it can hold multi values.

Thanks

phani

--
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/22bd6f5c-2d90-4fa6-9f1d-2009ff7fda99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

There is nothing special you need to add to your mapping to enable multiple
values for a field. Just pass in an array of values instead of a single
value, and all of the values are analyzed.

One thing you might want to add for string fields with multiple values:

"position_offset_gap" : n

When a string field is analyzed, it typically assigns a position to each
token that is one greater than the position of the previous token. By
setting a position offset gap value to n, it skips ahead that many
positions, representing the number of non-matching word positions between
consecutive values.

What this does is that if your field contains multiple values that each has
multiple words, a phrase query won't span across values unless the slop
value is large enough (n or larger, I seem to recall).

Hope this helps.

Brian

--
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/e2d2dd14-d899-4e1e-a909-ce9e305f900a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I have an experience to share with you guys. Once I was in a remote place, my signal in my phone got jammed, i thought the problem would be with my service provider. After coming back home i gave black and blues to my customer care highlighting my issue. They pleaded me saying that the problem is not with them. Then i browsed through the search engine regarding my issue, i got a remedy for my cell phone, there i came to know the problem called signal jamming that is experienced in most cell phones. They have a product called cell phone jammer could be very useful to get rid of these problems. Check out the details here Cell Phone Blockers and hope this information would be beneficial. Hope that u would pass this information to all your friends, so that they too would benefited, Stay safe, Cheers