Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
f62b040e
Commit
f62b040e
authored
Jun 25, 2015
by
Aaron Wells
Committed by
Gerrit Code Review
Jun 25, 2015
Browse files
Merge "Removing confusion about elasticsearch indexing of some artefacts (Bug #1465423)"
parents
5470b39d
6d72b906
Changes
1
Show whitespace changes
Inline
Side-by-side
htdocs/search/elasticsearch/lib.php
View file @
f62b040e
...
...
@@ -253,11 +253,11 @@ class PluginSearchElasticsearch extends PluginSearch {
$rs
=
get_recordset_sql
(
'SELECT DISTINCT name AS artefacttype FROM {artefact_installed_type} ORDER BY name ASC'
);
$artefacttypes
=
explode
(
','
,
get_config_plugin
(
'search'
,
'elasticsearch'
,
'artefacttypes'
));
// the following artefacttypes are
exclud
ed because the info is already
in
the usr table
// the following artefacttypes are
auto tick
ed because the info is already
being indexed by
the usr table
$artefacttypes_toexclude
=
array
(
'firstname'
,
'lastname'
,
'preferredname'
,
'email'
);
$artefacttypes
=
array_merge
(
$artefacttypes
,
$artefacttypes_toexclude
);
// to be valid, artefact types need a hierarchy
$artefacttypesmap_array
=
self
::
elasticsearchartefacttypesmap_to_array
();
$types_checkbox
=
array
();
foreach
(
recordset_to_array
(
$rs
)
as
$record
)
{
$types_checkbox
[]
=
array
(
...
...
@@ -356,6 +356,13 @@ class PluginSearchElasticsearch extends PluginSearch {
set_config_plugin
(
'search'
,
'elasticsearch'
,
'artefacttypesmap'
,
$values
[
'artefacttypesmap'
]);
// to be valid, artefact types need a hierarchy
$artefacttypesmap_array
=
self
::
elasticsearchartefacttypesmap_to_array
();
// the following artefacttypes are already being indexed by the usr table so we don't want to save them
$artefacttypes_toexclude
=
array
(
'firstname'
,
'lastname'
,
'preferredname'
,
'email'
);
foreach
(
$artefacttypes_toexclude
as
$exclude
)
{
if
(
!
empty
(
$values
[
'artefacttypes'
][
$exclude
]))
{
unset
(
$values
[
'artefacttypes'
][
$exclude
]);
}
}
$values
[
'artefacttypes'
]
=
array_intersect
(
$values
[
'artefacttypes'
],
array_keys
(
$artefacttypesmap_array
));
$types
=
explode
(
','
,
$values
[
'types'
]);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment