mirror of
https://github.com/Steffo99/patched-porobot.git
synced 2024-12-23 01:54: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
|
//! [@patchedporobot]: https://t.me/patchedporobot
|
||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
|
@ -256,17 +256,23 @@ impl CardSearchEngine {
|
||||||
|
|
||||||
/// Build the [QueryParser] of the search engine.
|
/// Build the [QueryParser] of the search engine.
|
||||||
fn parser(index: &Index, fields: CardSchemaFields) -> QueryParser {
|
fn parser(index: &Index, fields: CardSchemaFields) -> QueryParser {
|
||||||
QueryParser::for_index(
|
let mut parser = QueryParser::for_index(
|
||||||
&index,
|
&index,
|
||||||
vec![
|
vec![
|
||||||
fields.code,
|
fields.code,
|
||||||
fields.name,
|
fields.name,
|
||||||
fields.description,
|
fields.description,
|
||||||
|
fields.set,
|
||||||
|
fields.regions,
|
||||||
fields.flavor,
|
fields.flavor,
|
||||||
|
fields.artist,
|
||||||
fields.subtypes,
|
fields.subtypes,
|
||||||
fields.supertype,
|
fields.supertype,
|
||||||
]
|
]
|
||||||
)
|
);
|
||||||
|
parser.set_conjunction_by_default();
|
||||||
|
// parser.set_field_boost();
|
||||||
|
parser
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new [CardSearchEngine].
|
/// Create a new [CardSearchEngine].
|
||||||
|
|
Loading…
Reference in a new issue