InputThe SEARCH operator is a source so it has no input. OutputBy default, the output of this operator is a stream with multiple elements. The type of the elements in the stream depends on the configuration. If you select the option, the type of element in the output stream becomes a tuple (see below). Note:
The SEARCH operator does not order the output stream,
even if you activate the text scoring in .
General Parameters
Search Clause ConfigurationThe operator returns the selected index unit elements that match a predicate (Boolean condition).
Matching Annotations and Text ScoringYou can select to specify matching annotations. These are metadata, which indicate how the item has matched the expression. Matching annotations can be implicit or explicit. The query engine computes implicit annotations internally, without explicit declaration in
the Expression. It is an implicit annotation named
You declare explicit annotations in the Expression. Example
With the explicit matching annotation If you add matching annotations, the output type of the operator changes to
For the example above, the output is: Tuple
item:Item<athletes.Events>
ma:Tuple
city:Integer
score:Integer
Builtin Matching AnnotationYou can use matching annotations to know the frequency of terms in text. Example 1 Input:
Output: Tuple
item: Item<core.Item>
ma: Tuple
score: Integer
For example: {
item: {
...
text: "I love car"
},
ma: {
score: 16
}
},
{
item: {
...
text: "I love my car and cars are eveything for me"
},
ma: {
score: 32
}
},
Example 2 Input:
Output: Tuple
item: Item<core.Item>
ma: Tuple
score: Integer
boost: Integer
For example: {
item: {
...
text: "I love car"
},
ma: {
score: 160
}
},
{
item: {
...
text: "I love car because cars are eveything for me"
},
ma: {
score: 320
}
},
{
item: {
...
text: "I love litterature"
},
ma: {
score: 42
}
},
In this example, the scores of the Other Use of Matching AnnotationsYou can use matching annotations for other purposes. They are typically useful when used as "side variables". For example, to know what worked and what did not work. Input:
Output: Tuple
item: Item<core.Item>,
ma: Tuple
matchMagenta: Integer
matchRed: Integer
For example: {
item: {
...
text: "these tulips are red"
},
ma: {
matchMagenta: 0,
matchRed: 1
}
},
{
item: {
...
text: "The ink cartridge color is magenta"
},
ma: {
matchMagenta: 1,
matchRed: 0
}
},
{
item: {
...
text: "John cannot make the difference between red and magenta"
},
ma: {
matchMagenta: 1,
matchRed: 1
}
},
| ||||||||||||||||||||