i'm able to get the mappings working as you suggested. However, the custom
_id mapping is not working.
it's still generating a dynamic _id.
any ideas?
On Wednesday, April 30, 2014 5:07:57 PM UTC-4, Eric Sims wrote:
>
> should i keep the mapping in the original PUT /_river/mytest_river/_meta
> statement or removing in lieu of the other separate mapping statement?
>
> because i tried what you just suggested and it didn't seem to make a
> difference with having removed the mapping statement within the river.
>
> On Wednesday, April 30, 2014 3:56:22 PM UTC-4, Eric Sims wrote:
>>
>> i can't seem to understand how to fully set up my type mappings while
>> using jdbc rivers and sql server.
>>
>> here's an example.
>>
>> PUT /_river/mytest_river/_meta
>> {
>> "type": "jdbc",
>> "jdbc": {
>> "url":"jdbc:sqlserver://mydbserver:1433;databaseName=mydatabase",
>> "user":"myuser",
>> "password":"xxx",
>> "sql":"select * from dbo.musicalbum (nolock)",
>> "strategy" : "oneshot",
>> "index" : "myindex",
>> "type" : "album",
>> "bulk_size" : 100,
>> "max_retries": 5,
>> "max_retries_wait":"30s",
>> "max_bulk_requests" : 5,
>> "bulk_flush_interval" : "5s",
>> "type_mapping": {
>> "album": {"properties": {
>> "AlbumDescription": {"type": "string"},
>> "AlbumID": {"type": "string"},
>> "Artist": {"type": "string"},
>> "Genre": {"type": "string","index" : "not_analyzed"},
>> "Label": {"type": "string"},
>> "Title": {"type": "string"},
>> "_id" : {"path" : "AlbumID"}
>> }
>> }
>> }
>> }
>> }
>>
>> so you can see i've specified both a select statement (which normally
>> would dynamically produce the mapping for me) and also a type mapping. in
>> the type mapping i've tried to specify that i want the _id to be the same
>> as AlbumID, and also that i want the Genre to be not_analyzed. it ends up
>> throwing multiple errors, only indexing one document, and not creating my
>> full mapping.
>>
>> here's what the mapping ends up looking like: (skipping some of the
>> columns altogether!)
>>
>> {
>> "myindex": {
>> "mappings": {
>> "album": {
>> "properties": {
>> "AlbumDescription": {
>> "type": "string"
>> },
>> "AlbumID": {
>> "type": "string"
>> },
>> "Artist": {
>> "type": "string"
>> },
>> "Genre": {
>> "type": "string"
>> },
>> "Title": {
>> "type": "string"
>> }
>> }
>> }
>> }
>> }
>> }
>>
>> any assistance would be helpful. it's driving me nuts.
>>
>
--
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/03aec83a-b365-44d7-bbe0-89dd9e486ac1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.