Update:

I did some digging and discovered the setTimestamp method 
https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/action/index/IndexRequestBuilder.java#L297-L303
 
so I tried adding that to my code 
https://github.com/jesusabdullah/zoltun/blob/master/src/main/java/com/jesusabdullah/zoltun/Indexer.java#L83-L85
 
but this doesn't appear to have done the trick either.

I suspect my problems are coming from using the java api, which uses the 
tcp node-to-node communication protocol instead of the typical http/json 
one.

--Josh

On Tuesday, October 14, 2014 8:46:10 PM UTC-4, Joshua Holbrook wrote:
>
> Hello,
>
> I'm working on an irc bot that indexes in-channel image links, and so far 
> so good---except I can't seem to get automatic timestamps working! I did my 
> best to follow the docs at 
> http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-timestamp-field.html
>  
> but I don't see any change in what my search docs look like, even after 
> deleting the entire index and reconfiguring first.
>
> Right now my mapping looks like this:
>
> $ curl http://localhost:9200/archivist/_mapping?pretty
> {
>   "archivist" : {
>     "mappings" : {
>       "image" : {
>         "_timestamp" : {
>           "enabled" : true,
>           "store" : true
>         },
>         "properties" : {
>           "channel" : {
>             "type" : "string"
>           },
>           "image" : {
>             "type" : "string"
>           },
>           "message" : {
>             "type" : "string"
>           },
>           "user" : {
>             "type" : "string"
>           }
>         }
>       }
>     }
>   }
> }
>
> and after indexing something (code doing this at 
> https://github.com/jesusabdullah/archivist/blob/master/src/main/java/com/jesusabdullah/archivist/Indexer.java#L71-L82
>  
> first java project ever) my search results look like:
>
> $ curl http://localhost:9200/archivist/image/_search?pretty
> {
>   "took" : 0,
>   "timed_out" : false,
>   "_shards" : {
>     "total" : 5,
>     "successful" : 5,
>     "failed" : 0
>   },
>   "hits" : {
>     "total" : 1,
>     "max_score" : 1.0,
>     "hits" : [ {
>       "_index" : "archivist",
>       "_type" : "image",
>       "_id" : "jK8dY6oKTRifbUU4o406pw",
>       "_score" : 1.0,
>       
> "_source":{"channel":"#nodebombrange","user":"jesusabdullah","message":"snoop!
>  
> http://i.imgur.com/iktO9TK.gif","image":"http://i.imgur.com/iktO9TK.gif"}
>     } ]
>   }
> }
>
> Am I doing something wrong?
>
> Thanks,
>
> --Josh
>

-- 
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/4b33374b-5c14-451b-acb4-59ccd45e0fe9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to