Skip to content

Instantly share code, notes, and snippets.

Avatar

Jun Ohtani johtani

View GitHub Profile
@johtani
johtani / sample.json
Created Jul 20, 2020
joinで子供をハイライト
View sample.json
PUT join_highlight
{
"mappings": {
"properties": {
"my_id": {
"type": "keyword"
},
"my_join_field": {
"type": "join",
"relations": {
@johtani
johtani / demo.json
Created Jun 18, 2020
Elasticsearch勉強会のデモで利用したDevConsoleのスクリプト
View demo.json
## version 7.9で動作するはずです。 discard_compound_tokenの設定は7.8までは動作しないです(それ以外については動作します。)
DELETE en_synonym_test
PUT en_synonym_test
{
"settings": {
"analysis": {
"analyzer": {
"en_synonym": {
@johtani
johtani / words.txt
Last active Jun 12, 2020
UniDicに出てくる、Kuromojiが区切り文字と判断する文字が含まれる単語たち
View words.txt
start with punctuation: [606]. one char is [384]
all punctuations: [111]
hasPunctuations: [1780]
+++++++++++++++++ Start with Punctuation +++++++++++++++++++++
¡
¢
£
¤
¦
§
@johtani
johtani / gist:50aa2776a385c5c8dfa3a0d1e4e268cd
Last active Jun 12, 2020
ipadicに出てくる、Kuromojiが区切り文字と判断する文字が含まれる単語の一覧
View gist:50aa2776a385c5c8dfa3a0d1e4e268cd
start with punctuation: [101]. one char is [97]
all punctuations: [3]
hasPunctuations: [723]
+++++++++++++++++ Start with Punctuation +++++++++++++++++++++
@johtani
johtani / 1_辞書の更新方法_ファイル編.json
Last active Apr 27, 2020
「辞書の更新についての注意事項」ブログの補足手順など
View 1_辞書の更新方法_ファイル編.json
## 0. インデックスの準備
### 再現可能なようにまず削除
DELETE file_dic_sample
### 辞書ファイルの用意
ファイル名 : custom_dic.txt
配置場所 : ES_PATH_CONF/analyzer/custom_dic.txt
内容
```
@johtani
johtani / .zshrc
Created Dec 17, 2019
dot_zshrc_20191217
View .zshrc
## For rewrite prezto default settings
EDITOR=vim
VISUAL=vim
### aliases
alias ls='ls -aG'
alias vscode='open -a ~/Applications/Visual\ Studio\ Code.app '
### For ant
export ANT_OPTS=-Dfile.encoding=UTF-8
@johtani
johtani / build.xml
Created Oct 16, 2019
ant build-dict with unidic
View build.xml
<?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
View gist:b53e9e241e5b98519fb3ffe12b4164eb
~/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 Apr 27, 2018
reindex with index template in v6.2.4
View gist:310672675aec7d2a9ed8516bf0ae3558
PUT _template/hoge
{
"index_patterns": ["hoge-*"],
"settings": {
"number_of_replicas": 0,
"number_of_shards": 2
},
"mappings": {
"type1": {
View apachelog reindex for demo on target date
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);",