The mapping has errors. Something like this might work better:
DELETE /myindex
PUT /myindex
PUT /myindex/album/_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" : {
"index_name" : "album.AlbumID",
"path" : "full",
"type" : "string"
}
}
}
}
GET /myindex/album/_mapping
Jörg
On Wed, Apr 30, 2014 at 10:34 PM, Eric Sims <[email protected]>wrote:
> no. i just tried deleting all indexes, then i did:
>
> PUT /myindex
>
> then
>
> PUT /myindex/album/_mapping
> {
> "myindex": {
> "mappings": {
> "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"}
> }
> }
> }
> }
> }
>
> then i ran the PUT statement in my previous post.
>
> it still treats it as dynamic mappings
>
> 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/1bda2b24-8fc4-4706-a43f-cadf820ebc6c%40googlegroups.com<https://groups.google.com/d/msgid/elasticsearch/1bda2b24-8fc4-4706-a43f-cadf820ebc6c%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/CAKdsXoGkTLqF6VC4kSYMT2WjnAcLiLF4RE-DG4914uc31DdRGg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.