Commit Graph

16 Commits (8aa4ae43022889a93231cb8566c70d9239a80be5)

Author SHA1 Message Date
Ana Gelez f6d169567c
Introduce Searcher::new
This function does what was previously done in main:
create a search index, and try to recover for errors
if possible.

This commit also fixes plume-cli to use the new Searcher
API (that depends on a DbPool, not on a single Connection).
4 years ago
Ana Gelez 5f8d6b8e0e Rust 2018! (#726) 4 years ago
fdb-hiroshima 5289fe872a
don't ignore dotenv errors (#630) 5 years ago
fdb-hiroshima 773fbfe7c8 cache local instance (#572)
* cache local instance

fix #564

* don't use local instance cache for plm

* use instance cache for plm, but initialize it

* cargo fmt
5 years ago
fdb-hiroshima 49bb8cb0bc
import migrations and don't require diesel_cli for admins (#555)
* import migrations via macro

* panic on database not to the latest migration

* add subcommand to plm

* create migration that run tantivy index creation

* remove diesel_cli from places it was

* use our migration system for tests

* create table __diesel_schema_migrations if needed
5 years ago
fdb-hiroshima 65bb50e88f Centralize configuration and add some new config (#494)
Ideally, if someone could review the idea in [this comment](https://github.com/Plume-org/Plume/issues/273#issuecomment-474982184), I'd like to add the implementation to this pr too
5 years ago
Atul Bhosale b945d1f602 Run 'cargo fmt' to format code (#489) 5 years ago
fdb-hiroshima 449641d158
Add a search engine into Plume (#324)
* Add search engine to the model

Add a Tantivy based search engine to the model
Implement most required functions for it

* Implement indexing and plm subcommands

Implement indexation on insert, update and delete
Modify func args to get the indexer where required
Add subcommand to initialize, refill and unlock search db

* Move to a new threadpool engine allowing scheduling

* Autocommit search index every half an hour

* Implement front part of search

Add default fields for search
Add new routes and templates for search and result
Implement FromFormValue for Page to reuse it on search result pagination
Add optional query parameters to paginate template's macro
Update to newer rocket_csrf, don't get csrf token on GET forms

* Handle process termination to release lock

Handle process termination
Add tests to search

* Add proper support for advanced search

Add an advanced search form to /search, in template and route
Modify Tantivy schema, add new tokenizer for some properties
Create new String query parser
Create Tantivy query AST from our own

* Split search.rs, add comment and tests

Split search.rs into multiple submodules
Add comments and tests for Query
Make user@domain be treated as one could assume
5 years ago
Trinity Pointard 4e6f3209d5 Normalize panic message
Change all unwrap to expect
Normalize expect's messages
Don't panic where it could be avoided easily
6 years ago
Baptiste Gelez 3a13d80dc6
Merge pull request #267 from Plume-org/db-url
Replace DB_URL with DATABASE_URL
6 years ago
Bat 9cc795d8be Replace DB_URL with DATABASE_URL
This way it is shared with diesel, which simplifies a lot the setup

Also fixes a few issues in the documentation, that are not directly related
6 years ago
Bat 915b9bb0e5 Use env!("CARGO_PKG_VERSION") instead of hardcoding version when possible
See https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates
6 years ago
Bat 4d382d8014 Fix compatibility with SQlite
Also fixes a bug in plume-models
6 years ago
Bat d48a7796f1 User creation CLI tool 6 years ago
Bat 0da5d2e927 Improve the plm instance new command
Add long arguments
Fix the help messages
Actually write to StdOut when needed
Fallback to BASE_URL first if domain is not specified
6 years ago
Bat 6723432e52 CLI tools
- New sub-crate: plume-cli
- Creates a binary called 'plm'
- Uses clap to parse CLI arguments
- Add a first command: plm instance new (to init the local instance)
6 years ago