# index 確認
$ curl -X GET 'localhost:9200/_cat/indices?v'
$ curl -X DELETE 'localhost:9200/index-rooms-v1?pretty'
$ curl -X POST -H 'Content-Type: application/json' 'http://localhost:9200/rooms/_analyze?pretty' -d '{"analyzer": "ngram", "text": "general"}'
$ curl -X POST -H 'Content-Type: application/json' "http://localhost:9200/rooms/_search?pretty=true" -d '
{
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const settings = { | |
index: { max_ngram_diff: 2 }, | |
analysis: { | |
tokenizer: { | |
kuromoji_tokenizer: { | |
type: 'kuromoji_tokenizer', | |
mode: 'search' | |
}, | |
unigram_tokenizer: { | |
type: 'ngram', |
Array performance https://v8.dev/blog/elements-kinds#avoid-creating-holes
$ node -v
v14.14.0
$ node simple_loop.js
loop: 475.427ms
配列のメモリ使用量確認
$ node memory_new_array.js
[
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
OlderNewer