mirror of
https://github.com/simon987/Simple-Incremental-Search-Tool.git
synced 2025-12-13 23:29:04 +00:00
Added slider and select for directories
This commit is contained in:
45
indexer.py
45
indexer.py
@@ -61,27 +61,32 @@ class Indexer:
|
||||
self.es.indices.create(index=self.index_name)
|
||||
self.es.indices.close(index=self.index_name)
|
||||
|
||||
self.es.indices.put_settings(body='{"analysis":{"tokenizer":{"path_tokenizer":{"type":"path_hierarchy"}}}}',
|
||||
index=self.index_name)
|
||||
self.es.indices.put_settings(body='{"analysis":{"tokenizer":{"my_nGram_tokenizer":{"type":"nGram","min_gram":3,"max_gram":3}}}}',
|
||||
index=self.index_name)
|
||||
self.es.indices.put_settings(body='{"analysis":{"analyzer":{"path_analyser":{"tokenizer":"path_tokenizer"}}}}',
|
||||
index=self.index_name)
|
||||
self.es.indices.put_settings(body='{"analysis":{"analyzer":{"my_nGram":{"tokenizer":"my_nGram_tokenizer", "filter": ["lowercase", "asciifolding"]}}}}',
|
||||
index=self.index_name)
|
||||
self.es.indices.put_settings(body={
|
||||
"analysis": {"tokenizer": {"path_tokenizer": {"type": "path_hierarchy"}}}},
|
||||
index=self.index_name)
|
||||
self.es.indices.put_settings(body={
|
||||
"analysis": {"tokenizer": {"my_nGram_tokenizer": {"type": "nGram", "min_gram": 3, "max_gram": 3}}}},
|
||||
index=self.index_name)
|
||||
self.es.indices.put_settings(body={
|
||||
"analysis": {"analyzer": {"path_analyser": {"tokenizer": "path_tokenizer"}}}},
|
||||
index=self.index_name)
|
||||
self.es.indices.put_settings(body={
|
||||
"analysis": {"analyzer": {"my_nGram": {"tokenizer": "my_nGram_tokenizer", "filter": ["lowercase",
|
||||
"asciifolding"]}}}},
|
||||
index=self.index_name)
|
||||
|
||||
self.es.indices.put_mapping(body='{"properties": {'
|
||||
'"path": {"type": "text", "analyzer": "path_analyser", "copy_to": "suggest-path"},'
|
||||
'"suggest-path": {"type": "completion", "analyzer": "keyword"},'
|
||||
'"mime": {"type": "keyword"},'
|
||||
'"directory": {"type": "keyword"},'
|
||||
'"name": {"analyzer": "my_nGram", "type": "text"},'
|
||||
'"album": {"analyzer": "my_nGram", "type": "text"},'
|
||||
'"artist": {"analyzer": "my_nGram", "type": "text"},'
|
||||
'"title": {"analyzer": "my_nGram", "type": "text"},'
|
||||
'"genre": {"analyzer": "my_nGram", "type": "text"},'
|
||||
'"album_artist": {"analyzer": "my_nGram", "type": "text"}'
|
||||
'}}', doc_type="file", index=self.index_name)
|
||||
self.es.indices.put_mapping(body={"properties": {
|
||||
"path": {"type": "text", "analyzer": "path_analyser", "copy_to": "suggest-path"},
|
||||
"suggest-path": {"type": "completion", "analyzer": "keyword"},
|
||||
"mime": {"type": "text", "analyzer": "path_analyser"},
|
||||
"directory": {"type": "keyword"},
|
||||
"name": {"analyzer": "my_nGram", "type": "text"},
|
||||
"album": {"analyzer": "my_nGram", "type": "text"},
|
||||
"artist": {"analyzer": "my_nGram", "type": "text"},
|
||||
"title": {"analyzer": "my_nGram", "type": "text"},
|
||||
"genre": {"analyzer": "my_nGram", "type": "text"},
|
||||
"album_artist": {"analyzer": "my_nGram", "type": "text"}
|
||||
}}, doc_type="file", index=self.index_name)
|
||||
|
||||
self.es.indices.open(index=self.index_name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user