1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use *;
/// Lets a search say which text it wants matched.
///
/// The searchable text was decided by the schema rather than by the caller: one
/// weighted `fts` vector over title and description, so the only options were
/// "all of it" or `exact_only`, which meant "title, literally". Tags were
/// stored by both backends and searched by nothing.
///
/// This splits that into two axes, because `exact_only` had a field and a mode
/// in one boolean and so could not be extended into either:
///
/// - `p_search_in` — which text may match: title, description, tags,
/// transcript. `include_transcripts` is gone, because
/// `'transcript' = ANY(p_search_in)` is the same question asked once.
/// - `substring_only` — literal matching over that same list, replacing
/// `exact_only`.
///
/// One vector per field replaces the weighted one. A mixed vector cannot answer
/// "which field matched?", which is the question a field list exists to ask, and
/// `in=title` cannot be filtered against it at all. The cost is a ranking
/// change: `ts_rank` no longer weights a description with many matches above a
/// title with one, because the field decides instead of the count.
///
/// A video whose title and description both match is one row reporting its
/// title, which is the same suppression the fuzzy and transcript tiers already
/// applied to full-text hits.
;
const UP: &str = include_str!;