From da19743ba5b16c68bd8a0a6f1d634151ef31f02f Mon Sep 17 00:00:00 2001 From: Jai A Date: Sat, 9 May 2020 22:11:48 -0700 Subject: [PATCH 001/615] Initial Commit --- .gitignore | 105 ++ .idea/.gitignore | 8 + .idea/Fabricate.iml | 11 + .idea/dictionaries/geometrically.xml | 8 + .idea/misc.xml | 6 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + Cargo.lock | 2302 ++++++++++++++++++++++++++ Cargo.toml | 18 + src/main.rs | 159 ++ static/templates/index.html | 12 + static/templates/search.html | 38 + 12 files changed, 2681 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/Fabricate.iml create mode 100644 .idea/dictionaries/geometrically.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 src/main.rs create mode 100644 static/templates/index.html create mode 100644 static/templates/search.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..70391e3d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,105 @@ + +# Created by https://www.gitignore.io/api/rust,clion +# Edit at https://www.gitignore.io/?templates=rust,clion + +### CLion ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +### CLion Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +.idea/**/sonarlint/ + +# SonarQube Plugin +.idea/**/sonarIssues.xml + +# Markdown Navigator plugin +.idea/**/markdown-navigator.xml +.idea/**/markdown-navigator/ + +### Rust ### +# Generated by Cargo +# will have compiled files and executables +/target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# End of https://www.gitignore.io/api/rust,clion diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 000000000..73f69e095 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/Fabricate.iml b/.idea/Fabricate.iml new file mode 100644 index 000000000..1ee34ab3d --- /dev/null +++ b/.idea/Fabricate.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/dictionaries/geometrically.xml b/.idea/dictionaries/geometrically.xml new file mode 100644 index 000000000..e5baa72c1 --- /dev/null +++ b/.idea/dictionaries/geometrically.xml @@ -0,0 +1,8 @@ + + + + serde + tantivy + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 000000000..28a804d89 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..26dc67132 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..94a25f7f4 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 000000000..33e88a2c9 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2302 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "actix-codec" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09e55f0a5c2ca15795035d90c46bd0e73a5123b72f68f12596d6ba5282051380" +dependencies = [ + "bitflags", + "bytes", + "futures-core", + "futures-sink", + "log", + "tokio", + "tokio-util 0.2.0", +] + +[[package]] +name = "actix-connect" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c95cc9569221e9802bf4c377f6c18b90ef10227d787611decf79fd47d2a8e76c" +dependencies = [ + "actix-codec", + "actix-rt", + "actix-service", + "actix-utils", + "derive_more", + "either", + "futures", + "http", + "log", + "trust-dns-proto", + "trust-dns-resolver", +] + +[[package]] +name = "actix-http" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c16664cc4fdea8030837ad5a845eb231fb93fc3c5c171edfefb52fad92ce9019" +dependencies = [ + "actix-codec", + "actix-connect", + "actix-rt", + "actix-service", + "actix-threadpool", + "actix-utils", + "base64", + "bitflags", + "brotli2", + "bytes", + "chrono", + "copyless", + "derive_more", + "either", + "encoding_rs", + "failure", + "flate2", + "futures-channel", + "futures-core", + "futures-util", + "fxhash", + "h2", + "http", + "httparse", + "indexmap", + "language-tags", + "lazy_static", + "log", + "mime", + "percent-encoding", + "pin-project", + "rand 0.7.3", + "regex", + "serde", + "serde_json", + "serde_urlencoded", + "sha1", + "slab", + "time", +] + +[[package]] +name = "actix-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21705adc76bbe4bc98434890e73a89cd00c6015e5704a60bb6eea6c3b72316b6" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "actix-router" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d7a10ca4d94e8c8e7a87c5173aba1b97ba9a6563ca02b0e1cd23531093d3ec8" +dependencies = [ + "bytestring", + "http", + "log", + "regex", + "serde", +] + +[[package]] +name = "actix-rt" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "143fcc2912e0d1de2bcf4e2f720d2a60c28652ab4179685a1ee159e0fb3db227" +dependencies = [ + "actix-macros", + "actix-threadpool", + "copyless", + "futures-channel", + "futures-util", + "smallvec", + "tokio", +] + +[[package]] +name = "actix-server" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "582a7173c281a4f46b5aa168a11e7f37183dcb71177a39312cc2264da7a632c9" +dependencies = [ + "actix-codec", + "actix-rt", + "actix-service", + "actix-utils", + "futures", + "log", + "mio", + "mio-uds", + "net2", + "num_cpus", + "slab", +] + +[[package]] +name = "actix-service" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e4fc95dfa7e24171b2d0bb46b85f8ab0e8499e4e3caec691fc4ea65c287564" +dependencies = [ + "futures-util", + "pin-project", +] + +[[package]] +name = "actix-testing" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48494745b72d0ea8ff0cf874aaf9b622a3ee03d7081ee0c04edea4f26d32c911" +dependencies = [ + "actix-macros", + "actix-rt", + "actix-server", + "actix-service", + "futures", + "log", + "net2", +] + +[[package]] +name = "actix-threadpool" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4082192601de5f303013709ff84d81ca6a1bc4af7fb24f367a500a23c6e84e" +dependencies = [ + "derive_more", + "futures-channel", + "lazy_static", + "log", + "num_cpus", + "parking_lot", + "threadpool", +] + +[[package]] +name = "actix-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4e5b4faaf105e9a6d389c606c298dcdb033061b00d532af9df56ff3a54995a8" +dependencies = [ + "actix-codec", + "actix-rt", + "actix-service", + "actix-utils", + "derive_more", + "either", + "futures", + "log", +] + +[[package]] +name = "actix-utils" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcf8f5631bf01adec2267808f00e228b761c60c0584cc9fa0b5364f41d147f4e" +dependencies = [ + "actix-codec", + "actix-rt", + "actix-service", + "bitflags", + "bytes", + "either", + "futures", + "log", + "pin-project", + "slab", +] + +[[package]] +name = "actix-web" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3158e822461040822f0dbf1735b9c2ce1f95f93b651d7a7aded00b1efbb1f635" +dependencies = [ + "actix-codec", + "actix-http", + "actix-macros", + "actix-router", + "actix-rt", + "actix-server", + "actix-service", + "actix-testing", + "actix-threadpool", + "actix-tls", + "actix-utils", + "actix-web-codegen", + "awc", + "bytes", + "derive_more", + "encoding_rs", + "futures", + "fxhash", + "log", + "mime", + "net2", + "pin-project", + "regex", + "serde", + "serde_json", + "serde_urlencoded", + "time", + "url", +] + +[[package]] +name = "actix-web-codegen" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f00371942083469785f7e28c540164af1913ee7c96a4534acb9cea92c39f057" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "adler32" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" + +[[package]] +name = "aho-corasick" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" +dependencies = [ + "memchr", +] + +[[package]] +name = "arc-swap" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b585a98a234c46fc563103e9278c9391fde1f4e6850334da895d27edb9580f62" + +[[package]] +name = "async-trait" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da71fef07bc806586090247e971229289f64c210a278ee5ae419314eb386b31d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomicwrites" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a2baf2feb820299c53c7ad1cc4f5914a220a1cb76d7ce321d2522a94b54651f" +dependencies = [ + "nix", + "tempdir", + "winapi 0.3.8", +] + +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" + +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" + +[[package]] +name = "awc" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7601d4d1d7ef2335d6597a41b5fe069f6ab799b85f53565ab390e7b7065aac5" +dependencies = [ + "actix-codec", + "actix-http", + "actix-rt", + "actix-service", + "base64", + "bytes", + "derive_more", + "futures-core", + "log", + "mime", + "percent-encoding", + "rand 0.7.3", + "serde", + "serde_json", + "serde_urlencoded", +] + +[[package]] +name = "backtrace" +version = "0.3.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e692897359247cc6bb902933361652380af0f1b7651ae5c5013407f30e109e" +dependencies = [ + "backtrace-sys", + "cfg-if", + "libc", + "rustc-demangle", +] + +[[package]] +name = "backtrace-sys" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fbebbe1c9d1f383a9cc7e8ccdb471b91c8d024ee9c2ca5b5346121fe8b4399" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" + +[[package]] +name = "bitpacking" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3744aff20a3437a99ebc0bb7733e9e60c7bf590478c9b897e95b38d57e5acb68" +dependencies = [ + "crunchy", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "brotli-sys" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4445dea95f4c2b41cde57cc9fee236ae4dbae88d8fcbdb4750fc1bb5d86aaecd" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "brotli2" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cb036c3eade309815c15ddbacec5b22c4d1f3983a774ab2eac2e3e9ea85568e" +dependencies = [ + "brotli-sys", + "libc", +] + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" + +[[package]] +name = "bytes" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" + +[[package]] +name = "bytestring" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7c05fa5172da78a62d9949d662d2ac89d4cc7355d7b49adee5163f1fb3f363" +dependencies = [ + "bytes", +] + +[[package]] +name = "cc" +version = "1.0.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d87b23d6a92cd03af510a5ade527033f6aa6fa92161e2d5863a907d4c5e31d" + +[[package]] +name = "census" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5927edd8345aef08578bcbb4aea7314f340d80c7f4931f99fbeb40b99d8f5060" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "chrono" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2" +dependencies = [ + "num-integer", + "num-traits", + "time", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags", +] + +[[package]] +name = "combine" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d79eb8c0bfd05a68f8b6195b27c4f2e042f86d52da032817f89a3847e0495ed" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "copyless" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff9c56c9fb2a49c05ef0e431485a22400af20d33226dc0764d891d09e724127" + +[[package]] +name = "crc32fast" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" +dependencies = [ + "cfg-if", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cced8691919c02aac3cb0a1bc2e9b73d89e832bf9a06fc579d4e71b68a2da061" +dependencies = [ + "crossbeam-utils", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +dependencies = [ + "autocfg 1.0.0", + "cfg-if", + "crossbeam-utils", + "lazy_static", + "maybe-uninit", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +dependencies = [ + "autocfg 1.0.0", + "cfg-if", + "lazy_static", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "derive_more" +version = "0.99.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2323f3f47db9a0e77ce7a300605d8d2098597fc451ed1a97bb1f6411bb550a7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "downcast-rs" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ba6eb47c2131e784a38b726eb54c1e1484904f013e576a25354d0124161af6" + +[[package]] +name = "dtoa" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" + +[[package]] +name = "either" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" + +[[package]] +name = "encoding_rs" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "enum-as-inner" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc4bfcfacb61d231109d1d55202c1f33263319668b168843e02ad4652725ec9c" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "fabricate" +version = "0.1.0" +dependencies = [ + "actix-rt", + "actix-web", + "handlebars", + "serde", + "serde_derive", + "serde_json", + "tantivy", + "tempdir", +] + +[[package]] +name = "fail" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63eec71a3013ee912a0ecb339ff0c5fa5ed9660df04bfefa10c250b885d018c" +dependencies = [ + "lazy_static", + "log", + "rand 0.6.5", +] + +[[package]] +name = "failure" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" +dependencies = [ + "backtrace", + "failure_derive", +] + +[[package]] +name = "failure_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "filetime" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "affc17579b132fc2461adf7c575cc6e8b134ebca52c51f5411388965227dc695" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "winapi 0.3.8", +] + +[[package]] +name = "flate2" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" +dependencies = [ + "cfg-if", + "crc32fast", + "libc", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi 0.3.8", +] + +[[package]] +name = "fsevent" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" +dependencies = [ + "bitflags", + "fsevent-sys", +] + +[[package]] +name = "fsevent-sys" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" +dependencies = [ + "libc", +] + +[[package]] +name = "fst" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927fb434ff9f0115b215dc0efd2e4fbdd7448522a92a1aa37c77d6a2f8f1ebd6" +dependencies = [ + "byteorder", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "futures" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c329ae8753502fb44ae4fc2b622fa2a94652c41e795143765ba0927f92ab780" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" + +[[package]] +name = "futures-executor" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f674f3e1bcb15b37284a90cedf55afdba482ab061c407a9c0ebbd0f3109741ba" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" + +[[package]] +name = "futures-macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" + +[[package]] +name = "futures-task" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" + +[[package]] +name = "futures-util" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-utils", + "proc-macro-hack", + "proc-macro-nested", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "generic-array" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +dependencies = [ + "typenum", +] + +[[package]] +name = "getrandom" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "h2" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "377038bf3c89d18d6ca1431e7a5027194fbd724ca10592b9487ede5e8e144f42" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "log", + "slab", + "tokio", + "tokio-util 0.3.1", +] + +[[package]] +name = "handlebars" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba758d094d31274eb49d15da6f326b96bf3185239a6359bf684f3d5321148900" +dependencies = [ + "log", + "pest", + "pest_derive", + "quick-error", + "serde", + "serde_json", + "walkdir", +] + +[[package]] +name = "heck" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "hermit-abi" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61565ff7aaace3525556587bd2dc31d4a07071957be715e63ce7b1eccf51a8f4" +dependencies = [ + "libc", +] + +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi 0.3.8", +] + +[[package]] +name = "htmlescape" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" + +[[package]] +name = "http" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "httparse" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" + +[[package]] +name = "idna" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indexmap" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" +dependencies = [ + "autocfg 1.0.0", +] + +[[package]] +name = "inotify" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24e40d6fd5d64e2082e0c796495c8ef5ad667a96d03e5aaa0becfd9d47bcbfb8" +dependencies = [ + "bitflags", + "inotify-sys", + "libc", +] + +[[package]] +name = "inotify-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" +dependencies = [ + "libc", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "ipconfig" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" +dependencies = [ + "socket2", + "widestring", + "winapi 0.3.8", + "winreg", +] + +[[package]] +name = "itertools" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "language-tags" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" + +[[package]] +name = "levenshtein_automata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73a004f877f468548d8d0ac4977456a249d8fabbdb8416c36db163dfc8f2e8ca" +dependencies = [ + "fst", +] + +[[package]] +name = "libc" +version = "0.2.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005" + +[[package]] +name = "linked-hash-map" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" + +[[package]] +name = "lock_api" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] + +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + +[[package]] +name = "memchr" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" + +[[package]] +name = "memmap" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" +dependencies = [ + "libc", + "winapi 0.3.8", +] + +[[package]] +name = "memoffset" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" +dependencies = [ + "autocfg 1.0.0", +] + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "miniz_oxide" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" +dependencies = [ + "adler32", +] + +[[package]] +name = "mio" +version = "0.6.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" +dependencies = [ + "cfg-if", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow", + "net2", + "slab", + "winapi 0.2.8", +] + +[[package]] +name = "mio-extras" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" +dependencies = [ + "lazycell", + "log", + "mio", + "slab", +] + +[[package]] +name = "mio-uds" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" +dependencies = [ + "iovec", + "libc", + "mio", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "murmurhash32" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d736ff882f0e85fe9689fb23db229616c4c00aee2b3ac282f666d8f20eb25d4a" +dependencies = [ + "byteorder", +] + +[[package]] +name = "net2" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" +dependencies = [ + "cfg-if", + "libc", + "winapi 0.3.8", +] + +[[package]] +name = "nix" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" +dependencies = [ + "bitflags", + "cc", + "cfg-if", + "libc", + "void", +] + +[[package]] +name = "notify" +version = "4.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80ae4a7688d1fab81c5bf19c64fc8db920be8d519ce6336ed4e7efe024724dbd" +dependencies = [ + "bitflags", + "filetime", + "fsevent", + "fsevent-sys", + "inotify", + "libc", + "mio", + "mio-extras", + "walkdir", + "winapi 0.3.8", +] + +[[package]] +name = "num-integer" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" +dependencies = [ + "autocfg 1.0.0", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +dependencies = [ + "autocfg 1.0.0", +] + +[[package]] +name = "num_cpus" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c601810575c99596d4afc46f78a678c80105117c379eb3650cf99b8a21ce5b" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "owned-read" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66d1e235abcebc845cf93550b89b74f468c051496fafb433ede4104b9f71ba1" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "owning_ref" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "parking_lot" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" +dependencies = [ + "cfg-if", + "cloudabi", + "libc", + "redox_syscall", + "smallvec", + "winapi 0.3.8", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pest" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +dependencies = [ + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pest_meta" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" +dependencies = [ + "maplit", + "pest", + "sha-1", +] + +[[package]] +name = "pin-project" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36e3dcd42688c05a66f841d22c5d8390d9a5d4c9aaf57b9285eae4900a080063" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4d7346ac577ff1296e06a418e7618e22655bae834d4970cb6e39d6da8119969" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "ppv-lite86" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" + +[[package]] +name = "proc-macro-hack" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d659fe7c6d27f25e9d80a1a094c223f5246f6a6596453e09d7229bf42750b63" + +[[package]] +name = "proc-macro-nested" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e946095f9d3ed29ec38de908c22f95d9ac008e424c7bcae54c75a79c527c694" + +[[package]] +name = "proc-macro2" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8872cf6f48eee44265156c111456a700ab3483686b3f96df4cf5481c89157319" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c1f4b0efa5fc5e8ceb705136bfee52cfdb6a4e3509f770b478cd6ed434232a7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +dependencies = [ + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "rdrand", + "winapi 0.3.8", +] + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +dependencies = [ + "autocfg 0.1.7", + "libc", + "rand_chacha 0.1.1", + "rand_core 0.4.2", + "rand_hc 0.1.0", + "rand_isaac", + "rand_jitter", + "rand_os", + "rand_pcg", + "rand_xorshift", + "winapi 0.3.8", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +dependencies = [ + "autocfg 0.1.7", + "rand_core 0.3.1", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +dependencies = [ + "libc", + "rand_core 0.4.2", + "winapi 0.3.8", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +dependencies = [ + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.4.2", + "rdrand", + "winapi 0.3.8", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +dependencies = [ + "autocfg 0.1.7", + "rand_core 0.4.2", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rayon" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" +dependencies = [ + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" +dependencies = [ + "crossbeam-deque", + "crossbeam-queue", + "crossbeam-utils", + "lazy_static", + "num_cpus", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "redox_syscall" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" + +[[package]] +name = "regex" +version = "1.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6020f034922e3194c711b82a627453881bc4682166cabb07134a10c26ba7692" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.6.17", + "thread_local", +] + +[[package]] +name = "regex-syntax" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e931c58b93d86f080c734bfd2bce7dd0079ae2331235818133c8be7f422e20e" + +[[package]] +name = "regex-syntax" +version = "0.6.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" + +[[package]] +name = "remove_dir_all" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +dependencies = [ + "winapi 0.3.8", +] + +[[package]] +name = "resolv-conf" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11834e137f3b14e309437a8276714eed3a80d1ef894869e510f2c0c0b98b9f4a" +dependencies = [ + "hostname", + "quick-error", +] + +[[package]] +name = "rust-stemmers" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e46a2036019fdb888131db7a4c847a1063a7493f971ed94ea82c67eada63ca54" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" + +[[package]] +name = "ryu" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3d612bc64430efeb3f7ee6ef26d590dce0c43249217bddc62112540c7941e1" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "serde" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eba7550f2cdf88ffc23ab0f1607133486c390a8c0f89b57e589b9654ee15e04d" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10be45e22e5597d4b88afcc71f9d7bfadcd604bf0c78a3ab4582b8d2b37f39f3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7894c8ed05b7a3a279aeb79025fdec1d3158080b75b98a08faf2806bb799edd" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" +dependencies = [ + "dtoa", + "itoa", + "serde", + "url", +] + +[[package]] +name = "sha-1" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +dependencies = [ + "block-buffer", + "digest", + "fake-simd", + "opaque-debug", +] + +[[package]] +name = "sha1" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" + +[[package]] +name = "signal-hook-registry" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" +dependencies = [ + "arc-swap", + "libc", +] + +[[package]] +name = "slab" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" + +[[package]] +name = "smallvec" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" + +[[package]] +name = "snap" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fb9b0bb877b35a1cc1474a3b43d9c226a2625311760cdda2cbccbc0c7a8376" + +[[package]] +name = "socket2" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "winapi 0.3.8", +] + +[[package]] +name = "stable_deref_trait" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" + +[[package]] +name = "syn" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "410a7488c0a728c7ceb4ad59b9567eb4053d02e8cc7f5c0e0eeeb39518369213" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "synstructure" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "tantivy" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e1d2fbfa82ab829208e5f03f4d2c177b8a126252ab4f80ed232e1064770efb" +dependencies = [ + "atomicwrites", + "base64", + "bitpacking", + "byteorder", + "census", + "chrono", + "crc32fast", + "crossbeam", + "downcast-rs", + "fail", + "failure", + "fnv", + "fs2", + "futures", + "htmlescape", + "itertools", + "levenshtein_automata", + "log", + "memmap", + "murmurhash32", + "notify", + "num_cpus", + "once_cell", + "owned-read", + "owning_ref", + "rayon", + "regex", + "rust-stemmers", + "serde", + "serde_derive", + "serde_json", + "smallvec", + "snap", + "stable_deref_trait", + "tantivy-fst", + "tantivy-query-grammar", + "tempfile", + "uuid", + "winapi 0.3.8", +] + +[[package]] +name = "tantivy-fst" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38878efb477cf2efb7d9112b12b230c27d32abdfec4bea5e66095733f2928610" +dependencies = [ + "byteorder", + "levenshtein_automata", + "regex-syntax 0.4.2", + "utf8-ranges", +] + +[[package]] +name = "tantivy-query-grammar" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900f098da37d350b0e8f116791b9ee43e600704cb6b5cc83b7f826d1b119f21c" +dependencies = [ + "combine", +] + +[[package]] +name = "tempdir" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" +dependencies = [ + "rand 0.4.6", + "remove_dir_all", +] + +[[package]] +name = "tempfile" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +dependencies = [ + "cfg-if", + "libc", + "rand 0.7.3", + "redox_syscall", + "remove_dir_all", + "winapi 0.3.8", +] + +[[package]] +name = "thread_local" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "threadpool" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8dae184447c15d5a6916d973c642aec485105a13cd238192a6927ae3e077d66" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "time" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +dependencies = [ + "libc", + "winapi 0.3.8", +] + +[[package]] +name = "tokio" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c1d570eb1a36f0345a5ce9c6c6e665b70b73d11236912c0b477616aeec47b1" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "iovec", + "lazy_static", + "libc", + "memchr", + "mio", + "mio-uds", + "pin-project-lite", + "signal-hook-registry", + "slab", + "winapi 0.3.8", +] + +[[package]] +name = "tokio-util" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "trust-dns-proto" +version = "0.18.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a7f3a2ab8a919f5eca52a468866a67ed7d3efa265d48a652a9a3452272b413f" +dependencies = [ + "async-trait", + "enum-as-inner", + "failure", + "futures", + "idna", + "lazy_static", + "log", + "rand 0.7.3", + "smallvec", + "socket2", + "tokio", + "url", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.18.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f90b1502b226f8b2514c6d5b37bafa8c200d7ca4102d57dc36ee0f3b7a04a2f" +dependencies = [ + "cfg-if", + "failure", + "futures", + "ipconfig", + "lazy_static", + "log", + "lru-cache", + "resolv-conf", + "smallvec", + "tokio", + "trust-dns-proto", +] + +[[package]] +name = "typenum" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" + +[[package]] +name = "ucd-trie" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" + +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +dependencies = [ + "matches", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" +dependencies = [ + "smallvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" + +[[package]] +name = "unicode-xid" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" + +[[package]] +name = "url" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +dependencies = [ + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "utf8-ranges" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ae116fef2b7fea257ed6440d3cfcff7f190865f170cdad00bb6465bf18ecba" + +[[package]] +name = "uuid" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" +dependencies = [ + "rand 0.7.3", + "serde", +] + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "walkdir" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +dependencies = [ + "same-file", + "winapi 0.3.8", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "widestring" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "effc0e4ff8085673ea7b9b2e3c73f6bd4d118810c9009ed8f1e16bd96c331db6" + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + +[[package]] +name = "winapi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi 0.3.8", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "winreg" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" +dependencies = [ + "winapi 0.3.8", +] + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 000000000..2844a81c7 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "fabricate" +version = "0.1.0" +authors = ["geometrically "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +actix-web = "2.0" +actix-rt = "1.1.1" +handlebars = { version = "3.0.0", features = ["dir_source"] } +serde_json = "1.0" +serde_derive = "1.0.107" +serde = "1.0.107" +tantivy = "0.12.0" +tempdir = "0.3.7" + diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 000000000..ec69638a6 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,159 @@ +#[macro_use] +extern crate serde_json; + +#[macro_use] +extern crate tantivy; + +use actix_web::{web, web::Data, web::Query, App, HttpRequest, HttpResponse, HttpServer, Responder, get, post}; +use handlebars::Handlebars; +use serde_derive::Deserialize; + +use tantivy::collector::TopDocs; +use tantivy::query::{QueryParser}; +use tantivy::schema::*; +use tantivy::{Index, IndexReader}; +use tantivy::ReloadPolicy; +use tempdir::TempDir; + +#[derive(Deserialize)] +pub struct SearchRequest { + q: Option, +} + +#[post("search")] +async fn search_post(Query(info): Query, reader: Data, parser: Data>, schema: Data>) -> HttpResponse { + let results = handle_search(Query(info), reader, parser, schema); + + let mut data = "{ \"results\": [".to_owned(); + + for result in &results { + data.push_str(&result); + data.push_str(","); + } + + if &results.len() > &(0 as usize) { + data.pop(); + } + + data.push_str("] }"); + + HttpResponse::Ok().body(data) +} + +#[get("search")] +async fn search(Query(info): Query, hb: Data>, reader: Data, parser: Data>, schema: Data>) -> HttpResponse { + let results = handle_search(Query(info), reader, parser, schema); + + let data = json!({ + "results": results, + }); + + let body = hb.render("search", &data).unwrap(); + + HttpResponse::Ok().body(body) +} + +fn handle_search(Query(info): Query, reader: Data, parser: Data>, schema: Data>) -> Vec{ + let mut search_query : String = "".to_string(); + + if let Some(q) = info.q { + search_query = q; + } + + let searcher = reader.searcher(); + + let mut results = vec![]; + + if let Ok(query) = parser.parse_query(&search_query) { + if let Ok(top_docs) = searcher.search(&query, &TopDocs::with_limit(10)) { + for (_score, doc_address) in top_docs { + if let Ok(retrieved_doc) = searcher.doc(doc_address) { + results.push(schema.to_json(&retrieved_doc)); + } + } + } + } + + return results; +} + +#[get("/")] +async fn index(hb: web::Data>) -> HttpResponse { + let data = json!({ + "name": "Handlebars" + }); + let body = hb.render("index", &data).unwrap(); + + HttpResponse::Ok().body(body) +} + +#[actix_rt::main] +async fn main() -> tantivy::Result<()> { + //Handlebars + let mut handlebars = Handlebars::new(); + handlebars + .register_templates_directory(".html", "./static/templates") + .unwrap(); + let handlebars_ref = web::Data::new(handlebars); + + //Search + let index_path = TempDir::new("search_index")?; + + let mut schema_builder = Schema::builder(); + + schema_builder.add_text_field("title", TEXT | STORED); + schema_builder.add_text_field("keywords", TEXT | STORED); + schema_builder.add_text_field("description", TEXT | STORED); + schema_builder.add_text_field("body", TEXT); + + let schema = schema_builder.build(); + let schema_ref = web::Data::new(schema.clone()); + + let title = schema.get_field("title").unwrap(); + let keywords = schema.get_field("keywords").unwrap(); + let description = schema.get_field("description").unwrap(); + let body = schema.get_field("body").unwrap(); + + let site_index = Index::create_in_dir(&index_path, schema.clone())?; + let mut index_writer = site_index.writer(50_000_000)?; + + index_writer.add_document(doc!( + title => "Magic", + keywords => "Magic Fun Adventure", + description => "A magic mod for magical purposes!", + body => "A cool magic mod made by your mom :)", + )); + + index_writer.add_document(doc!( + title => "Technology", + keywords => "Technology Fun Adventure", + description => "A tech mod for tech purposes!", + body => "A tech mod made by your mom :)", + )); + + index_writer.commit()?; + + let reader = site_index.reader_builder().reload_policy(ReloadPolicy::OnCommit).try_into()?; + let reader_ref = web::Data::new(reader); + + let query_parser = QueryParser::for_index(&site_index, vec![title, body, keywords, description]); + let query_parser_ref = web::Data::new(query_parser); + + //Init App + HttpServer::new(move || { + App::new() + .app_data(handlebars_ref.clone()) + .app_data(reader_ref.clone()) + .app_data(query_parser_ref.clone()) + .app_data(schema_ref.clone()) + .service(index) + .service(search) + .service(search_post) + }) + .bind("127.0.0.1:8000")? + .run() + .await?; + + Ok(()) +} + diff --git a/static/templates/index.html b/static/templates/index.html new file mode 100644 index 000000000..24aa9811b --- /dev/null +++ b/static/templates/index.html @@ -0,0 +1,12 @@ + + + + + {{name}} Example + + + +

{{name}} example

+

This is an example of how to use {{name}} with Actix-Web.

+ + \ No newline at end of file diff --git a/static/templates/search.html b/static/templates/search.html new file mode 100644 index 000000000..c2060d258 --- /dev/null +++ b/static/templates/search.html @@ -0,0 +1,38 @@ + + + + + Search + + + +

Test Mod Search

+
+ + +
+ +

{{results}}

+ + + + + \ No newline at end of file From 6be22c474d58e2d402b6f7c31cc3f16c029a9bb0 Mon Sep 17 00:00:00 2001 From: Jai A Date: Sun, 10 May 2020 22:30:28 -0700 Subject: [PATCH 002/615] Working Search --- .idea/inspectionProfiles/Project_Default.xml | 21 + Cargo.lock | 750 +++--------------- Cargo.toml | 7 +- src/main.rs | 158 ++-- static/css/multiselect.css | 122 +++ static/css/style.css | 48 ++ static/js/multiselect.min.js | 44 + static/js/search.js | 32 + static/templates/search.html | 38 - .../index.html => templates/index.hbs | 0 templates/search.hbs | 51 ++ 11 files changed, 500 insertions(+), 771 deletions(-) create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 static/css/multiselect.css create mode 100644 static/css/style.css create mode 100644 static/js/multiselect.min.js create mode 100644 static/js/search.js delete mode 100644 static/templates/search.html rename static/templates/index.html => templates/index.hbs (100%) create mode 100644 templates/search.hbs diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 000000000..72d2ffd09 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,21 @@ + + + + \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 33e88a2c9..c674092b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,6 +34,26 @@ dependencies = [ "trust-dns-resolver", ] +[[package]] +name = "actix-files" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301482841d3d74483a446ead63cb7d362e187d2c8b603f13d91995621ea53c46" +dependencies = [ + "actix-http", + "actix-service", + "actix-web", + "bitflags", + "bytes", + "derive_more", + "futures", + "log", + "mime", + "mime_guess", + "percent-encoding", + "v_htmlescape", +] + [[package]] name = "actix-http" version = "1.0.1" @@ -71,7 +91,7 @@ dependencies = [ "mime", "percent-encoding", "pin-project", - "rand 0.7.3", + "rand", "regex", "serde", "serde_json", @@ -291,23 +311,6 @@ dependencies = [ "syn", ] -[[package]] -name = "atomicwrites" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a2baf2feb820299c53c7ad1cc4f5914a220a1cb76d7ce321d2522a94b54651f" -dependencies = [ - "nix", - "tempdir", - "winapi 0.3.8", -] - -[[package]] -name = "autocfg" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" - [[package]] name = "autocfg" version = "1.0.0" @@ -331,7 +334,7 @@ dependencies = [ "log", "mime", "percent-encoding", - "rand 0.7.3", + "rand", "serde", "serde_json", "serde_urlencoded", @@ -371,15 +374,6 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" -[[package]] -name = "bitpacking" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3744aff20a3437a99ebc0bb7733e9e60c7bf590478c9b897e95b38d57e5acb68" -dependencies = [ - "crunchy", -] - [[package]] name = "block-buffer" version = "0.7.3" @@ -454,12 +448,6 @@ version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3d87b23d6a92cd03af510a5ade527033f6aa6fa92161e2d5863a907d4c5e31d" -[[package]] -name = "census" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5927edd8345aef08578bcbb4aea7314f340d80c7f4931f99fbeb40b99d8f5060" - [[package]] name = "cfg-if" version = "0.1.10" @@ -486,16 +474,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "combine" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d79eb8c0bfd05a68f8b6195b27c4f2e042f86d52da032817f89a3847e0495ed" -dependencies = [ - "bytes", - "memchr", -] - [[package]] name = "copyless" version = "0.1.4" @@ -511,83 +489,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" -dependencies = [ - "cfg-if", - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-epoch", - "crossbeam-queue", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-channel" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cced8691919c02aac3cb0a1bc2e9b73d89e832bf9a06fc579d4e71b68a2da061" -dependencies = [ - "crossbeam-utils", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-deque" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" -dependencies = [ - "autocfg 1.0.0", - "cfg-if", - "crossbeam-utils", - "lazy_static", - "maybe-uninit", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-queue" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" -dependencies = [ - "autocfg 1.0.0", - "cfg-if", - "lazy_static", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - [[package]] name = "derive_more" version = "0.99.5" @@ -608,12 +509,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "downcast-rs" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba6eb47c2131e784a38b726eb54c1e1484904f013e576a25354d0124161af6" - [[package]] name = "dtoa" version = "0.4.5" @@ -651,25 +546,14 @@ dependencies = [ name = "fabricate" version = "0.1.0" dependencies = [ + "actix-files", "actix-rt", "actix-web", "handlebars", + "meilisearch-sdk", "serde", "serde_derive", "serde_json", - "tantivy", - "tempdir", -] - -[[package]] -name = "fail" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63eec71a3013ee912a0ecb339ff0c5fa5ed9660df04bfefa10c250b885d018c" -dependencies = [ - "lazy_static", - "log", - "rand 0.6.5", ] [[package]] @@ -700,18 +584,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" -[[package]] -name = "filetime" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "affc17579b132fc2461adf7c575cc6e8b134ebca52c51f5411388965227dc695" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "winapi 0.3.8", -] - [[package]] name = "flate2" version = "1.0.14" @@ -730,50 +602,6 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi 0.3.8", -] - -[[package]] -name = "fsevent" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" -dependencies = [ - "bitflags", - "fsevent-sys", -] - -[[package]] -name = "fsevent-sys" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" -dependencies = [ - "libc", -] - -[[package]] -name = "fst" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927fb434ff9f0115b215dc0efd2e4fbdd7448522a92a1aa37c77d6a2f8f1ebd6" -dependencies = [ - "byteorder", -] - -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "fuchsia-zircon" version = "0.3.3" @@ -830,7 +658,6 @@ dependencies = [ "futures-core", "futures-task", "futures-util", - "num_cpus", ] [[package]] @@ -974,12 +801,6 @@ dependencies = [ "winapi 0.3.8", ] -[[package]] -name = "htmlescape" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" - [[package]] name = "http" version = "0.2.1" @@ -1014,27 +835,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" dependencies = [ - "autocfg 1.0.0", -] - -[[package]] -name = "inotify" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24e40d6fd5d64e2082e0c796495c8ef5ad667a96d03e5aaa0becfd9d47bcbfb8" -dependencies = [ - "bitflags", - "inotify-sys", - "libc", -] - -[[package]] -name = "inotify-sys" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" -dependencies = [ - "libc", + "autocfg", ] [[package]] @@ -1058,15 +859,6 @@ dependencies = [ "winreg", ] -[[package]] -name = "itertools" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "0.4.5" @@ -1095,21 +887,6 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "lazycell" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" - -[[package]] -name = "levenshtein_automata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73a004f877f468548d8d0ac4977456a249d8fabbdb8416c36db163dfc8f2e8ca" -dependencies = [ - "fst", -] - [[package]] name = "libc" version = "0.2.69" @@ -1168,10 +945,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] -name = "maybe-uninit" -version = "2.0.0" +name = "meilisearch-sdk" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +checksum = "6873f8f9b90d8d451bf6e8af732ee1536a5fb69488eeef7fee4eda79ea0369fe" +dependencies = [ + "log", + "minreq", + "serde", + "serde_json", + "urlencoding", +] [[package]] name = "memchr" @@ -1180,30 +964,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" [[package]] -name = "memmap" -version = "0.7.0" +name = "mime" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" -dependencies = [ - "libc", - "winapi 0.3.8", -] +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] -name = "memoffset" -version = "0.5.4" +name = "mime_guess" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" +checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" dependencies = [ - "autocfg 1.0.0", + "mime", + "unicase", ] -[[package]] -name = "mime" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" - [[package]] name = "miniz_oxide" version = "0.3.6" @@ -1213,6 +988,12 @@ dependencies = [ "adler32", ] +[[package]] +name = "minreq" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11e4ea61052e3c3cced75e02c69d0a360e4a50149fab6ada11258756037d45a4" + [[package]] name = "mio" version = "0.6.22" @@ -1232,18 +1013,6 @@ dependencies = [ "winapi 0.2.8", ] -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio", - "slab", -] - [[package]] name = "mio-uds" version = "0.6.8" @@ -1267,15 +1036,6 @@ dependencies = [ "ws2_32-sys", ] -[[package]] -name = "murmurhash32" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d736ff882f0e85fe9689fb23db229616c4c00aee2b3ac282f666d8f20eb25d4a" -dependencies = [ - "byteorder", -] - [[package]] name = "net2" version = "0.2.34" @@ -1288,34 +1048,13 @@ dependencies = [ ] [[package]] -name = "nix" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" -dependencies = [ - "bitflags", - "cc", - "cfg-if", - "libc", - "void", -] - -[[package]] -name = "notify" -version = "4.0.15" +name = "nom" +version = "4.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80ae4a7688d1fab81c5bf19c64fc8db920be8d519ce6336ed4e7efe024724dbd" +checksum = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" dependencies = [ - "bitflags", - "filetime", - "fsevent", - "fsevent-sys", - "inotify", - "libc", - "mio", - "mio-extras", - "walkdir", - "winapi 0.3.8", + "memchr", + "version_check 0.1.5", ] [[package]] @@ -1324,7 +1063,7 @@ version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" dependencies = [ - "autocfg 1.0.0", + "autocfg", "num-traits", ] @@ -1334,7 +1073,7 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" dependencies = [ - "autocfg 1.0.0", + "autocfg", ] [[package]] @@ -1347,36 +1086,12 @@ dependencies = [ "libc", ] -[[package]] -name = "once_cell" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c601810575c99596d4afc46f78a678c80105117c379eb3650cf99b8a21ce5b" - [[package]] name = "opaque-debug" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" -[[package]] -name = "owned-read" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66d1e235abcebc845cf93550b89b74f468c051496fafb433ede4104b9f71ba1" -dependencies = [ - "stable_deref_trait", -] - -[[package]] -name = "owning_ref" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" -dependencies = [ - "stable_deref_trait", -] - [[package]] name = "parking_lot" version = "0.10.2" @@ -1524,38 +1239,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi 0.3.8", -] - -[[package]] -name = "rand" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -dependencies = [ - "autocfg 0.1.7", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc 0.1.0", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg", - "rand_xorshift", - "winapi 0.3.8", -] - [[package]] name = "rand" version = "0.7.3" @@ -1564,19 +1247,9 @@ checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ "getrandom", "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc 0.2.0", -] - -[[package]] -name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.3.1", + "rand_chacha", + "rand_core", + "rand_hc", ] [[package]] @@ -1586,24 +1259,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", + "rand_core", ] -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - [[package]] name = "rand_core" version = "0.5.1" @@ -1613,108 +1271,13 @@ dependencies = [ "getrandom", ] -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "rand_hc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi 0.3.8", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi 0.3.8", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rayon" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" -dependencies = [ - "crossbeam-deque", - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" -dependencies = [ - "crossbeam-deque", - "crossbeam-queue", - "crossbeam-utils", - "lazy_static", - "num_cpus", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", + "rand_core", ] [[package]] @@ -1731,31 +1294,16 @@ checksum = "a6020f034922e3194c711b82a627453881bc4682166cabb07134a10c26ba7692" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.6.17", + "regex-syntax", "thread_local", ] -[[package]] -name = "regex-syntax" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e931c58b93d86f080c734bfd2bce7dd0079ae2331235818133c8be7f422e20e" - [[package]] name = "regex-syntax" version = "0.6.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" -[[package]] -name = "remove_dir_all" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" -dependencies = [ - "winapi 0.3.8", -] - [[package]] name = "resolv-conf" version = "0.6.3" @@ -1766,16 +1314,6 @@ dependencies = [ "quick-error", ] -[[package]] -name = "rust-stemmers" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e46a2036019fdb888131db7a4c847a1063a7493f971ed94ea82c67eada63ca54" -dependencies = [ - "serde", - "serde_derive", -] - [[package]] name = "rustc-demangle" version = "0.1.16" @@ -1886,12 +1424,6 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" -[[package]] -name = "snap" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fb9b0bb877b35a1cc1474a3b43d9c226a2625311760cdda2cbccbc0c7a8376" - [[package]] name = "socket2" version = "0.3.12" @@ -1904,12 +1436,6 @@ dependencies = [ "winapi 0.3.8", ] -[[package]] -name = "stable_deref_trait" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" - [[package]] name = "syn" version = "1.0.18" @@ -1933,98 +1459,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "tantivy" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e1d2fbfa82ab829208e5f03f4d2c177b8a126252ab4f80ed232e1064770efb" -dependencies = [ - "atomicwrites", - "base64", - "bitpacking", - "byteorder", - "census", - "chrono", - "crc32fast", - "crossbeam", - "downcast-rs", - "fail", - "failure", - "fnv", - "fs2", - "futures", - "htmlescape", - "itertools", - "levenshtein_automata", - "log", - "memmap", - "murmurhash32", - "notify", - "num_cpus", - "once_cell", - "owned-read", - "owning_ref", - "rayon", - "regex", - "rust-stemmers", - "serde", - "serde_derive", - "serde_json", - "smallvec", - "snap", - "stable_deref_trait", - "tantivy-fst", - "tantivy-query-grammar", - "tempfile", - "uuid", - "winapi 0.3.8", -] - -[[package]] -name = "tantivy-fst" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38878efb477cf2efb7d9112b12b230c27d32abdfec4bea5e66095733f2928610" -dependencies = [ - "byteorder", - "levenshtein_automata", - "regex-syntax 0.4.2", - "utf8-ranges", -] - -[[package]] -name = "tantivy-query-grammar" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900f098da37d350b0e8f116791b9ee43e600704cb6b5cc83b7f826d1b119f21c" -dependencies = [ - "combine", -] - -[[package]] -name = "tempdir" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -dependencies = [ - "rand 0.4.6", - "remove_dir_all", -] - -[[package]] -name = "tempfile" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" -dependencies = [ - "cfg-if", - "libc", - "rand 0.7.3", - "redox_syscall", - "remove_dir_all", - "winapi 0.3.8", -] - [[package]] name = "thread_local" version = "1.0.1" @@ -2115,7 +1549,7 @@ dependencies = [ "idna", "lazy_static", "log", - "rand 0.7.3", + "rand", "smallvec", "socket2", "tokio", @@ -2153,6 +1587,15 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check 0.9.1", +] + [[package]] name = "unicode-bidi" version = "0.3.4" @@ -2195,26 +1638,53 @@ dependencies = [ ] [[package]] -name = "utf8-ranges" -version = "1.0.4" +name = "urlencoding" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ae116fef2b7fea257ed6440d3cfcff7f190865f170cdad00bb6465bf18ecba" +checksum = "3df3561629a8bb4c57e5a2e4c43348d9e29c7c29d9b1c4c1f47166deca8f37ed" [[package]] -name = "uuid" -version = "0.8.1" +name = "v_escape" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" +checksum = "660b101c07b5d0863deb9e7fb3138777e858d6d2a79f9e6049a27d1cc77c6da6" dependencies = [ - "rand 0.7.3", - "serde", + "v_escape_derive", ] [[package]] -name = "void" -version = "1.0.2" +name = "v_escape_derive" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2ca2a14bc3fc5b64d188b087a7d3a927df87b152e941ccfbc66672e20c467ae" +dependencies = [ + "nom", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "v_htmlescape" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33e939c0d8cf047514fb6ba7d5aac78bc56677a6938b2ee67000b91f2e97e41" +dependencies = [ + "cfg-if", + "v_escape", +] + +[[package]] +name = "version_check" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" + +[[package]] +name = "version_check" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" [[package]] name = "walkdir" diff --git a/Cargo.toml b/Cargo.toml index 2844a81c7..473513ee0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,6 @@ actix-rt = "1.1.1" handlebars = { version = "3.0.0", features = ["dir_source"] } serde_json = "1.0" serde_derive = "1.0.107" -serde = "1.0.107" -tantivy = "0.12.0" -tempdir = "0.3.7" - +serde = {version="1.0", features=["derive"]} +meilisearch-sdk = "0.1.1" +actix-files = "0.2.1" diff --git a/src/main.rs b/src/main.rs index ec69638a6..39b95bebf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,48 +1,48 @@ #[macro_use] extern crate serde_json; -#[macro_use] -extern crate tantivy; - -use actix_web::{web, web::Data, web::Query, App, HttpRequest, HttpResponse, HttpServer, Responder, get, post}; +use actix_web::{web, web::Data, App, HttpRequest, HttpResponse, HttpServer, Responder, get, post}; use handlebars::Handlebars; -use serde_derive::Deserialize; +use meilisearch_sdk::{document::*, indexes::*, client::*, search::*}; +use serde::{Serialize, Deserialize}; +use actix_files as fs; + +#[derive(Serialize, Deserialize, Debug)] +struct Mod { + mod_id: usize, + title: String, + description: String, +} + +impl Document for Mod { + type UIDType = usize; + + fn get_uid(&self) -> &Self::UIDType { + &self.mod_id + } +} -use tantivy::collector::TopDocs; -use tantivy::query::{QueryParser}; -use tantivy::schema::*; -use tantivy::{Index, IndexReader}; -use tantivy::ReloadPolicy; -use tempdir::TempDir; #[derive(Deserialize)] pub struct SearchRequest { q: Option, + f: Option, } #[post("search")] -async fn search_post(Query(info): Query, reader: Data, parser: Data>, schema: Data>) -> HttpResponse { - let results = handle_search(Query(info), reader, parser, schema); +async fn search_post(web::Query(info): web::Query) -> HttpResponse { + let results = search(web::Query(info)); - let mut data = "{ \"results\": [".to_owned(); - - for result in &results { - data.push_str(&result); - data.push_str(","); - } - - if &results.len() > &(0 as usize) { - data.pop(); - } - - data.push_str("] }"); + let data = json!({ + "results": results, + }); HttpResponse::Ok().body(data) } #[get("search")] -async fn search(Query(info): Query, hb: Data>, reader: Data, parser: Data>, schema: Data>) -> HttpResponse { - let results = handle_search(Query(info), reader, parser, schema); +async fn search_get(web::Query(info): web::Query, hb: Data>) -> HttpResponse { + let results = search(web::Query(info)); let data = json!({ "results": results, @@ -53,28 +53,27 @@ async fn search(Query(info): Query, hb: Data>, rea HttpResponse::Ok().body(body) } -fn handle_search(Query(info): Query, reader: Data, parser: Data>, schema: Data>) -> Vec{ - let mut search_query : String = "".to_string(); +fn search(web::Query(info): web::Query) -> Vec { + let client = Client::new("http://localhost:7700", ""); + + let mut search_query = "".to_string(); + let mut filters = "".to_string(); if let Some(q) = info.q { search_query = q; } - let searcher = reader.searcher(); + if let Some(f) = info.f { + filters = f; + } - let mut results = vec![]; + let mut query = Query::new(&search_query).with_limit(10); - if let Ok(query) = parser.parse_query(&search_query) { - if let Ok(top_docs) = searcher.search(&query, &TopDocs::with_limit(10)) { - for (_score, doc_address) in top_docs { - if let Ok(retrieved_doc) = searcher.doc(doc_address) { - results.push(schema.to_json(&retrieved_doc)); - } - } - } + if !filters.is_empty() { + query = Query::new(&search_query).with_limit(10).with_filters(&filters); } - return results; + client.get_index("mods").unwrap().search::(&query).unwrap().hits } #[get("/")] @@ -88,72 +87,53 @@ async fn index(hb: web::Data>) -> HttpResponse { } #[actix_rt::main] -async fn main() -> tantivy::Result<()> { +async fn main() -> std::io::Result<()> { //Handlebars let mut handlebars = Handlebars::new(); handlebars - .register_templates_directory(".html", "./static/templates") + .register_templates_directory(".hbs", "./templates") .unwrap(); let handlebars_ref = web::Data::new(handlebars); //Search - let index_path = TempDir::new("search_index")?; - - let mut schema_builder = Schema::builder(); - - schema_builder.add_text_field("title", TEXT | STORED); - schema_builder.add_text_field("keywords", TEXT | STORED); - schema_builder.add_text_field("description", TEXT | STORED); - schema_builder.add_text_field("body", TEXT); - - let schema = schema_builder.build(); - let schema_ref = web::Data::new(schema.clone()); - - let title = schema.get_field("title").unwrap(); - let keywords = schema.get_field("keywords").unwrap(); - let description = schema.get_field("description").unwrap(); - let body = schema.get_field("body").unwrap(); - let site_index = Index::create_in_dir(&index_path, schema.clone())?; - let mut index_writer = site_index.writer(50_000_000)?; - - index_writer.add_document(doc!( - title => "Magic", - keywords => "Magic Fun Adventure", - description => "A magic mod for magical purposes!", - body => "A cool magic mod made by your mom :)", - )); - - index_writer.add_document(doc!( - title => "Technology", - keywords => "Technology Fun Adventure", - description => "A tech mod for tech purposes!", - body => "A tech mod made by your mom :)", - )); - - index_writer.commit()?; - - let reader = site_index.reader_builder().reload_policy(ReloadPolicy::OnCommit).try_into()?; - let reader_ref = web::Data::new(reader); - - let query_parser = QueryParser::for_index(&site_index, vec![title, body, keywords, description]); - let query_parser_ref = web::Data::new(query_parser); + let client = Client::new("http://localhost:7700", ""); + let mut mods = client.get_or_create("mods").unwrap(); + + mods.add_documents(vec![ + Mod { + mod_id: 0, + title: String::from("Magic Mod"), + description: String::from("An illustrious magic mod for magical wizards"), + }, + Mod { + mod_id: 1, + title: String::from("Tech Mod"), + description: String::from("An technological mod for complete NERDS"), + }, + Mod { + mod_id: 2, + title: String::from("Hood Mod"), + description: String::from("A hood mod to roleplay as if you were a real street person. Some adventure stuff too"), + }, + Mod { + mod_id: 3, + title: String::from("Adventure Mod"), + description: String::from("An epic gamer adventure mod for epic adventure gamers"), + }, + ], Some("mod_id")).unwrap(); //Init App HttpServer::new(move || { App::new() .app_data(handlebars_ref.clone()) - .app_data(reader_ref.clone()) - .app_data(query_parser_ref.clone()) - .app_data(schema_ref.clone()) + .service(fs::Files::new("/static", "./static").show_files_listing()) .service(index) - .service(search) + .service(search_get) .service(search_post) }) .bind("127.0.0.1:8000")? .run() - .await?; - - Ok(()) + .await } diff --git a/static/css/multiselect.css b/static/css/multiselect.css new file mode 100644 index 000000000..5d9c5f5e5 --- /dev/null +++ b/static/css/multiselect.css @@ -0,0 +1,122 @@ +.multiselect-wrapper { + width: 180px; + display: inline-block; + white-space: nowrap; + font-size: 12px; + font-family: "Segoe UI", Verdana, Helvetica, Sans-Serif; +} + +.multiselect-wrapper .multiselect-input { + width: 100%; + padding-right: 50px; +} + +.multiselect-wrapper label { + display: block; + font-size: 12px; + font-weight : 600; +} + +.multiselect-wrapper .multiselect-list { + z-index: 1; + position: absolute; + display: none; + background-color: white; + border: 1px solid grey; + border-bottom-left-radius: 2px; + border-bottom-right-radius: 2px; + margin-top: -2px; +} + +.multiselect-wrapper .multiselect-list.active { + display: block; +} + +.multiselect-wrapper .multiselect-list > span { + font-weight: bold; +} + +.multiselect-wrapper .multiselect-list .multiselect-checkbox { + margin-right: 2px; +} + +.multiselect-wrapper .multiselect-list > span, +.multiselect-wrapper .multiselect-list li { + cursor: default; +} + +.multiselect-wrapper .multiselect-list { + padding: 5px; + min-width: 200px; +} + +.multiselect-wrapper ul { + list-style: none; + display: block; + position: relative; + padding: 0px; + margin: 0px; + max-height: 200px; + overflow-y: auto; + overflow-x: hidden; +} + +.multiselect-wrapper ul li { + padding-right: 20px; + display: block; +} + +.multiselect-wrapper ul li.active { + background-color: rgb(0, 102, 255); + color: white; +} + +.multiselect-wrapper ul li:hover { + background-color: rgb(0, 102, 255); + color: white; +} + +.multiselect-input-div { + height: 34px; +} + +.multiselect-input-div input{ + border: 1px solid #ababab; + background : #fff; + margin: 5px 0 6px 0; + padding: 5px; + vertical-align:middle; +} + +.multiselect-count { + position: relative; + text-align: center; + border-radius: 2px; + background-color: lightblue; + display: inline-block !important; + padding: 2px 7px; + left: -45px; +} + +.multiselect-wrapper.disabled .multiselect-dropdown-arrow { + border-top: 5px solid lightgray; +} + +.multiselect-wrapper.disabled .multiselect-count { + background-color: lightgray; +} + +.multiselect-dropdown-arrow { + width: 0; + height: 0; + border-left: 5px solid transparent; + border-right: 5px solid transparent; + border-top: 5px solid black; + position: absolute; + line-height: 20px; + text-align: center; + display: inline-block !important; + margin-top: 17px; + margin-left: -42px; +} + diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 000000000..83aac1803 --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,48 @@ +@import url('https://fonts.googleapis.com/css?family=Montserrat:400,600'); + +body { + margin: 0; + font-family: 'Montserrat', sans-serif; +} + +#categories_multiSelect { + width: 200px; +} + +.results { + width: 75%; + margin: auto; +} + +.result { + display: flex; + height: 100px; + margin: 30px auto; + padding: 5px; + width: 75%; + flex-direction: row; + align-items: center; +} + +.result img { + padding: 0 10px 0 0; +} + +.result-info { + display: flex; + flex-direction: column; +} + +.result-info * { + padding: 0 5px 0 0; + margin: 0; +} + +.rounded-border { + border-radius: 10px; + border: 1px; +} + +.gray-border { + border: 1px solid darkgray; +} \ No newline at end of file diff --git a/static/js/multiselect.min.js b/static/js/multiselect.min.js new file mode 100644 index 000000000..b2bf236e4 --- /dev/null +++ b/static/js/multiselect.min.js @@ -0,0 +1,44 @@ +if(!m_helper) +{var m_helper={removeNode:function(id){var el=document.getElementById(id);if(el){el.parentNode.removeChild(el)}},insertAfter:function(item,target){var parent=target.parentNode;if(target.nextElementSibling){parent.insertBefore(item,target.nextElementSibling)}else{parent.appendChild(item)}},hide:function(element){element.style.display='none'},hideAll:function(array){for(var i=0;i-1){window.multiselects._items.splice(index,1);window.multiselects.splice(index,1)}},select:function(val){this._toggle(val,!0)},deselect:function(val){this._toggle(val,!1)},setIsEnabled(isEnabled){if(this._isEnabled===isEnabled)return;var wrapperItem=document.getElementById(this._getIdentifier());if(isEnabled){wrapperItem.classList.remove('disabled')}else{wrapperItem.classList.add('disabled')} + m_helper.setDisabled(this._item,!isEnabled);m_helper.setDisabled(document.getElementById(this._getInputFieldIdentifier()),!isEnabled);this._isEnabled=isEnabled},_toggle:function(val,setCheck){var self=this;if(val){m_helper.each(document.getElementById(this._getIdentifier()).querySelectorAll('.multiselect-checkbox'),function(e){if(e.dataset.val==val){if(setCheck&&!e.checked){m_helper.check(e);self._onCheckBoxChange(e,self)}else if(!setCheck&&e.checked){m_helper.uncheck(e);self._onCheckBoxChange(e,self)}}});self._updateText(self)}},selectAll:function(val){var selectAllChkBox=document.querySelector('#'+this._getIdentifier()+' .multiselect-checkbox');m_helper.check(selectAllChkBox);this._onCheckBoxChange(selectAllChkBox,this);this._updateText(this)},deselectAll:function(){var selectAllChkBox=document.querySelector('#'+this._getIdentifier()+' .multiselect-checkbox');m_helper.uncheck(selectAllChkBox);this._onCheckBoxChange(selectAllChkBox,this);this._updateText(this)},_checkboxClickEvents:{},setCheckBoxClick(id,handler){if(typeof handler==="function"){this._checkboxClickEvents[id]=handler}else{console.error("Checkbox click handler for checkbox value="+id+" is not a function")} + return this},_appendEvents:function(){var self=this;document.getElementById(self._getInputFieldIdentifier()).addEventListener('focus',function(event){self._showList(self);document.getElementById(self._getInputFieldIdentifier()).value='';m_helper.each(window.multiselects,function(e){if(document.getElementById(e._getItemListIdentifier()).offsetParent&&m_helper.parent(event.target,e._getIdentifier())){e._hideList(self)}})});document.getElementById(self._getInputFieldIdentifier()).addEventListener('click',function(){self._showList(self);document.getElementById(self._getInputFieldIdentifier()).value=''});document.getElementById(self._getIdentifier()).addEventListener('click',function(event){event=event||window.event;var target=event.target||event.srcElement;if(m_helper.parent(target,self._getIdentifier())){event.stopPropagation()}});document.getElementById(self._getItemListIdentifier()).addEventListener('mouseover',function(){self._showList(self)});m_helper.each(document.getElementById(self._getIdentifier()).querySelectorAll('.multiselect-checkbox'),function(e){e.addEventListener('change',function(event){self._onCheckBoxChange(e,self,event)})});var onInput=function(){var text=this.value.toLowerCase();if(!text||text==''){m_helper.show(document.querySelector('#'+self._getItemListIdentifier()+' > span'));m_helper.show(document.querySelector('#'+self._getItemListIdentifier()+' > hr'));m_helper.showAll(document.querySelectorAll('#'+self._getItemListIdentifier()+' li'))}else{m_helper.hide(document.querySelector('#'+self._getItemListIdentifier()+' > span'));m_helper.hide(document.querySelector('#'+self._getItemListIdentifier()+' > hr'));var array=Array.prototype.filter.call(document.querySelectorAll('#'+self._getItemListIdentifier()+' li span'),function(obj){return obj.innerHTML.toLowerCase().indexOf(text)>-1});m_helper.hideAll(document.querySelectorAll('#'+self._getItemListIdentifier()+' li'));m_helper.each(array,function(e){m_helper.show(e.parentElement.parentElement)})}} + document.getElementById(self._getInputFieldIdentifier()).addEventListener('propertychange',onInput);document.getElementById(self._getInputFieldIdentifier()).addEventListener('input',onInput)},_onCheckBoxChange:function(checkbox,self,event){if(!checkbox.dataset.multiselectElement){var checkedState=self._performSelectAll(checkbox,self);if(typeof self._checkboxClickEvents.checkboxAll==="function"){self._checkboxClickEvents.checkboxAll(checkbox,{checked:checkedState})}} + else{var checkedState=self._performSelectItem(checkbox,self);if(typeof self._checkboxClickEvents[checkedState.id]==="function"){self._checkboxClickEvents[checkedState.id](checkbox,checkedState)} + self._updateSelectAll(self)} + self._forceUpdate()},_performSelectItem:function(checkbox,self){var item=JSON.parse(checkbox.dataset.multiselectElement);if(checkbox.checked){self._itemCounter++;m_helper.select(this._item.options[item.index]);m_helper.setActive(checkbox.parentElement.parentElement);return{id:item.id,checked:!0}} + self._itemCounter--;m_helper.deselect(this._item.options[item.index]);m_helper.setUnactive(checkbox.parentElement.parentElement);return{id:item.id,checked:!1}},_performSelectAll:function(checkbox,self){var items=self._getItems();if(checkbox.checked){self._itemCounter=items.length;m_helper.each(items,function(e){m_helper.setActive(e.multiselectElement.parentElement.parentElement);m_helper.select(self._item.options[e.index]);m_helper.check(e.multiselectElement)});return!0} + self._itemCounter=0;m_helper.each(items,function(e){e.multiselectElement.parentElement.parentElement.classList.remove('active');m_helper.deselect(self._item.options[e.index]);m_helper.uncheck(e.multiselectElement)});return!1},_updateSelectAll:function(self){var allChkBox=document.getElementById(self._getItemListIdentifier()).querySelector('input[type=checkbox]');if(self._itemCounter==self._getItems().length){allChkBox.checked=!0} + else if(allChkBox.checked){allChkBox.checked=!1}},_hideList:function(context,event){m_helper.setUnactive(document.getElementById(context._getItemListIdentifier()));m_helper.show(document.getElementById(context._getItemListIdentifier()).querySelector('span'));m_helper.show(document.getElementById(context._getItemListIdentifier()).querySelector('hr'));m_helper.showAll(document.getElementById(context._getItemListIdentifier()).querySelectorAll('li'));context._updateText(context);if(event) + event.stopPropagation()},_updateText:function(context){var activeItems=document.getElementById(context._getItemListIdentifier()).querySelectorAll('ul .active');if(activeItems.length>0){var val='';for(var i=0;i<(activeItems.length<5?activeItems.length:5);i++){val+=activeItems[i].innerText+", "} + val=val.substr(0,val.length-2);if(val.length>20){val=val.substr(0,17)+'...'}} + if(activeItems.length==document.getElementById(context._getItemListIdentifier()).querySelectorAll('ul li').length){val='All selected'} + document.getElementById(context._getInputFieldIdentifier()).value=val?val:''},_showList:function(context){m_helper.setActive(document.getElementById(context._getItemListIdentifier()))},_forceUpdate:function(){var badge=document.getElementById(this._getInputBadgeIdentifier());badge.style.visibility='hidden';if(this._itemCounter!=0){badge.innerHTML=this._itemCounter;badge.style.visibility='visible';var ddArrow=badge.nextElementSibling;if(this._itemCounter<10){badge.style.left='-45px';ddArrow.style.marginLeft='-42px'} + else if(this._itemCounter<100){badge.style.left='-50px';ddArrow.style.marginLeft='-47px'} + else if(this._itemCounter<1000){badge.style.left='-55px';ddArrow.style.marginLeft='-52px'} + else if(this._itemCounter<10000){badge.style.left='-60px';ddArrow.style.marginLeft='-57px'}}},_items:undefined,_itemCounter:0,_isEnabled:!0,_getItems:function(){if(this._items==undefined){var result=[];var opts=this._item.options;for(var i=0;i + +
+

${result.title}

+

${result.description}

+
+ + ` + } + + resultContainer.innerHTML = contentToSet; + } + } + xmlHttp.open("POST", "search?q=" + safeName, true); + xmlHttp.send(null); + + window.history.pushState('Search', 'Search', '/search?q=' + safeName); +} \ No newline at end of file diff --git a/static/templates/search.html b/static/templates/search.html deleted file mode 100644 index c2060d258..000000000 --- a/static/templates/search.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Search - - - -

Test Mod Search

-
- - -
- -

{{results}}

- - - - - \ No newline at end of file diff --git a/static/templates/index.html b/templates/index.hbs similarity index 100% rename from static/templates/index.html rename to templates/index.hbs diff --git a/templates/search.hbs b/templates/search.hbs new file mode 100644 index 000000000..555277280 --- /dev/null +++ b/templates/search.hbs @@ -0,0 +1,51 @@ + + + + + + + + + + + + + Search + + + +

Test Mod Search

+ +
+ + + + + + +
+
+ {{#each results}} +
+ +
+

{{this.title}}

+

{{this.description}}

+
+
+ {{/each}} +
+ + + + + + + \ No newline at end of file From a738998c2cf09733e136095ccdee13148af320eb Mon Sep 17 00:00:00 2001 From: Jai A Date: Mon, 11 May 2020 22:53:08 -0700 Subject: [PATCH 003/615] Badges + Refactoring --- src/main.rs | 27 ++++++- static/css/main.css | 49 +++++++++++++ static/css/multiselect.css | 122 ------------------------------- static/css/search.css | 102 ++++++++++++++++++++++++++ static/css/style.css | 48 ------------ static/images/icon/adventure.svg | 1 + static/images/icon/download.svg | 2 + static/images/icon/fabric.png | Bin 0 -> 5867 bytes static/images/icon/forge.jpg | Bin 0 -> 5557 bytes static/images/icon/magic.svg | 94 ++++++++++++++++++++++++ static/images/icon/tech.svg | 2 + static/images/icon/util.svg | 1 + static/js/multiselect.min.js | 44 ----------- templates/search.hbs | 79 +++++++++++++++----- 14 files changed, 337 insertions(+), 234 deletions(-) create mode 100644 static/css/main.css delete mode 100644 static/css/multiselect.css create mode 100644 static/css/search.css delete mode 100644 static/css/style.css create mode 100644 static/images/icon/adventure.svg create mode 100644 static/images/icon/download.svg create mode 100644 static/images/icon/fabric.png create mode 100644 static/images/icon/forge.jpg create mode 100644 static/images/icon/magic.svg create mode 100644 static/images/icon/tech.svg create mode 100644 static/images/icon/util.svg delete mode 100644 static/js/multiselect.min.js diff --git a/src/main.rs b/src/main.rs index 39b95bebf..d04e1c96b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,16 +2,34 @@ extern crate serde_json; use actix_web::{web, web::Data, App, HttpRequest, HttpResponse, HttpServer, Responder, get, post}; -use handlebars::Handlebars; +use handlebars::*; use meilisearch_sdk::{document::*, indexes::*, client::*, search::*}; use serde::{Serialize, Deserialize}; use actix_files as fs; +#[derive(Clone, Copy)] +struct ContainsHelper; + +impl HelperDef for ContainsHelper { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, r: &'reg Handlebars<'_>, ctx: &'rc Context, rc: &mut RenderContext<'reg, 'rc>, out: &mut dyn Output) -> HelperResult { + let array = h.param(0).map(|v| serde_json::from_value::>(v.value().clone()).unwrap()).ok_or(RenderError::new("Parameter not found!"))?; + let mut value = h.param(1).map(|v| v.value().as_str().unwrap()).ok_or(RenderError::new("Parameter not found!"))?; + + let tmpl = if array.contains(&String::from(value)) { h.template() } else { h.inverse() }; + + match tmpl { + Some(ref t) => t.render(r, ctx, rc, out), + None => Ok(()), + } + } +} + #[derive(Serialize, Deserialize, Debug)] struct Mod { mod_id: usize, title: String, description: String, + keywords: Vec, } impl Document for Mod { @@ -90,9 +108,12 @@ async fn index(hb: web::Data>) -> HttpResponse { async fn main() -> std::io::Result<()> { //Handlebars let mut handlebars = Handlebars::new(); + + handlebars.register_helper("contains", Box::new(ContainsHelper)); handlebars .register_templates_directory(".hbs", "./templates") .unwrap(); + let handlebars_ref = web::Data::new(handlebars); //Search @@ -105,21 +126,25 @@ async fn main() -> std::io::Result<()> { mod_id: 0, title: String::from("Magic Mod"), description: String::from("An illustrious magic mod for magical wizards"), + keywords: vec![String::from("Fabric"), String::from("Magic")], }, Mod { mod_id: 1, title: String::from("Tech Mod"), description: String::from("An technological mod for complete NERDS"), + keywords: vec![String::from("Fabric"), String::from("Utility"), String::from("Technology")], }, Mod { mod_id: 2, title: String::from("Hood Mod"), description: String::from("A hood mod to roleplay as if you were a real street person. Some adventure stuff too"), + keywords: vec![String::from("Forge"), String::from("Adventure"), String::from("Technology")] }, Mod { mod_id: 3, title: String::from("Adventure Mod"), description: String::from("An epic gamer adventure mod for epic adventure gamers"), + keywords: vec![String::from("Forge"), String::from("Magic"), String::from("Adventure")] }, ], Some("mod_id")).unwrap(); diff --git a/static/css/main.css b/static/css/main.css new file mode 100644 index 000000000..58f4ad02d --- /dev/null +++ b/static/css/main.css @@ -0,0 +1,49 @@ +@import url('https://fonts.googleapis.com/css?family=Montserrat:400,600'); + +body { + margin: 0; + font-family: 'Montserrat', sans-serif; +} + +.temp-circle-logo { + height: 50px; + width: 50px; + background-color: white; + border-radius: 50%; + display: inline-block; + margin-left: 20%; +} + +.site-header { + position: sticky; + background-color: black; + width: 100%; + height: 75px; + margin-bottom: 10px; + display: flex; + align-items: center; +} + +.site-header h2 { + color: white; + font-weight: bolder; + padding: 0 20px 0 10px; +} + +.links-container { + margin: 0 auto; +} +.links-container a { + color: white; + padding: 0 30px; + text-decoration: none; +} + +.rounded-border { + border-radius: 10px; + border: 1px; +} + +.gray-border { + border: 1px solid darkgray; +} \ No newline at end of file diff --git a/static/css/multiselect.css b/static/css/multiselect.css deleted file mode 100644 index 5d9c5f5e5..000000000 --- a/static/css/multiselect.css +++ /dev/null @@ -1,122 +0,0 @@ -.multiselect-wrapper { - width: 180px; - display: inline-block; - white-space: nowrap; - font-size: 12px; - font-family: "Segoe UI", Verdana, Helvetica, Sans-Serif; -} - -.multiselect-wrapper .multiselect-input { - width: 100%; - padding-right: 50px; -} - -.multiselect-wrapper label { - display: block; - font-size: 12px; - font-weight : 600; -} - -.multiselect-wrapper .multiselect-list { - z-index: 1; - position: absolute; - display: none; - background-color: white; - border: 1px solid grey; - border-bottom-left-radius: 2px; - border-bottom-right-radius: 2px; - margin-top: -2px; -} - -.multiselect-wrapper .multiselect-list.active { - display: block; -} - -.multiselect-wrapper .multiselect-list > span { - font-weight: bold; -} - -.multiselect-wrapper .multiselect-list .multiselect-checkbox { - margin-right: 2px; -} - -.multiselect-wrapper .multiselect-list > span, -.multiselect-wrapper .multiselect-list li { - cursor: default; -} - -.multiselect-wrapper .multiselect-list { - padding: 5px; - min-width: 200px; -} - -.multiselect-wrapper ul { - list-style: none; - display: block; - position: relative; - padding: 0px; - margin: 0px; - max-height: 200px; - overflow-y: auto; - overflow-x: hidden; -} - -.multiselect-wrapper ul li { - padding-right: 20px; - display: block; -} - -.multiselect-wrapper ul li.active { - background-color: rgb(0, 102, 255); - color: white; -} - -.multiselect-wrapper ul li:hover { - background-color: rgb(0, 102, 255); - color: white; -} - -.multiselect-input-div { - height: 34px; -} - -.multiselect-input-div input{ - border: 1px solid #ababab; - background : #fff; - margin: 5px 0 6px 0; - padding: 5px; - vertical-align:middle; -} - -.multiselect-count { - position: relative; - text-align: center; - border-radius: 2px; - background-color: lightblue; - display: inline-block !important; - padding: 2px 7px; - left: -45px; -} - -.multiselect-wrapper.disabled .multiselect-dropdown-arrow { - border-top: 5px solid lightgray; -} - -.multiselect-wrapper.disabled .multiselect-count { - background-color: lightgray; -} - -.multiselect-dropdown-arrow { - width: 0; - height: 0; - border-left: 5px solid transparent; - border-right: 5px solid transparent; - border-top: 5px solid black; - position: absolute; - line-height: 20px; - text-align: center; - display: inline-block !important; - margin-top: 17px; - margin-left: -42px; -} - diff --git a/static/css/search.css b/static/css/search.css new file mode 100644 index 000000000..498608039 --- /dev/null +++ b/static/css/search.css @@ -0,0 +1,102 @@ +.search-container { + width: 100%; + display: flex; + align-content: center; +} + +.search-bar { + margin: 0 auto; + width: 56.25%; + height: 2em; +} + +.results { + width: 75%; + margin: auto; +} + +.result { + display: flex; + height: 100px; + margin: 30px auto; + padding: 5px; + width: 75%; + flex-direction: row; + align-items: center; +} + +.result img { + padding: 0 10px 0 5px; +} + +.result-info { + display: flex; + flex-direction: column; +} + +.result-info * { + padding: 0 5px 0 0; + margin: 0; +} + +.result-badges { + margin: 0 1em 20px auto; + align-self: center; + height: 75px; + display: flex; + flex-direction: column; +} + +.result-badge { + display: flex; + flex-direction: row; + align-items: center; + height: 25px; + margin: 2px 0; + padding: 2px 5px; + width: 155px; +} + +.result-badge img { + height: 23px; +} + +.result-badge p { + margin: 0 auto; + font-weight: bolder; +} + +.download-badge { + background-color: limegreen; + color: white; +} + +.forge-badge { + color: #e1a15a; + background-color: #1e2d44; +} + +.fabric-badge { + color: #585849; + background-color: #fffdd0; +} + +.tech-badge { + color: white; + background-color: red; +} + +.adventure-badge { + color: white; + background-color: saddlebrown; +} + +.magic-badge { + color: white; + background-color: rebeccapurple; +} + +.utility-badge { + color: white; + background-color: orangered; +} \ No newline at end of file diff --git a/static/css/style.css b/static/css/style.css deleted file mode 100644 index 83aac1803..000000000 --- a/static/css/style.css +++ /dev/null @@ -1,48 +0,0 @@ -@import url('https://fonts.googleapis.com/css?family=Montserrat:400,600'); - -body { - margin: 0; - font-family: 'Montserrat', sans-serif; -} - -#categories_multiSelect { - width: 200px; -} - -.results { - width: 75%; - margin: auto; -} - -.result { - display: flex; - height: 100px; - margin: 30px auto; - padding: 5px; - width: 75%; - flex-direction: row; - align-items: center; -} - -.result img { - padding: 0 10px 0 0; -} - -.result-info { - display: flex; - flex-direction: column; -} - -.result-info * { - padding: 0 5px 0 0; - margin: 0; -} - -.rounded-border { - border-radius: 10px; - border: 1px; -} - -.gray-border { - border: 1px solid darkgray; -} \ No newline at end of file diff --git a/static/images/icon/adventure.svg b/static/images/icon/adventure.svg new file mode 100644 index 000000000..5599a1491 --- /dev/null +++ b/static/images/icon/adventure.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/images/icon/download.svg b/static/images/icon/download.svg new file mode 100644 index 000000000..05d7c9bbf --- /dev/null +++ b/static/images/icon/download.svg @@ -0,0 +1,2 @@ + + diff --git a/static/images/icon/fabric.png b/static/images/icon/fabric.png new file mode 100644 index 0000000000000000000000000000000000000000..4ab8370ff4b4de7b4ab665a6628e07b3f94cb44d GIT binary patch literal 5867 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 BTp|Df literal 0 HcmV?d00001 diff --git a/static/images/icon/forge.jpg b/static/images/icon/forge.jpg new file mode 100644 index 0000000000000000000000000000000000000000..749dba107d601a6ba0f1d94a664b17cdaf3bf7a8 GIT binary patch literal 5557 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 Io{RqeACYPi3IG5A literal 0 HcmV?d00001 diff --git a/static/images/icon/magic.svg b/static/images/icon/magic.svg new file mode 100644 index 000000000..c13c657ed --- /dev/null +++ b/static/images/icon/magic.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/images/icon/tech.svg b/static/images/icon/tech.svg new file mode 100644 index 000000000..9f9a73ee5 --- /dev/null +++ b/static/images/icon/tech.svg @@ -0,0 +1,2 @@ + + diff --git a/static/images/icon/util.svg b/static/images/icon/util.svg new file mode 100644 index 000000000..0e4f2830d --- /dev/null +++ b/static/images/icon/util.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/js/multiselect.min.js b/static/js/multiselect.min.js deleted file mode 100644 index b2bf236e4..000000000 --- a/static/js/multiselect.min.js +++ /dev/null @@ -1,44 +0,0 @@ -if(!m_helper) -{var m_helper={removeNode:function(id){var el=document.getElementById(id);if(el){el.parentNode.removeChild(el)}},insertAfter:function(item,target){var parent=target.parentNode;if(target.nextElementSibling){parent.insertBefore(item,target.nextElementSibling)}else{parent.appendChild(item)}},hide:function(element){element.style.display='none'},hideAll:function(array){for(var i=0;i-1){window.multiselects._items.splice(index,1);window.multiselects.splice(index,1)}},select:function(val){this._toggle(val,!0)},deselect:function(val){this._toggle(val,!1)},setIsEnabled(isEnabled){if(this._isEnabled===isEnabled)return;var wrapperItem=document.getElementById(this._getIdentifier());if(isEnabled){wrapperItem.classList.remove('disabled')}else{wrapperItem.classList.add('disabled')} - m_helper.setDisabled(this._item,!isEnabled);m_helper.setDisabled(document.getElementById(this._getInputFieldIdentifier()),!isEnabled);this._isEnabled=isEnabled},_toggle:function(val,setCheck){var self=this;if(val){m_helper.each(document.getElementById(this._getIdentifier()).querySelectorAll('.multiselect-checkbox'),function(e){if(e.dataset.val==val){if(setCheck&&!e.checked){m_helper.check(e);self._onCheckBoxChange(e,self)}else if(!setCheck&&e.checked){m_helper.uncheck(e);self._onCheckBoxChange(e,self)}}});self._updateText(self)}},selectAll:function(val){var selectAllChkBox=document.querySelector('#'+this._getIdentifier()+' .multiselect-checkbox');m_helper.check(selectAllChkBox);this._onCheckBoxChange(selectAllChkBox,this);this._updateText(this)},deselectAll:function(){var selectAllChkBox=document.querySelector('#'+this._getIdentifier()+' .multiselect-checkbox');m_helper.uncheck(selectAllChkBox);this._onCheckBoxChange(selectAllChkBox,this);this._updateText(this)},_checkboxClickEvents:{},setCheckBoxClick(id,handler){if(typeof handler==="function"){this._checkboxClickEvents[id]=handler}else{console.error("Checkbox click handler for checkbox value="+id+" is not a function")} - return this},_appendEvents:function(){var self=this;document.getElementById(self._getInputFieldIdentifier()).addEventListener('focus',function(event){self._showList(self);document.getElementById(self._getInputFieldIdentifier()).value='';m_helper.each(window.multiselects,function(e){if(document.getElementById(e._getItemListIdentifier()).offsetParent&&m_helper.parent(event.target,e._getIdentifier())){e._hideList(self)}})});document.getElementById(self._getInputFieldIdentifier()).addEventListener('click',function(){self._showList(self);document.getElementById(self._getInputFieldIdentifier()).value=''});document.getElementById(self._getIdentifier()).addEventListener('click',function(event){event=event||window.event;var target=event.target||event.srcElement;if(m_helper.parent(target,self._getIdentifier())){event.stopPropagation()}});document.getElementById(self._getItemListIdentifier()).addEventListener('mouseover',function(){self._showList(self)});m_helper.each(document.getElementById(self._getIdentifier()).querySelectorAll('.multiselect-checkbox'),function(e){e.addEventListener('change',function(event){self._onCheckBoxChange(e,self,event)})});var onInput=function(){var text=this.value.toLowerCase();if(!text||text==''){m_helper.show(document.querySelector('#'+self._getItemListIdentifier()+' > span'));m_helper.show(document.querySelector('#'+self._getItemListIdentifier()+' > hr'));m_helper.showAll(document.querySelectorAll('#'+self._getItemListIdentifier()+' li'))}else{m_helper.hide(document.querySelector('#'+self._getItemListIdentifier()+' > span'));m_helper.hide(document.querySelector('#'+self._getItemListIdentifier()+' > hr'));var array=Array.prototype.filter.call(document.querySelectorAll('#'+self._getItemListIdentifier()+' li span'),function(obj){return obj.innerHTML.toLowerCase().indexOf(text)>-1});m_helper.hideAll(document.querySelectorAll('#'+self._getItemListIdentifier()+' li'));m_helper.each(array,function(e){m_helper.show(e.parentElement.parentElement)})}} - document.getElementById(self._getInputFieldIdentifier()).addEventListener('propertychange',onInput);document.getElementById(self._getInputFieldIdentifier()).addEventListener('input',onInput)},_onCheckBoxChange:function(checkbox,self,event){if(!checkbox.dataset.multiselectElement){var checkedState=self._performSelectAll(checkbox,self);if(typeof self._checkboxClickEvents.checkboxAll==="function"){self._checkboxClickEvents.checkboxAll(checkbox,{checked:checkedState})}} - else{var checkedState=self._performSelectItem(checkbox,self);if(typeof self._checkboxClickEvents[checkedState.id]==="function"){self._checkboxClickEvents[checkedState.id](checkbox,checkedState)} - self._updateSelectAll(self)} - self._forceUpdate()},_performSelectItem:function(checkbox,self){var item=JSON.parse(checkbox.dataset.multiselectElement);if(checkbox.checked){self._itemCounter++;m_helper.select(this._item.options[item.index]);m_helper.setActive(checkbox.parentElement.parentElement);return{id:item.id,checked:!0}} - self._itemCounter--;m_helper.deselect(this._item.options[item.index]);m_helper.setUnactive(checkbox.parentElement.parentElement);return{id:item.id,checked:!1}},_performSelectAll:function(checkbox,self){var items=self._getItems();if(checkbox.checked){self._itemCounter=items.length;m_helper.each(items,function(e){m_helper.setActive(e.multiselectElement.parentElement.parentElement);m_helper.select(self._item.options[e.index]);m_helper.check(e.multiselectElement)});return!0} - self._itemCounter=0;m_helper.each(items,function(e){e.multiselectElement.parentElement.parentElement.classList.remove('active');m_helper.deselect(self._item.options[e.index]);m_helper.uncheck(e.multiselectElement)});return!1},_updateSelectAll:function(self){var allChkBox=document.getElementById(self._getItemListIdentifier()).querySelector('input[type=checkbox]');if(self._itemCounter==self._getItems().length){allChkBox.checked=!0} - else if(allChkBox.checked){allChkBox.checked=!1}},_hideList:function(context,event){m_helper.setUnactive(document.getElementById(context._getItemListIdentifier()));m_helper.show(document.getElementById(context._getItemListIdentifier()).querySelector('span'));m_helper.show(document.getElementById(context._getItemListIdentifier()).querySelector('hr'));m_helper.showAll(document.getElementById(context._getItemListIdentifier()).querySelectorAll('li'));context._updateText(context);if(event) - event.stopPropagation()},_updateText:function(context){var activeItems=document.getElementById(context._getItemListIdentifier()).querySelectorAll('ul .active');if(activeItems.length>0){var val='';for(var i=0;i<(activeItems.length<5?activeItems.length:5);i++){val+=activeItems[i].innerText+", "} - val=val.substr(0,val.length-2);if(val.length>20){val=val.substr(0,17)+'...'}} - if(activeItems.length==document.getElementById(context._getItemListIdentifier()).querySelectorAll('ul li').length){val='All selected'} - document.getElementById(context._getInputFieldIdentifier()).value=val?val:''},_showList:function(context){m_helper.setActive(document.getElementById(context._getItemListIdentifier()))},_forceUpdate:function(){var badge=document.getElementById(this._getInputBadgeIdentifier());badge.style.visibility='hidden';if(this._itemCounter!=0){badge.innerHTML=this._itemCounter;badge.style.visibility='visible';var ddArrow=badge.nextElementSibling;if(this._itemCounter<10){badge.style.left='-45px';ddArrow.style.marginLeft='-42px'} - else if(this._itemCounter<100){badge.style.left='-50px';ddArrow.style.marginLeft='-47px'} - else if(this._itemCounter<1000){badge.style.left='-55px';ddArrow.style.marginLeft='-52px'} - else if(this._itemCounter<10000){badge.style.left='-60px';ddArrow.style.marginLeft='-57px'}}},_items:undefined,_itemCounter:0,_isEnabled:!0,_getItems:function(){if(this._items==undefined){var result=[];var opts=this._item.options;for(var i=0;i - - - - + + Search -

Test Mod Search

-
- - + - - +
+
+ +
+ + +
-
{{#each results}}
@@ -37,14 +43,49 @@

{{this.title}}

{{this.description}}

+
+ {{#contains this.keywords "Technology"}} +
+ tech +

TECH

+
+ {{/contains}} + {{#contains this.keywords "Adventure"}} +
+ adventure +

ADVENTURE

+
+ {{/contains}} + {{#contains this.keywords "Magic"}} +
+ magic +

MAGIC

+
+ {{/contains}} + {{#contains this.keywords "Utility"}} +
+ util +

UTILITY

+
+ {{/contains}} + {{#contains this.keywords "Forge"}} +
+ forge +

FORGE

+
+ {{/contains}} + {{#contains this.keywords "Fabric"}} +
+ fabric +

FABRIC

+
+ {{/contains}} +
{{/each}} - From e0308a11c938fcbc4c7e6e15d3ef72682963c6e5 Mon Sep 17 00:00:00 2001 From: Jai A Date: Tue, 12 May 2020 22:27:31 -0700 Subject: [PATCH 004/615] Search filters --- .idea/inspectionProfiles/Project_Default.xml | 10 ++ src/main.rs | 20 ++-- static/css/main.css | 18 ++- static/css/search.css | 115 +++++++++++++++++-- static/images/icon/cursed.png | Bin 0 -> 6460 bytes static/images/icon/decoration.svg | 67 +++++++++++ static/images/icon/download.svg | 2 +- static/images/icon/library.svg | 1 + static/images/icon/search.svg | 18 +++ static/images/icon/updated.svg | 1 + static/images/icon/version.svg | 51 ++++++++ static/images/icon/world.svg | 1 + static/js/search.js | 85 +++++++++++--- templates/search.hbs | 112 +++++++++--------- templates/search_results.hbs | 84 ++++++++++++++ 15 files changed, 491 insertions(+), 94 deletions(-) create mode 100644 static/images/icon/cursed.png create mode 100644 static/images/icon/decoration.svg create mode 100644 static/images/icon/library.svg create mode 100644 static/images/icon/search.svg create mode 100644 static/images/icon/updated.svg create mode 100644 static/images/icon/version.svg create mode 100644 static/images/icon/world.svg create mode 100644 templates/search_results.hbs diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 72d2ffd09..5e27a2933 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -1,6 +1,16 @@