ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilLuceneSearchGUI Class Reference

GUI for simple Lucene search More...

+ Inheritance diagram for ilLuceneSearchGUI:
+ Collaboration diagram for ilLuceneSearchGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute Command. More...
 
 prepareOutput ()
 Add admin panel command. More...
 
- Public Member Functions inherited from ilSearchBaseGUI
 __construct ()
 
 prepareOutput ()
 
 initStandardSearchForm (int $a_mode)
 
 handleCommand (string $a_cmd)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
 delete ()
 Show delete confirmation. More...
 
 cancelDelete ()
 Cancel delete. More...
 
 cancelObject ()
 
 cancelMoveLinkObject ()
 
 performDelete ()
 
 cut ()
 
 link ()
 
 paste ()
 
 showLinkIntoMultipleObjectsTree ()
 
 showPasteTree ()
 
 showMoveIntoObjectTree ()
 
 performPasteIntoMultipleObjects ()
 
 clear ()
 clear clipboard More...
 
 enableAdministrationPanel ()
 
 disableAdministrationPanel ()
 
 keepObjectsInClipboardObject ()
 
 addLocator ()
 
 autoComplete ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 getType ()
 
 getDetails ()
 Needed for base class search form. More...
 
 getMimeDetails ()
 Needed for base class search form. More...
 
 remoteSearch ()
 Search from main menu. More...
 
 showSavedResults ()
 Show saved results. More...
 
 search ()
 Search (button pressed) More...
 
 performSearchFilter ()
 
 performSearch ()
 Perform search. More...
 
 getTabs ()
 get tabs More...
 
 initUserSearchCache ()
 Init user search cache. More...
 
 fillAdminPanel ()
 Put admin panel into template: More...
 
 addAdminPanelCommand (string $a_cmd, string $a_txt)
 Add a command to the admin panel. More...
 
 setAdminViewButton (string $a_link, string $a_txt)
 Show admin view button. More...
 
 setPageFormAction (string $a_action)
 
 showSearchForm ()
 Show search form. More...
 
 parseCreationFilter ()
 Parse creation date. More...
 
- Protected Member Functions inherited from ilSearchBaseGUI
 initPageNumberFromQuery ()
 
 addPager ($result, string $a_session_key)
 
 buildSearchAreaPath (int $a_root_node)
 
 getSearchCache ()
 
 loadCreationFilter ()
 
 renderSearch (string $term, int $root_node=0)
 
 renderFilter (int $root_node)
 
 initFilter (int $mode)
 
 getStringArrayTransformation ()
 

Protected Attributes

ilTabsGUI $tabs
 
ilHelpGUI $help
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
ilLuceneAdvancedSearchFields $fields
 
int $root_node
 
array $admin_panel_commands = []
 
array $admin_view_button = []
 
array $creation_selector = []
 
string $page_form_action = ''
 
- Protected Attributes inherited from ilSearchBaseGUI
ilUserSearchCache $search_cache
 
string $search_mode = ''
 
ilSearchSettings $settings
 
ilPropertyFormGUI $form = null
 
ilSearchFilterGUI $search_filter = null
 
array $search_filter_data = null
 
ClipboardManager $clipboard
 
ViewManager $container_view_manager
 
ilFavouritesManager $favourites
 
ilCtrl $ctrl
 
ILIAS $ilias
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilTree $tree
 
GlobalHttpState $http
 
Factory $refinery
 
ilLogger $logger
 
string $prev_link = ''
 
string $next_link = ''
 

Additional Inherited Members

- Data Fields inherited from ilSearchBaseGUI
const SEARCH_FAST = 1
 
const SEARCH_DETAILS = 2
 
const SEARCH_AND = 'and'
 
const SEARCH_OR = 'or'
 
const SEARCH_FORM_LUCENE = 1
 
const SEARCH_FORM_STANDARD = 2
 
const SEARCH_FORM_USER = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLuceneSearchGUI::__construct ( )

Constructor.

Definition at line 56 of file class.ilLuceneSearchGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilLuceneAdvancedSearchFields\getInstance(), ILIAS\Repository\help(), ilSearchBaseGUI\initFilter(), initUserSearchCache(), and ILIAS\Repository\tabs().

57  {
58  global $DIC;
59 
61  $this->tabs = $DIC->tabs();
62  $this->help = $DIC->help();
63 
64  $this->ui_factory = $DIC->ui()->factory();
65  $this->ui_renderer = $DIC->ui()->renderer();
66 
68  $this->initFilter(self::SEARCH_FORM_LUCENE);
69  $this->initUserSearchCache();
70  }
global $DIC
Definition: shib_login.php:22
initUserSearchCache()
Init user search cache.
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addAdminPanelCommand()

ilLuceneSearchGUI::addAdminPanelCommand ( string  $a_cmd,
string  $a_txt 
)
protected

Add a command to the admin panel.

Definition at line 503 of file class.ilLuceneSearchGUI.php.

503  : void
504  {
505  $this->admin_panel_commands[] =
506  array("cmd" => $a_cmd, "txt" => $a_txt);
507  }

◆ executeCommand()

ilLuceneSearchGUI::executeCommand ( )

Execute Command.

Definition at line 75 of file class.ilLuceneSearchGUI.php.

References ILIAS\Repository\ctrl(), ilSearchBaseGUI\handleCommand(), and prepareOutput().

75  : void
76  {
77  $next_class = $this->ctrl->getNextClass($this);
78  $cmd = $this->ctrl->getCmd();
79 
80  switch ($next_class) {
81  case 'ilobjectcopygui':
82  $this->prepareOutput();
83  $this->ctrl->setReturn($this, '');
84  $cp = new ilObjectCopyGUI($this);
85  $this->ctrl->forwardCommand($cp);
86  break;
87 
88  default:
89  $this->prepareOutput();
90  if (!$cmd) {
91  $cmd = "showSavedResults";
92  }
93  $this->handleCommand($cmd);
94  break;
95  }
96  }
GUI class for the workflow of copying objects.
handleCommand(string $a_cmd)
prepareOutput()
Add admin panel command.
+ Here is the call graph for this function:

◆ fillAdminPanel()

ilLuceneSearchGUI::fillAdminPanel ( )
protected

Put admin panel into template:

  • creation selector
  • admin view on/off button

Definition at line 428 of file class.ilLuceneSearchGUI.php.

References ilUtil\getImagePath(), and ILIAS\Repository\lng().

428  : void
429  {
430  $adm_view_cmp = $adm_cmds = $creation_selector = $adm_view = false;
431 
432  // admin panel commands
433  if ((count($this->admin_panel_commands) > 0)) {
434  foreach ($this->admin_panel_commands as $cmd) {
435  $this->tpl->setCurrentBlock("lucene_admin_panel_cmd");
436  $this->tpl->setVariable("LUCENE_PANEL_CMD", $cmd["cmd"]);
437  $this->tpl->setVariable("LUCENE_TXT_PANEL_CMD", $cmd["txt"]);
438  $this->tpl->parseCurrentBlock();
439  }
440 
441  $adm_cmds = true;
442  }
443  if ($adm_cmds) {
444  $this->tpl->setCurrentBlock("lucene_adm_view_components");
445  $this->tpl->setVariable("LUCENE_ADM_IMG_ARROW", ilUtil::getImagePath("nav/arrow_upright.svg"));
446  $this->tpl->setVariable("LUCENE_ADM_ALT_ARROW", $this->lng->txt("actions"));
447  $this->tpl->parseCurrentBlock();
448  $adm_view_cmp = true;
449  }
450 
451  // admin view button
452  if (is_array($this->admin_view_button)) {
453  if (is_array($this->admin_view_button)) {
454  $this->tpl->setCurrentBlock("lucene_admin_button");
455  $this->tpl->setVariable(
456  "LUCENE_ADMIN_MODE_LINK",
457  $this->admin_view_button["link"]
458  );
459  $this->tpl->setVariable(
460  "LUCENE_TXT_ADMIN_MODE",
461  $this->admin_view_button["txt"]
462  );
463  $this->tpl->parseCurrentBlock();
464  }
465  $this->tpl->setCurrentBlock("lucene_admin_view");
466  $this->tpl->parseCurrentBlock();
467  $adm_view = true;
468  }
469 
470  // creation selector
471  if (is_array($this->creation_selector)) {
472  $this->tpl->setCurrentBlock("lucene_add_commands");
473  if ($adm_cmds) {
474  $this->tpl->setVariable("LUCENE_ADD_COM_WIDTH", 'width="1"');
475  }
476  $this->tpl->setVariable(
477  "LUCENE_SELECT_OBJTYPE_REPOS",
478  $this->creation_selector["options"]
479  );
480  $this->tpl->setVariable(
481  "LUCENE_BTN_NAME_REPOS",
482  $this->creation_selector["command"]
483  );
484  $this->tpl->setVariable(
485  "LUCENE_TXT_ADD_REPOS",
486  $this->creation_selector["txt"]
487  );
488  $this->tpl->parseCurrentBlock();
489  $creation_selector = true;
490  }
491  if ($adm_view || $creation_selector) {
492  $this->tpl->setCurrentBlock("lucene_adm_panel");
493  if ($adm_view_cmp) {
494  $this->tpl->setVariable("LUCENE_ADM_TBL_WIDTH", 'width:"100%";');
495  }
496  $this->tpl->parseCurrentBlock();
497  }
498  }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ getDetails()

ilLuceneSearchGUI::getDetails ( )
protected

Needed for base class search form.

Todo:
rename

Definition at line 119 of file class.ilLuceneSearchGUI.php.

119  : array
120  {
121  return $this->search_cache->getItemFilter();
122  }

◆ getMimeDetails()

ilLuceneSearchGUI::getMimeDetails ( )
protected

Needed for base class search form.

Todo:
rename

Definition at line 128 of file class.ilLuceneSearchGUI.php.

128  : array
129  {
130  return $this->search_cache->getMimeFilter();
131  }

◆ getTabs()

ilLuceneSearchGUI::getTabs ( )
protected

get tabs

Definition at line 316 of file class.ilLuceneSearchGUI.php.

References ILIAS\Repository\ctrl(), ilSearchSettings\getInstance(), ILIAS\Repository\help(), and ILIAS\Repository\tabs().

Referenced by prepareOutput().

316  : void
317  {
318  $this->help->setScreenIdComponent("src_luc");
319 
320  $this->tabs->addTarget('search', $this->ctrl->getLinkTarget($this));
321 
322  if (ilSearchSettings::getInstance()->isLuceneUserSearchEnabled()) {
323  $this->tabs->addTarget('search_user', $this->ctrl->getLinkTargetByClass('illuceneusersearchgui'));
324  }
325 
326  if ($this->fields->getActiveFields() && !ilSearchSettings::getInstance()->getHideAdvancedSearch()) {
327  $this->tabs->addTarget('search_advanced', $this->ctrl->getLinkTargetByClass('illuceneAdvancedSearchgui'));
328  }
329 
330  $this->tabs->setTabActive('search');
331  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getType()

ilLuceneSearchGUI::getType ( )
protected
Todo:
rename

Definition at line 110 of file class.ilLuceneSearchGUI.php.

110  : int
111  {
112  return self::SEARCH_DETAILS;
113  }

◆ initUserSearchCache()

ilLuceneSearchGUI::initUserSearchCache ( )
protected

Init user search cache.

private

Definition at line 339 of file class.ilLuceneSearchGUI.php.

References $data, ilUserSearchCache\_getInstance(), ilSearchSettings\getInstance(), ilSearchBaseGUI\getStringArrayTransformation(), ILIAS\FileDelivery\http(), ilSearchBaseGUI\initPageNumberFromQuery(), ILIAS\Repository\int(), ilSearchBaseGUI\loadCreationFilter(), ilUserSearchCache\LUCENE_DEFAULT, null, ILIAS\Repository\refinery(), ROOT_FOLDER_ID, and ILIAS\Repository\user().

Referenced by __construct().

339  : void
340  {
341  $this->search_cache = ilUserSearchCache::_getInstance($this->user->getId());
342  $this->search_cache->switchSearchType(ilUserSearchCache::LUCENE_DEFAULT);
343  $page_number = $this->initPageNumberFromQuery();
344 
345  if ($this->http->wrapper()->post()->has('cmd')) {
346  $requested_cmd = (array) $this->http->wrapper()->post()->retrieve('cmd', $this->getStringArrayTransformation());
347  } elseif ($this->http->wrapper()->query()->has('cmd')) {
348  $requested_cmd = (array) $this->http->wrapper()->query()->retrieve(
349  'cmd',
350  $this->refinery->kindlyTo()->string()
351  );
352  $requested_cmd = [$requested_cmd[0] => "Search"];
353  } else {
354  $requested_cmd = [];
355  }
356  $new_search = (bool) ($requested_cmd["performSearch"] ?? false);
357  $new_filter = (bool) ($requested_cmd["performSearchFilter"] ?? false);
358  $new_search_or_filter = $new_search || $new_filter;
359 
360  if ($this->http->wrapper()->post()->has('root_id')) {
361  $filter_scope = $this->http->wrapper()->post()->retrieve(
362  'root_id',
363  $this->refinery->kindlyTo()->int()
364  );
365  } else {
366  $filter_scope = (int) ($this->search_filter_data["search_scope"] ?? ROOT_FOLDER_ID);
367  }
368 
369  $filter_type_active = (is_null($this->search_filter_data["search_type"] ?? null))
370  ? false
371  : true;
372  $requested_filter_type = (array) ($this->search_filter_data["search_type"] ?? []);
373  $requested_filter_type = array_flip($requested_filter_type);
374  $requested_filter_type = array_fill_keys(array_keys($requested_filter_type), "1");
375 
376  if ($page_number) {
377  $this->search_cache->setResultPageNumber($page_number);
378  }
379 
380  if ($this->http->wrapper()->post()->has('term')) {
381  $term = $this->http->wrapper()->post()->retrieve(
382  'term',
383  $this->refinery->kindlyTo()->string()
384  );
385  } else {
386  $term = $this->search_cache->getQuery();
387  }
388  $this->search_cache->setQuery($term);
389 
390  if ($filter_type_active) {
391  $filtered = [];
392  foreach (ilSearchSettings::getInstance()->getEnabledLuceneItemFilterDefinitions() as $type => $data) {
393  if ($requested_filter_type[$type] ?? false) {
394  $filtered[$type] = 1;
395  }
396  }
397  $this->search_cache->setItemFilter($filtered);
398 
399  // Mime filter
400  $mime = [];
401  foreach (ilSearchSettings::getInstance()->getEnabledLuceneMimeFilterDefinitions() as $type => $data) {
402  if ($requested_filter_type[$type] ?? false) {
403  $mime[$type] = 1;
404  }
405  }
406  $this->search_cache->setMimeFilter($mime);
407  }
408  $this->search_cache->setCreationFilter($this->loadCreationFilter());
409  if (!$filter_type_active) {
410  // @todo: keep item filter settings?
411  $this->search_cache->setItemFilter([]);
412  $this->search_cache->setMimeFilter([]);
413  }
414  if (!isset($this->search_filter_data["search_date"])) {
415  $this->search_cache->setCreationFilter([]);
416  }
417 
418  if ($new_filter) {
419  $this->search_cache->setRoot($filter_scope);
420  }
421  }
const ROOT_FOLDER_ID
Definition: constants.php:32
static _getInstance(int $a_usr_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseCreationFilter()

ilLuceneSearchGUI::parseCreationFilter ( )
protected

Parse creation date.

Definition at line 537 of file class.ilLuceneSearchGUI.php.

References IL_CAL_DATE, IL_CAL_UNIX, and null.

Referenced by performSearch().

537  : string
538  {
539  $options = $this->search_cache->getCreationFilter();
540 
541  if (!($options['date_start'] ?? false) && !($options['date_end'] ?? false)) {
542  return '';
543  }
544 
545  $start = null;
546  $end = null;
547  if (($options['date_start'] ?? false)) {
548  $start = new ilDate($options['date_start'] ?? "", IL_CAL_DATE);
549  }
550  if (($options['date_end'] ?? false)) {
551  $end = new ilDate($options['date_end'] ?? "", IL_CAL_DATE);
552  }
553 
554  if ($start && is_null($end)) {
555  $now = new ilDate(time(), IL_CAL_UNIX);
556  return '+(cdate:[' . $start->get(IL_CAL_DATE) . ' TO ' . $now->get(IL_CAL_DATE) . '*]) ';
557  } elseif ($end && is_null($start)) {
558  return '+(cdate:[* TO ' . $end->get(IL_CAL_DATE) . ']) ';
559  } else {
560  return '+(cdate:[' . $start->get(IL_CAL_DATE) . ' TO ' . $end->get(IL_CAL_DATE) . '*]) ';
561  }
562 
563  return '';
564  }
const IL_CAL_UNIX
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const IL_CAL_DATE
+ Here is the caller graph for this function:

◆ performSearch()

ilLuceneSearchGUI::performSearch ( )
protected

Perform search.

Definition at line 229 of file class.ilLuceneSearchGUI.php.

References ilSearchBaseGUI\addPager(), ilSession\clear(), ilLuceneSearcher\getInstance(), ilLuceneSearchResultFilter\getInstance(), ilSearchSettings\getInstance(), ILIAS\Repository\lng(), parseCreationFilter(), ilLegacyFormElementsUtil\prepareFormOutput(), showSearchForm(), and ILIAS\Repository\user().

Referenced by performSearchFilter(), and search().

229  : void
230  {
231  $this->search_cache->deleteCachedEntries();
232  ilSession::clear('vis_references');
233  $filter_query = '';
234  if ($this->search_cache->getItemFilter() and ilSearchSettings::getInstance()->isLuceneItemFilterEnabled()) {
235  $filter_settings = ilSearchSettings::getInstance()->getEnabledLuceneItemFilterDefinitions();
236  foreach ($this->search_cache->getItemFilter() as $obj => $value) {
237  if (!$filter_query) {
238  $filter_query .= '+( ';
239  } else {
240  $filter_query .= 'OR';
241  }
242  $filter_query .= (' ' . $filter_settings[$obj]['filter'] . ' ');
243  }
244  $filter_query .= ') ';
245  }
246  // begin-patch mime_filter
247  $mime_query = '';
248  if ($this->search_cache->getMimeFilter() and ilSearchSettings::getInstance()->isLuceneMimeFilterEnabled()) {
249  $filter_settings = ilSearchSettings::getInstance()->getEnabledLuceneMimeFilterDefinitions();
250  foreach ($this->search_cache->getMimeFilter() as $mime => $value) {
251  if (!$mime_query) {
252  $mime_query .= '+( ';
253  } else {
254  $mime_query .= 'OR';
255  }
256  $mime_query .= (' ' . $filter_settings[$mime]['filter'] . ' ');
257  }
258  $mime_query .= ') ';
259  }
260 
261  // begin-patch creation_date
262  $cdate_query = $this->parseCreationFilter();
263 
264 
265 
266  $filter_query = $filter_query . ' ' . $mime_query . ' ' . $cdate_query;
267 
268 
269  $query = $this->search_cache->getQuery();
270  if ($query) {
271  $query = ' +(' . $query . ')';
272  }
273  $qp = new ilLuceneQueryParser($filter_query . $query);
274  $qp->parse();
275  $searcher = ilLuceneSearcher::getInstance($qp);
276  $searcher->search();
277 
278  // Filter results
279  $filter = ilLuceneSearchResultFilter::getInstance($this->user->getId());
280  $filter->addFilter(new ilLucenePathFilter($this->search_cache->getRoot()));
281  $filter->setCandidates($searcher->getResult());
282  $filter->filter();
283 
284  if ($filter->getResultObjIds()) {
285  $searcher->highlight($filter->getResultObjIds());
286  }
287 
288  // Show results
289  $this->showSearchForm();
290 
291  $presentation = new ilSearchResultPresentation($this);
292  $presentation->setResults($filter->getResultIds());
293  $presentation->setSearcher($searcher);
294 
295  // TODO: other handling required
296  $this->addPager($filter, 'max_page');
297 
298  $presentation->setPreviousNext($this->prev_link, $this->next_link);
299 
300  if ($presentation->render()) {
301  $this->tpl->setVariable('SEARCH_RESULTS', $presentation->getHTML());
302  } else {
303  $this->tpl->setOnScreenMessage(
304  'info',
305  sprintf(
306  $this->lng->txt('search_no_match_hint'),
308  )
309  );
310  }
311  }
showSearchForm()
Show search form.
static getInstance(ilLuceneQueryParser $qp)
Get singleton instance.
parseCreationFilter()
Parse creation date.
static prepareFormOutput($a_str, bool $a_strip=false)
Presentation of search results using object list gui.
addPager($result, string $a_session_key)
static clear(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performSearchFilter()

ilLuceneSearchGUI::performSearchFilter ( )
protected

Definition at line 221 of file class.ilLuceneSearchGUI.php.

References performSearch().

221  : void
222  {
223  $this->performSearch();
224  }
performSearch()
Perform search.
+ Here is the call graph for this function:

◆ prepareOutput()

ilLuceneSearchGUI::prepareOutput ( )

Add admin panel command.

Definition at line 101 of file class.ilLuceneSearchGUI.php.

References getTabs().

Referenced by executeCommand().

101  : void
102  {
103  parent::prepareOutput();
104  $this->getTabs();
105  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remoteSearch()

ilLuceneSearchGUI::remoteSearch ( )
protected

Search from main menu.

Definition at line 136 of file class.ilLuceneSearchGUI.php.

References ILIAS\FileDelivery\http(), ILIAS\Repository\refinery(), ROOT_FOLDER_ID, search(), and ilUtil\stripSlashes().

136  : void
137  {
138  $queryString = '';
139  if ($this->http->wrapper()->post()->has('queryString')) {
140  $queryString = $this->http->wrapper()->post()->retrieve(
141  'queryString',
142  $this->refinery->kindlyTo()->string()
143  );
144  }
145  $root_id = ROOT_FOLDER_ID;
146  if ($this->http->wrapper()->post()->has('root_id')) {
147  $root_id = $this->http->wrapper()->post()->retrieve(
148  'root_id',
149  $this->refinery->kindlyTo()->int()
150  );
151  }
152  $qp = new ilLuceneQueryParser($queryString);
153  $qp->parseAutoWildcard();
154 
155  $query = $qp->getQuery();
156 
157  $this->search_cache->setRoot($root_id);
158  $this->search_cache->setQuery(ilUtil::stripSlashes($query));
159  $this->search_cache->save();
160 
161  $this->search();
162  }
const ROOT_FOLDER_ID
Definition: constants.php:32
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.
search()
Search (button pressed)
+ Here is the call graph for this function:

◆ search()

ilLuceneSearchGUI::search ( )
protected

Search (button pressed)

Returns
void

Definition at line 212 of file class.ilLuceneSearchGUI.php.

References ilSession\clear(), performSearch(), and ilSubItemListGUI\resetDetails().

Referenced by remoteSearch().

212  : void
213  {
214  ilSession::clear('max_page');
215 
216  // Reset details
218  $this->performSearch();
219  }
static resetDetails()
As long as static::resetDetails is not possible this method is final.
performSearch()
Perform search.
static clear(string $a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAdminViewButton()

ilLuceneSearchGUI::setAdminViewButton ( string  $a_link,
string  $a_txt 
)
protected

Show admin view button.

Definition at line 512 of file class.ilLuceneSearchGUI.php.

512  : void
513  {
514  $this->admin_view_button =
515  array("link" => $a_link, "txt" => $a_txt);
516  }

◆ setPageFormAction()

ilLuceneSearchGUI::setPageFormAction ( string  $a_action)
protected

Definition at line 518 of file class.ilLuceneSearchGUI.php.

518  : void
519  {
520  $this->page_form_action = $a_action;
521  }

◆ showSavedResults()

ilLuceneSearchGUI::showSavedResults ( )
protected

Show saved results.

Definition at line 167 of file class.ilLuceneSearchGUI.php.

References ilSearchBaseGUI\addPager(), ilLuceneSearcher\getInstance(), ilLuceneSearchResultFilter\getInstance(), ILIAS\Repository\lng(), ilLuceneQueryParser\parse(), ilLegacyFormElementsUtil\prepareFormOutput(), showSearchForm(), and ILIAS\Repository\user().

167  : bool
168  {
169  if (!strlen($this->search_cache->getQuery())) {
170  $this->showSearchForm();
171  return false;
172  }
173 
174  $qp = new ilLuceneQueryParser($this->search_cache->getQuery());
175  $qp->parse();
176  $searcher = ilLuceneSearcher::getInstance($qp);
177  $searcher->search();
178 
179  // Load saved results
180  $filter = ilLuceneSearchResultFilter::getInstance($this->user->getId());
181  $filter->loadFromDb();
182 
183  // Highlight
184  $searcher->highlight($filter->getResultObjIds());
185 
186  $presentation = new ilSearchResultPresentation($this);
187  $presentation->setResults($filter->getResultIds());
188  $presentation->setSearcher($searcher);
189  $this->addPager($filter, 'max_page');
190  $presentation->setPreviousNext($this->prev_link, $this->next_link);
191 
192  $this->showSearchForm();
193 
194  if ($presentation->render()) {
195  $this->tpl->setVariable('SEARCH_RESULTS', $presentation->getHTML());
196  } elseif (strlen($this->search_cache->getQuery())) {
197  $this->tpl->setOnScreenMessage(
198  'info',
199  sprintf(
200  $this->lng->txt('search_no_match_hint'),
202  )
203  );
204  }
205  return true;
206  }
showSearchForm()
Show search form.
parse()
parse query string
static getInstance(ilLuceneQueryParser $qp)
Get singleton instance.
static prepareFormOutput($a_str, bool $a_strip=false)
Presentation of search results using object list gui.
addPager($result, string $a_session_key)
+ Here is the call graph for this function:

◆ showSearchForm()

ilLuceneSearchGUI::showSearchForm ( )
protected

Show search form.

Returns
void

Definition at line 527 of file class.ilLuceneSearchGUI.php.

References ilSearchBaseGUI\renderSearch().

Referenced by performSearch(), and showSavedResults().

527  : void
528  {
529  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.search.html', 'components/ILIAS/Search');
530  $this->renderSearch($this->search_cache->getQuery(), $this->search_cache->getRoot());
531  }
renderSearch(string $term, int $root_node=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $admin_panel_commands

array ilLuceneSearchGUI::$admin_panel_commands = []
protected

Definition at line 47 of file class.ilLuceneSearchGUI.php.

◆ $admin_view_button

array ilLuceneSearchGUI::$admin_view_button = []
protected

Definition at line 48 of file class.ilLuceneSearchGUI.php.

◆ $creation_selector

array ilLuceneSearchGUI::$creation_selector = []
protected

Definition at line 49 of file class.ilLuceneSearchGUI.php.

◆ $fields

ilLuceneAdvancedSearchFields ilLuceneSearchGUI::$fields
protected

Definition at line 44 of file class.ilLuceneSearchGUI.php.

◆ $help

ilHelpGUI ilLuceneSearchGUI::$help
protected

Definition at line 40 of file class.ilLuceneSearchGUI.php.

◆ $page_form_action

string ilLuceneSearchGUI::$page_form_action = ''
protected

Definition at line 51 of file class.ilLuceneSearchGUI.php.

◆ $root_node

int ilLuceneSearchGUI::$root_node
protected

Definition at line 46 of file class.ilLuceneSearchGUI.php.

◆ $tabs

ilTabsGUI ilLuceneSearchGUI::$tabs
protected

Definition at line 39 of file class.ilLuceneSearchGUI.php.

◆ $ui_factory

UIFactory ilLuceneSearchGUI::$ui_factory
protected

Definition at line 41 of file class.ilLuceneSearchGUI.php.

◆ $ui_renderer

UIRenderer ilLuceneSearchGUI::$ui_renderer
protected

Definition at line 42 of file class.ilLuceneSearchGUI.php.


The documentation for this class was generated from the following file: