1
Fork 0
mirror of https://github.com/Steffo99/patched-porobot.git synced 2024-12-23 01:54:22 +00:00

Boost code and name fields, while lowering slightly flavor

This commit is contained in:
Steffo 2022-08-08 23:23:26 +02:00
parent e59856c656
commit 8cc200b6f4
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -1,6 +1,6 @@
//! Module defining a search engine to find [Card]s. //! Module defining a search engine to find [Card]s.
use tantivy::{Document, Index, IndexReader, IndexWriter}; use tantivy::{Document, Index, IndexReader, IndexWriter, Score};
use tantivy::collector::TopDocs; use tantivy::collector::TopDocs;
use tantivy::query::{QueryParser, QueryParserError}; use tantivy::query::{QueryParser, QueryParserError};
use tantivy::schema::{Field, NumericOptions, Schema, TextOptions}; use tantivy::schema::{Field, NumericOptions, Schema, TextOptions};
@ -271,7 +271,9 @@ impl CardSearchEngine {
] ]
); );
parser.set_conjunction_by_default(); parser.set_conjunction_by_default();
// parser.set_field_boost(); parser.set_field_boost(fields.code, 3.0);
parser.set_field_boost(fields.name, 3.0);
parser.set_field_boost(fields.flavor, 0.7);
parser parser
} }