elasticsearch


elasticsearch mapping exception when using dynamic templates


hi i am using elasticsearch to index some documents. but the documents will have some fileds like goal1Completion, goal2Completion....goal100Completion. so i was trying to do mapping with dynamic Templates. so i came up with following but it throws an error:
{
"mappings": {
"date": {
"properties": {
"sessions": {
"type": "long"
},
"viewId": {
"type": "string",
"index": "not_analyzed"
},
"webPropertyId": {
"type": "string",
"index": "not_analyzed"
},
"dynamic_templates": [
{
"goalCompletions": {
"match_pattern": "regex",
"match": "goal\\d+\\w+",
"mapping": {
"type": "long"
}
}
}
]
}
}
}
}
error:"reason": "Expected map for property [fields] on field [dynamic_templates] but got a class java.lang.String"
what could be thee problem here?
You need to pull dynamic_template from properties map.
{
"mappings": {
"date": {
"properties": {
"sessions": {
"type": "long"
},
"viewId": {
"type": "string",
"index": "not_analyzed"
},
"webPropertyId": {
"type": "string",
"index": "not_analyzed"
}
},
"dynamic_templates": [ <--- Pull this out of properties
{
"goalCompletions": {
"match_pattern": "regex",
"match": "goal\\d+\\w+",
"mapping": {
"type": "long"
}
}
}
]
}
}
}

Related Links

How do I enable remote access/request in Elasticsearch 2.0?
elasticsearch faking index per user - how are routing values inferred when updating?
elasticsearch: Proper config in 3 node cluster for each node to have full copy of index?
Multiple Nested Aggregations in Elasticsearch
Reconnection in Elasticsearch Cluster
Elasticsearch - Has_Parent or Has_Child query returning empty results
Elasticsearch search body from URL search
Fields not getting sorted in alphabetical order in elasticsearch
Sorting strings in elastic search
Missing data when using unique count and creating an aggregation in Kibana
elasticsearch filter array data with aggs
Sorting based on different properties with elasticsearch
Filter through goods and showing available options using Elasticsearch
Elasticsearch get field mapping for all fields without using asterisk (*)
Calculate conversion rate on events data Elasticsearch aggregations
Convert existing field mapping to geoip

Categories

HOME
cocoapods
amazon-web-services
android-studio
seedstack
barcode-scanner
redmine
visual-studio-2010
apk
docker-cloud
jersey-2.0
tcp
gprs
polymer-2.x
msmq
solution
locationmanager
jquery-select2-4
powermock
bundler
django-rq
rest-assured
uima
boomi
codefluent
renderscript
cpu-usage
multiple-tables
android-custom-view
spyder
quartz.net
tracing
xdebug
points
jackrabbit-oak
instructions
location-services
snap-framework
xcrun
om-next
mongoengine
advanced-filter
spring-rabbitmq
jfxtras
testlink
gitolite
selenide
utf
ejml
web-inspector
react-intl
rm
deployd
datediff
skip-lists
winmerge
mongodb-aggregation
http-basic-authentication
1010
kendo-editor
haraka
yui3
xcode6.4
e
ndk-build
dpkg
jeasyui
urbit
xcopy
polymerfire
miniconda
linuxbrew
opencyc
blank-line
css-paged-media
python-curses
loginview
webmethod
nachos
gpu-programming
jmenubar
virtual-channel
objective-c-runtime
void-pointers
sly-scroller
dibs
html-frames
donut-chart
jquery-cycle
nsmutablestring
telerik-ajax
hardcode
yuidoc
mvcrecaptcha
database-deadlocks
kohana-auth
jquery-1.4
css-friendly
webresponse
channelfactory
git-log
eaccelerator
3-tier
mysqli-multi-query
rtti
stretchblt
objectinstantiation
watchpoint
isapi-redirect
remote-working

Resources

Encrypt Message