Skip to content

Instantly share code, notes, and snippets.

View johtani's full-sized avatar

Jun Ohtani johtani

View GitHub Profile
@johtani
johtani / build.xml
Created October 16, 2019 15:11
ant build-dict with unidic
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
@johtani
johtani / gist:b53e9e241e5b98519fb3ffe12b4164eb
Created October 16, 2019 14:49
ant build-dict with ipadic
~/IdeaProjects/lucene-gosen-workspace/lucene-solr/lucene/analysis/kuromoji (fix-4056 *$) $ ant clean
Buildfile: /Users/johtani/IdeaProjects/lucene-gosen-workspace/lucene-solr/lucene/analysis/kuromoji/build.xml
clean:
[delete] Deleting directory /Users/johtani/IdeaProjects/lucene-gosen-workspace/lucene-solr/lucene/build/analysis/kuromoji
BUILD SUCCESSFUL
Total time: 0 seconds
~/IdeaProjects/lucene-gosen-workspace/lucene-solr/lucene/analysis/kuromoji (fix-4056 *$) $ ant build-dict
Buildfile: /Users/johtani/IdeaProjects/lucene-gosen-workspace/lucene-solr/lucene/analysis/kuromoji/build.xml
@johtani
johtani / gist:310672675aec7d2a9ed8516bf0ae3558
Created April 27, 2018 08:29
reindex with index template in v6.2.4
PUT _template/hoge
{
"index_patterns": ["hoge-*"],
"settings": {
"number_of_replicas": 0,
"number_of_shards": 2
},
"mappings": {
"type1": {
POST _reindex
{
"source": {
"index": "apache_elk_example_org"
},
"dest": {
"index": "apache_elk_example"
},
"script": {
"inline": "Random rdm = new Random();ctx._source['@timestamp'] = params.dates[rdm.nextInt(params.dates.length)]+ ctx._source['@timestamp'].substring(10);",
String json = "{" +
"\"user\":\"kimchy\"\n," +
"\"postDate\":\"2013-01-30\"," +
"\"message\":\"trying out Elasticsearch\"" +
"}";
BulkRequestBuilder bulkRequest = client.prepareBulk();
bulkRequest.add(client.prepareIndex("test1", "tweet", "id1").setSource(json));
@johtani
johtani / gist:0554f54ae7d9aea375cb
Created November 25, 2015 03:12
Example url search
PUT hoge_index
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"hoge": {
"properties": {
@johtani
johtani / gist:9687fb3cfb249750910d
Created January 21, 2015 07:17
Terms aggregation filtered the length of terms
DELETE /filtered_aggs
PUT /filtered_aggs
PUT /filtered_aggs/example/1
{
"text" : "this is test doc"
}
PUT /filtered_aggs/example/2
@johtani
johtani / gist:1a844bdd3443fb43fb90
Last active September 11, 2018 13:10
Example using Kuromoji readingform and NGram
DELETE kuromoji_sample
PUT kuromoji_sample
{
"settings": {
"analysis": {
"analyzer": {
"hoge" : {
"type" : "custom",
"tokenizer" : "kuromoji_tokenizer",
@johtani
johtani / check_request
Created October 31, 2014 14:16
Analyze the issue about kibana3 histogram no showing...
GET sensu-metrics-2014.10.31/_search
{
"facets": {
"0": {
"date_histogram": {
"key_field": "@timestamp",
"value_field": "value",
"interval": "1m"
},
"global": true,
@johtani
johtani / command_sample
Last active May 12, 2016 05:56
Does not reproduce the mapping error...
$ curl -XPUT localhost:9200/test_idx -d @config.json
{"error":"MapperParsingException[mapping [test_type]]; nested: IllegalArgumentException[Invalid format: [not_analyze]: Illegal pattern component: n]; nested: IllegalArgumentException[Illegal pattern component: n]; ","status":400}jupiter:ess_env