1Lucy::Plan::FieldType(3U)ser Contributed Perl DocumentatiLouncy::Plan::FieldType(3)
2
3
4
6 Lucy::Plan::FieldType - Define a fieldXs behavior.
7
9 my @sortable;
10 for my $field ( @{ $schema->all_fields } ) {
11 my $type = $schema->fetch_type($field);
12 next unless $type->sortable;
13 push @sortable, $field;
14 }
15
17 FieldType is an abstract class defining a set of traits and behaviors
18 which may be associated with one or more field names.
19
20 Properties which are common to all field types include "boost",
21 "indexed", "stored", "sortable", "binary", and "similarity".
22
23 The "boost" property is a floating point scoring multiplier which
24 defaults to 1.0. Values greater than 1.0 cause the field to contribute
25 more to a documentXs score, lower values, less.
26
27 The "indexed" property indicates whether the field should be indexed
28 (so that it can be searched).
29
30 The "stored" property indicates whether to store the raw field value,
31 so that it can be retrieved when a document turns up in a search.
32
33 The "sortable" property indicates whether search results should be
34 sortable based on the contents of the field.
35
36 The "binary" property indicates whether the field contains binary or
37 text data. Unlike most other properties, "binary" is not settable.
38
39 The "similarity" property is a Similarity object which defines matching
40 and scoring behavior for the field. It is required if the field is
41 "indexed".
42
44 set_boost
45 $field_type->set_boost($boost);
46
47 Setter for "boost".
48
49 get_boost
50 my $float = $field_type->get_boost();
51
52 Accessor for "boost".
53
54 set_indexed
55 $field_type->set_indexed($indexed);
56
57 Setter for "indexed".
58
59 indexed
60 my $bool = $field_type->indexed();
61
62 Accessor for "indexed".
63
64 set_stored
65 $field_type->set_stored($stored);
66
67 Setter for "stored".
68
69 stored
70 my $bool = $field_type->stored();
71
72 Accessor for "stored".
73
74 set_sortable
75 $field_type->set_sortable($sortable);
76
77 Setter for "sortable".
78
79 sortable
80 my $bool = $field_type->sortable();
81
82 Accessor for "sortable".
83
84 binary
85 my $bool = $field_type->binary();
86
87 Indicate whether the field contains binary data.
88
90 Lucy::Plan::FieldType isa Clownfish::Obj.
91
92
93
94perl v5.34.0 2022-01-21 Lucy::Plan::FieldType(3)