forked from solariumphp/solarium
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComponentAwareQueryInterface.php
More file actions
166 lines (140 loc) · 3.98 KB
/
ComponentAwareQueryInterface.php
File metadata and controls
166 lines (140 loc) · 3.98 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?php
/*
* This file is part of the Solarium package.
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code.
*/
namespace Solarium\Component;
use Solarium\Exception\OutOfBoundsException;
/**
* Trait query types supporting components.
*/
interface ComponentAwareQueryInterface
{
/**
* Query component morelikethis.
*/
const COMPONENT_MORELIKETHIS = 'morelikethis';
/**
* Query component spellcheck.
*/
const COMPONENT_SPELLCHECK = 'spellcheck';
/**
* Query component spellcheck.
*/
const COMPONENT_SUGGESTER = 'suggest';
/**
* Query component debug.
*/
const COMPONENT_DEBUG = 'debug';
/**
* Query component spatial.
*/
const COMPONENT_SPATIAL = 'spatial';
/**
* Query component facetset.
*/
const COMPONENT_FACETSET = 'facetset';
/**
* Query component dismax.
*/
const COMPONENT_DISMAX = 'dismax';
/**
* Query component dismax.
*/
const COMPONENT_EDISMAX = 'edismax';
/**
* Query component highlighting.
*/
const COMPONENT_HIGHLIGHTING = 'highlighting';
/**
* Query component grouping.
*/
const COMPONENT_GROUPING = 'grouping';
/**
* Query component distributed search.
*/
const COMPONENT_DISTRIBUTEDSEARCH = 'distributedsearch';
/**
* Query component stats.
*/
const COMPONENT_STATS = 'stats';
/**
* Query component terms.
*/
const COMPONENT_TERMS = 'terms';
/**
* Query component term vector.
*/
const COMPONENT_TERMVECTOR = 'termvector';
/**
* Query component queryelevation.
*/
const COMPONENT_QUERYELEVATION = 'queryelevation';
/**
* Query component rerank query.
*/
const COMPONENT_RERANKQUERY = 'rerankquery';
/**
* Query component analytics.
*/
const COMPONENT_ANALYTICS = 'analytics';
/**
* Get all registered component types.
*
* @return array<self::COMPONENT_*|string> An array of self::COMPONENT_* and/or self-registered keys
*/
public function getComponentTypes(): array;
/**
* Register a component type.
*
* @param string $key
* @param string $component
*
* @return self Provides fluent interface
*/
public function registerComponentType(string $key, string $component): self;
/**
* Get all registered components.
*
* @return AbstractComponent[]
*/
public function getComponents(): array;
/**
* Get a component instance by key.
*
* You can optionally supply an autoload class to create a new component
* instance if there is no registered component for the given key yet.
*
* @param self::COMPONENT_*|string $key A self::COMPONENT_* or self-registered key
* @param bool $autoload Autoload if component needs to be created
* @param array|null $config Configuration to use for autoload
*
* @throws OutOfBoundsException
*
* @return AbstractComponent|null
*/
public function getComponent(string $key, ?bool $autoload = false, ?array $config = null): ?AbstractComponent;
/**
* Set a component instance.
*
* This overwrites any existing component registered with the same key.
*
* @param self::COMPONENT_*|string $key A self::COMPONENT_* or self-registered key
* @param AbstractComponent $component
*
* @return self Provides fluent interface
*/
public function setComponent(string $key, AbstractComponent $component): self;
/**
* Remove a component instance.
*
* You can remove a component by passing its key or the component instance.
*
* @param self::COMPONENT_*|string|AbstractComponent $component
*
* @return self Provides fluent interface
*/
public function removeComponent(string|AbstractComponent $component): self;
}