Skip to content

Instantly share code, notes, and snippets.

{
"took" : 2188,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 1,
"failed" : 4,
"failures" : [ {
"index" : "contactindex_2011_07_14_09_03_52",
"shard" : 1,
[2011-07-19 06:54:19,154][INFO ][com.cs.cts.crm.elasticsearch.util.MyLatestActivitySorterFactory] MyLatest JSON
null
[2011-07-19 06:54:19,264][INFO ][com.cs.cts.crm.elasticsearch.util.MyLatestActivitySorterFactory] MyLatest JSON
{"25867415":"2011-01-18 20:37:00.0","25328591":"2010-07-21 16:43:00.0","25114991":"2011-05-20 16:29:00.0","110062874":"2010-06-09 22:12:00.0","25758056":"2011
-01-18 20:37:00.0","25783249":"2011-02-08 06:00:00.0","25250290":"2011-04-11 12:33:00.0","25822332":"2011-02-04 06:30:00.0","25019158":"2011-02-22 05:16:00.0"
,"25657421":"2011-12-02 07:00:00.0","25913876":"2011-04-27 13:53:00.0","25560663":"2011-03-07 22:31:00.0","25588842":"2011-01-16 12:31:00.0","25095700":"2011-
04-21 16:50:00.0","25778502":"2011-03-22 13:29:00.0","25504164":"2011-02-20 09:40:00.0","25897180":"2011-04-27 16:38:00.0","25885331":"2011-02-25 11:29:00.0",
"25866800":"2011-04-13 17:20:00.0","25588907":"2011-01-18 20:37:00.0"}
[2011-07-19 06:54:19,286][INFO ][com.cs.cts.crm.elasticsearch.util.MyLatestActivitySorte
public class MyLatestActivitySorterFactory implements NativeScriptFactory{
protected ObjectMapper mapper;
//2011-02-12 18:11:00.0
private DateFormat myDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S");
private final static Log LOG = LogFactory.getLog(MyLatestActivitySorterFactory.class);
@Override
public ExecutableScript newScript(Map<String, Object> params) {
@dav-rob
dav-rob / ElasticSearch Bulk Indexing
Created October 19, 2011 09:52
ElasticSearch Bulk Indexing from JDBC Input
package ****.elasticsearch.index;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.commons.logging.Log;
@dav-rob
dav-rob / Week View Map
Created November 28, 2011 15:34
Week View Map
{
"weekViewMap": {
"20111128-day3": {
"numActivities": 3,
"userTypeMap": {
"25120904": "T",
"25801329": "M",
"25867415": "M"
}
},
@dav-rob
dav-rob / BaseErrorRecreation
Created November 30, 2011 14:26
Base Recreation Class and Test Class
public class BaseErrorRecreation {
protected static int waitForServerTimeout = 15000;
public static final Logger LOG = Logger.getLogger(BaseErrorRecreation.class.getName());
protected static Client client;
protected static boolean initializing = false;
protected static boolean initialized = false;
/*
* Spring properties Follow
*/
@dav-rob
dav-rob / Definition
Created January 9, 2012 16:17
Email Tokenizer Problem
index:
mapper:
dynamic: false
analysis:
analyzer:
default:
type: standard
stopwords: _none_
# sortable is used to enable case-independent sorting
@dav-rob
dav-rob / Query
Created January 9, 2012 16:32
Email Tokenizer Problem
{
"bool" : {
"should" : [ {
"filtered" : {
"query" : {
"match_all" : {
}
},
"filter" : {
"bool" : {
[2012-05-22 05:39:50,164][INFO ][node ] [Jack-in-the-Box] {elasticsearch/0.17.6}[16014]: initializing ...
[2012-05-22 05:39:50,218][INFO ][plugins ] [Jack-in-the-Box] loaded [], sites []
[2012-05-22 05:39:58,805][INFO ][node ] [Jack-in-the-Box] {elasticsearch/0.17.6}[16014]: initialized
[2012-05-22 05:39:58,807][INFO ][node ] [Jack-in-the-Box] {elasticsearch/0.17.6}[16014]: starting ...
[2012-05-22 05:39:59,372][INFO ][transport ] [Jack-in-the-Box] bound_address {inet[/169.49.110.161:9300]}, publish_address {inet[/169.49.110.161:9300]}
[2012-05-22 05:39:59,691][INFO ][cluster.service ] [Jack-in-the-Box] new_master [Jack-in-the-Box][jXjOjMFzSlmp3xim9cgjBQ][inet[/169.49.110.161:9300]], reason: zen-disco-join (elected_as_master)
[2012-05-22 05:39:59,818][WARN ][discovery.zen.ping.unicast] [Jack-in-the-Box] failed to send ping to [[#zen_unicast_5#][inet[/169.49.110.161:9302]]]
org.elasticsearch.transport.ReceiveTi
@dav-rob
dav-rob / Elastic Search Curl Commands 1
Created May 22, 2012 15:46
Elastic Search Curl Commands
Token Analysis
===============
curl -XGET '*****110.160:9302/contactalias/_analyze?field=mainEmail' -d 'acker'
curl -XGET '*****110.160:9302/contactindex_2011_10_18_08_59_34/_analyze?text=this+is+a+test'
Get Mapping
===============
Returns which types are mapped into the index, whether the fields are analysed, stored, boosted etc.
e.g.