Sam_4
(Sam)
January 9, 2012, 5:27am
1
Hi
I am using following bulk message format for creating index using
rabbitmq river,look on gist:
bulk api format
{"index" : { "_index" : "test", "_type" : "type1", "_id" : "3", "_analyzer":"myanalyzer" } }
{"type1" : { "name" : "my name is john" } }
{"myanalyzer" : {"type" : "custom", "tokenizer" :"mytokenizer","filter" :"myfilter"}}
{"mytokenizer": {"type":"whitespace"}}
{"myfilter":{"type":"stop" "stopwords" : [is]}}
{"create" : { "_index" : "test", "_type" : "type1", "_id" : "3" } }
{"type1" : { "name" : "my name is john" } }
Here i'm try to override the default analyzer with my custom
analyzer,but i got the following exception:
Exception
org.elasticsearch.common.jackson.JsonParseException: Unexpected character ('"' (code 34)): was expecting comma to separate OBJECT entries
at [Source: [B@1710808; line: 1, column: 296]
at org.elasticsearch.common.jackson.JsonParser._constructError(JsonParser.java:1291)
at org.elasticsearch.common.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:385)
at org.elasticsearch.common.jackson.impl.JsonParserMinimalBase._reportUnexpectedChar(JsonParserMinimalBase.java:306)
at org.elasticsearch.common.jackson.impl.Utf8StreamParser.nextToken(Utf8StreamParser.java:312)
at org.elasticsearch.common.xcontent.json.JsonXContentParser.nextToken(JsonXContentParser.java:46)
at org.elasticsearch.action.bulk.BulkRequest.add(BulkRequest.java:121)
at org.elasticsearch.client.action.bulk.BulkRequestBuilder.add(BulkRequestBuilder.java:84)
at org.elasticsearch.river.rabbitmq.RabbitmqRiver$Consumer.run(RabbitmqRiver.java:216)
This file has been truncated. show original
gistfile1.txt
when
please help me. where the problem and what will be the
correct mapping for override the default analyzer.
Thanks