diff --git a/config/search.go b/config/search.go index 29c0c696..7c180f68 100644 --- a/config/search.go +++ b/config/search.go @@ -10,7 +10,7 @@ var DefaultSearchConfig = SearchConfig{} const ( // DefaultElasticsearchAnalyzer : default analyzer for ES - DefaultElasticsearchAnalyzer = "nyaapantsu_search_analyzer" + DefaultElasticsearchAnalyzer = "nyaapantsu_analyzer" // DefaultElasticsearchIndex : default search index for ES DefaultElasticsearchIndex = "nyaapantsu" // DefaultElasticsearchType : Name of the type in the es mapping diff --git a/deploy/ansible/group_vars/all b/deploy/ansible/group_vars/all index 1082305d..e50c99bc 100644 --- a/deploy/ansible/group_vars/all +++ b/deploy/ansible/group_vars/all @@ -5,5 +5,4 @@ nyaapantsu_pgpool_port: 9998 nyaapantsu_directory: /nyaapantsu/ nyaapantsu_gpg_passphrase_file: "{{ nyaapantsu_directory }}/passphrase" nyaapantsu_elasticsearch_index: nyaapantsu -nyaapantsu_build_directory: go_nyaa/ # vim: ft=yaml diff --git a/deploy/ansible/install_nyaa.yml b/deploy/ansible/install_nyaa.yml deleted file mode 100644 index 31126903..00000000 --- a/deploy/ansible/install_nyaa.yml +++ /dev/null @@ -1,7 +0,0 @@ -# Should only be used for the dev machine until we get a nice setup to install -# both sukebei AND nyaa. -- name: Install nyaa - hosts: webservers - roles: - - nyaapantsu - diff --git a/deploy/ansible/roles/elasticsearch/files/elasticsearch_settings.yml b/deploy/ansible/roles/elasticsearch/files/elasticsearch_settings.yml index 96cded7f..bcee849c 100644 --- a/deploy/ansible/roles/elasticsearch/files/elasticsearch_settings.yml +++ b/deploy/ansible/roles/elasticsearch/files/elasticsearch_settings.yml @@ -2,41 +2,19 @@ settings: analysis: analyzer: - nyaapantsu_search_analyzer: - type: custom - tokenizer: standard - char_filter: - - my_char_filter + nyaapantsu_analyzer: + tokenizer: nyaapantsu_tokenizer filter: - standard - lowercase - nyaapantsu_index_analyzer: - type: custom - tokenizer: standard - char_filter: - - my_char_filter - filter: - - resolution - - lowercase - - my_ngram - - word_delimit - filter: - my_ngram: - type: edgeNGram + tokenizer: + nyaapantsu_tokenizer: + type: edge_ngram min_gram: 2 max_gram: 15 - resolution: - type: pattern_capture - patterns: ["(\\d+)[xX](\\d+)"] - word_delimit: - type: word_delimiter - preserve_original: true - split_on_numerics: false - char_filter: - my_char_filter: - type: mapping - mappings: ["-=>_", "!=>_", "_=>\\u0020"] - + token_chars: + - letter + - digit index: number_of_shards: 1 number_of_replicas: 0 @@ -49,7 +27,7 @@ mappings: type: long name: type: text - analyzer: nyaapantsu_index_analyzer + analyzer: nyaapantsu_analyzer fielddata: true # Use to sort by id because it is currently a text field category: type: text diff --git a/deploy/ansible/roles/nyaapantsu/tasks/main.yml b/deploy/ansible/roles/nyaapantsu/tasks/main.yml deleted file mode 100644 index abcf5c46..00000000 --- a/deploy/ansible/roles/nyaapantsu/tasks/main.yml +++ /dev/null @@ -1,18 +0,0 @@ -- name: Make directory - file: - state: directory - path: "{{ nyaapantsu_build_directory }}/src/github.com/NyaaPantsu" - -# TODO ability to get specify commit -- name: Get latest nyaa - git: - repo: 'https://github.com/NyaaPantsu/nyaa' - dest: "{{ nyaapantsu_build_directory }}/src/github.com/NyaaPantsu/nyaa" - -# Assumes the GOPATH variable has been set -- name: Go build - shell: go build - args: - chdir: "{{ nyaapantsu_build_directory }}/src/github.com/NyaaPantsu/nyaa" - environment: - GOPATH: "/home/{{ ansible_ssh_user }}/{{ nyaapantsu_build_directory }}"