diff --git a/.DS_Store b/.DS_Store index 4347e6c..d83c928 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index eed0b25..cd86ff1 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,6 @@ Cargo.lock /data # TODO -todo.md \ No newline at end of file +todo.md + +/misc \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 0a74024..bdacc01 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,4 @@ [workspace] resolver = "2" -members = ["search", "client"] +members = ["search", "server"] diff --git a/search/src/main.rs b/search/src/main.rs index 111f444..87539be 100644 --- a/search/src/main.rs +++ b/search/src/main.rs @@ -62,7 +62,7 @@ fn main() { let build_index = action == "build"; let index_path = format!("{}/index/index", base_path); - let tokenizer_path = format!("{}/tokenizer/bert-base-uncased", base_path); + let tokenizer_path = format!("{}/tokenizer/roberta-large", base_path); let docs_path = format!("{}/docs", base_path); if build_index { diff --git a/client/Cargo.toml b/server/Cargo.toml similarity index 95% rename from client/Cargo.toml rename to server/Cargo.toml index b5a0b8d..9d3a532 100644 --- a/client/Cargo.toml +++ b/server/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "client" +name = "server" version = "0.1.0" edition = "2021" diff --git a/client/src/main.rs b/server/src/main.rs similarity index 95% rename from client/src/main.rs rename to server/src/main.rs index 4657dde..14df684 100644 --- a/client/src/main.rs +++ b/server/src/main.rs @@ -30,13 +30,13 @@ async fn main() { let args: Vec = env::args().collect(); if args.len() < 2 { - println!("Usage: cargo run --bin client "); + println!("Usage: cargo run --bin server "); return; } let base_path = &args[1]; let index_path = format!("{}/index/index", base_path); - let tokenizer_path = format!("{}/tokenizer/bert-base-uncased", base_path); + let tokenizer_path = format!("{}/tokenizer/roberta-large", base_path); let state = Arc::new(AppState { query_processor: Mutex::new(QueryProcessor::build_query_processor( diff --git a/client/templates/index.html b/server/templates/index.html similarity index 69% rename from client/templates/index.html rename to server/templates/index.html index cff157c..1039cb7 100644 --- a/client/templates/index.html +++ b/server/templates/index.html @@ -23,7 +23,6 @@ } - search-rs @@ -32,10 +31,21 @@
+
+ +
+ Rust's Crab +
+
+
-

Index on {{index_path}}

- Index on {{index_path}} +
diff --git a/client/templates/query.html b/server/templates/query.html similarity index 69% rename from client/templates/query.html rename to server/templates/query.html index 102cd76..8364c00 100644 --- a/client/templates/query.html +++ b/server/templates/query.html @@ -8,15 +8,16 @@

Query time: {{ time_ms }}ms

{% for doc in documents %}
-
-

+
+

{{ doc.path }}

- {{ doc.content }} + {{ doc.content|truncate(300) }}

+ {% endfor %}
\ No newline at end of file