mirror of
https://github.com/Steffo99/patched-porobot.git
synced 2024-12-22 17:44:22 +00:00
Use AND conjunction by default in the QueryParser
This commit is contained in:
parent
bd335b4712
commit
d2f922b97f
2 changed files with 10 additions and 2 deletions
|
@ -18,6 +18,8 @@
|
|||
//! ```
|
||||
//!
|
||||
//!
|
||||
//!
|
||||
//!
|
||||
//! [@patchedporobot]: https://t.me/patchedporobot
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
|
|
@ -256,17 +256,23 @@ impl CardSearchEngine {
|
|||
|
||||
/// Build the [QueryParser] of the search engine.
|
||||
fn parser(index: &Index, fields: CardSchemaFields) -> QueryParser {
|
||||
QueryParser::for_index(
|
||||
let mut parser = QueryParser::for_index(
|
||||
&index,
|
||||
vec![
|
||||
fields.code,
|
||||
fields.name,
|
||||
fields.description,
|
||||
fields.set,
|
||||
fields.regions,
|
||||
fields.flavor,
|
||||
fields.artist,
|
||||
fields.subtypes,
|
||||
fields.supertype,
|
||||
]
|
||||
)
|
||||
);
|
||||
parser.set_conjunction_by_default();
|
||||
// parser.set_field_boost();
|
||||
parser
|
||||
}
|
||||
|
||||
/// Create a new [CardSearchEngine].
|
||||
|
|
Loading…
Reference in a new issue