kvarn_search

Struct Options

source
pub struct Options {
Show 14 fields pub kind: IndexKind, pub force_remove: bool, pub proximity_threshold: f32, pub proximity_algorithm: Algorithm, pub word_count_limit: usize, pub response_hits_limit: usize, pub distance_threshold: usize, pub clear_interval: Duration, pub query_max_length: usize, pub query_max_terms: usize, pub additional_paths: Vec<Uri>, pub ignore_paths: Vec<Uri>, pub ignore_extensions: Vec<String>, pub index_wordpress_sitemap: bool,
}

Fields§

§kind: IndexKind

The kind of index to use.

§force_remove: bool

Forces documents which have been deleted to be removed from the index immediately.

This brings more consistent query times for a bit of performance if the FS is modified often.

Default true

§proximity_threshold: f32

The limit of word proximity to accept as “close enough”.

Between [0..1], where 1 is the exact word, and 0 is basically everything.

Default: 0.85

§proximity_algorithm: Algorithm

Which proximity algorithm to use.

Default: elipdotter::proximity::Algorithm::Hamming

§word_count_limit: usize

The limit of different words where it will only search for proximate words which start with the same char.

Default: 2_500

§response_hits_limit: usize

Max number of hits to respond with.

Does not improve performance of the searching algorithm.

Default: 50

§distance_threshold: usize

Distance of two occurrences where they are considered “next to each other”.

Default: 100

§clear_interval: Duration

Interval of clearing of the internal cache.

This greatly improves performance, and stays out of your way, as it clears itself.

Default: 10 minutes

§query_max_length: usize

The max length of the input query.

If the length is too large, often many documents are searched, hurting performance.

Default: 100

§query_max_terms: usize

The highest number of elipdotter::Part::String a query can have.

Allowing too many of these slows down the query.

Default: 10

§additional_paths: Vec<Uri>

Additional documents to always index. Only used if you call SearchEngineHandle::index_all. Will only be once, at start-up, if they aren’t on the FS.

Only the [Uri::path] component will be used, so setting this to another domain won’t work :)

§ignore_paths: Vec<Uri>

Always ignore queries which start with any of these [Uri]s.

Only the [Uri::path] component will be used.

§ignore_extensions: Vec<String>

Ignore these file extensions. This is useful for not indexing images and other media.

Defaults: jpg avif ico png mkv mp4 mp3 m4a wav woff woff2 css js

The strings MUST NOT include .

§index_wordpress_sitemap: bool

Index the WordPress-generated sitemap at /sitemap.xml?

Default: false Requires features: wordpress-sitemap

Implementations§

source§

impl Options

source

pub fn new() -> Self

Trait Implementations§

source§

impl Debug for Options

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Options

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.