Commit graph

52 commits

Author SHA1 Message Date
sam marshall
cca005b48a MDL-70446 search_solr: File indexing can fail due to multipart upload
Due to Solr bug SOLR-15039, uploading files for indexing can fail if
it uses multipart upload. This changes it to use direct binary upload.

Unfortunately, the direct binary version in PHP curl only supports a
string, so we have to load the file into memory. I added extra code to
restrict the size of files indexed to (memory limit - 100MB), which is
usually 284MB unless configured differently because cron runs under
MEMORY_EXTRA.
2021-04-01 11:18:33 +01:00
sam marshall
679e8d8b66 MDL-68729 Search: Allow query on one server while indexing another
To support transitions from one search engine to a different one, or
to a different installation of the same kind, this feature allows for
queries to use a different search engine from indexing. So you can
reindex (and do all other search operation) on one server, while
user queries are unaffected on a different server.

This feature supports changing between search engine types, and also
between two Solr installations.
2020-08-06 12:12:01 +01:00
sam marshall
9b3646417e MDL-68726 Search: Stop Solr 'optimize' behaviour
The optimize feature in Solr is usually considered harmful, especially
prior to Solr 7.5.

This change simply removes the optimize implementation from the Solr
engine.
2020-07-17 17:11:57 +01:00
sam marshall
0deb19468d MDL-68690 Search: Allow Solr to add documents in batches
Adding documents in batches instead of one at a time can make
indexing using Solr significantly faster.

This adds new API functions for search engines, including
add_document_batch() to add a batch of documents,
supports_add_document_batch(), get_batch_max_documents() and
get_batch_max_content().
2020-07-10 11:32:46 +01:00
sam marshall
7ba2a20166 MDL-66326 Global search: Delete from index when courses are deleted
Adds new API support within search engines for optional methods to
delete data for courses and contexts, and implements this for the
two core search plugins (simpledb and solr).

The new API is automatically called when courses or contexts are
deleted. When a whole course is deleted, it only sends the course
delete rather than sending 1,000 separate context deletions as
each activity/block is deleted.
2019-08-23 11:51:50 +01:00
Matteo Scaramuccia
463421144f MDL-66140 search: Mitigate PECL solr extension regression
Refs:
- https://bugs.php.net/bug.php?id=72740
- https://bugs.php.net/bug.php?id=75631
- https://github.com/php/pecl-search_engine-solr/pull/16
2019-08-11 20:03:25 +02:00
sam marshall
c207289127 MDL-65806 Search: Solr does not find words in italic 2019-06-11 16:40:15 +01:00
Matteo Scaramuccia
13719f2ebb MDL-63789 search_solr: use proxy creds, if any
Also use proxy port, IF any.
2018-11-02 23:13:15 +01:00
David Monllao
c5a8065258 Merge branch 'MDL-61028-master' of https://github.com/sammarshallou/moodle 2018-04-23 13:09:53 +02:00
sam marshall
222a97ce76 MDL-61028 core_search: Allow filtering search by user (back-end, Solr)
Adds support in the Solr engine for a new 'userids' parameter to
restrict search results to those created by a specific user or users.
2018-04-20 13:36:55 +01:00
sam marshall
73fd56663b MDL-61102 core_search: Improve performance by reducing schema checks 2018-04-18 16:24:51 +01:00
sam marshall
fc440796e9 MDL-59434 core_search: Alternate result orders including by context
Implements a mechanism by which search engines can provide different
result orderings, and implements a 'by location' ordering within the
Solr search engine (available whenever the user starts their search
from within a course or activity).
2018-03-20 12:15:25 +00:00
sam marshall
4359ef18bb MDL-58885 core_search: Add group support
Adds group support to the core search API and the Solr search engine.
This allows for:

* User searching by group (in the API only, no interface yet)
* Automatically restrict search results by group (in some cases like
  separate-groups forums)
2018-02-16 16:57:00 +00:00
David Monllao
93b2267239 MDL-61281 search_solr: PHP 7.2 compatible counts 2018-01-26 13:11:51 +01:00
David Monllao
895e005989 MDL-60759 search_solr: Solr 7+ compatibility 2017-12-11 12:47:55 +01:00
sam marshall
cfa00fc565 MDL-60880 core_search: Allow search of specific context (back-end)
Adds back-end support for restricting searches to specified context
ids (for example so it is possible to search only a specific forum).
2017-12-05 17:42:38 +00:00
sam marshall
411b5f3a02 MDL-60838 core_search: File upload does not honour timeout 2017-11-24 11:00:45 +00:00
David Monllao
7c31ef2a27 Merge branch 'wip-MDL-58915-master' of git://github.com/marinaglancy/moodle 2017-10-19 15:44:07 +02:00
Marina Glancy
402a8e7a7a MDL-58915 search_solr: connection to solr can use blocked hosts 2017-10-13 12:17:32 +08:00
sam marshall
558b6306f4 MDL-60346 core_search: Solr connection ignores proxy settings 2017-10-06 11:39:38 +01:00
David Monllao
c720384758 MDL-57161 search: Set the correct HTTP header
All credit goes to Test Valley School
2016-12-06 09:52:30 +08:00
David Monllao
d0b4772c88 MDL-55954 search_solr: Check connection before anything else
- Silents the system call when no correct data provided
- Converts long exception messages to standard server
  error + debugging message with the exception
2016-10-04 08:59:59 +08:00
Eric Merrill
1aaead91f9 MDL-55725 search: Index proper time modified with indexed files 2016-09-07 17:33:28 -04:00
Dan Poltawski
fdf50e35b6 Merge branch 'MDL-55287_master-fix' of git://github.com/dmonllao/moodle 2016-07-27 07:58:33 +01:00
David Monllao
e240a6132d MDL-55287 search: Custom error message if solr extension is not installed
Correcting engine is not installed lang string as well.
2016-07-27 13:57:15 +08:00
David Monllao
0bd8383a8b MDL-55278 search: Updating references to area namespace 2016-07-21 18:38:18 +02:00
Eric Merrill
e0867b2222 MDL-55190 search: Limit search to non-files if disabled 2016-07-13 06:05:33 -04:00
Eloy Lafuente (stronk7)
33952d4a53 Merge branch 'MDL-53758-master' of git://github.com/merrill-oakland/moodle 2016-04-26 20:34:20 +02:00
David Monllao
23fc1be833 MDL-53535 search_solr: Solr version restrictions
Also removing is_server_ready call from execute_query as in production
workflows search is done through \core_search\manager::search and
\core_search\manager::instance already checks is_server_ready. In
testing environment setUp functions should check that the server is
ready before performing other actions.
2016-04-18 09:59:58 +08:00
Eric Merrill
053118a184 MDL-53758 search: Better results with low hit rates, improve performance
Ensures that Solr will return available results, even if there are many
misses when using check_access(), by asking Solr for more results if the
counter says there should be more.

Improves performance by ending processing as soon as the requested page
of results is processed. Remaining number of pages is an "estimate"
based on the total result count from Solr and how many items we have
rejected up to this point.
2016-04-17 21:59:25 -04:00
Eric Merrill
501801a2f8 MDL-53642 search: Allow selection of multiple areas to filter 2016-04-07 14:47:47 -04:00
Eric Merrill
427e3cbcd6 MDL-53167 search: Add ability to limit courses searched 2016-04-07 14:41:59 -04:00
Eric Merrill
f6b4ec7b78 MDL-53579 search: Improve solr engine field name 2016-04-06 21:26:55 -04:00
Eric Merrill
546c0af511 MDL-53579 search: Fix conflict with eDisMax parser and indexed files 2016-04-06 14:09:35 -04:00
Eric Merrill
3744ceb63b MDL-53579 search: Limit general query to certain fields 2016-04-02 22:32:22 -04:00
Eric Merrill
7a4a0bc841 MDL-53516 search: Workaround for curl 7.35.0 bug 2016-03-30 15:28:35 -04:00
Dan Poltawski
e195da19e0 Merge branch 'MDL-53516-master' of git://github.com/merrill-oakland/moodle 2016-03-29 16:35:44 +08:00
Dan Poltawski
868e5ef0d5 Merge branch 'MDL-53515-master' of git://github.com/merrill-oakland/moodle 2016-03-29 14:39:53 +08:00
Dan Poltawski
ca0d7bf21c Merge branch 'MDL-53508-master' of git://github.com/merrill-oakland/moodle 2016-03-26 10:26:02 +08:00
Eric Merrill
cd894f84b3 MDL-53516 search: Adding file indexing support to Solr
Expand the Solr engine to use the built in (to Solr) Tika
file indexing engine. Files are shipped off for indexing with
curl. Each file must have it's own document. So grouping is
used to keep files and Moodle docs associated.
2016-03-24 16:39:55 -04:00
Eric Merrill
091973dbd7 MDL-53515 search: Extend search API to allow file indexing 2016-03-24 15:44:27 -04:00
Eric Merrill
4894840dc6 MDL-53508 search: Improve highlighting and move to text fields 2016-03-23 08:55:48 -04:00
Dan Poltawski
ef67e6c5f8 Merge branch 'MDL-53412-master' of git://github.com/merrill-oakland/moodle 2016-03-21 08:57:22 +08:00
Eric Merrill
5dc4624ced MDL-53412 search: Correctly handle Solr over SSL 2016-03-17 01:13:15 -04:00
Eloy Lafuente (stronk7)
3edc162611 Merge branch 'MDL-53354-master' of git://github.com/merrill-oakland/moodle 2016-03-16 01:09:45 +01:00
Eric Merrill
f6b425e2de MDL-53354 search: Add ability to limit search doc to a user 2016-03-10 09:19:05 -05:00
Andrew Nicols
4f9303c443 Merge branch 'MDL-53271-master' of git://github.com/merrill-oakland/moodle 2016-03-09 11:05:44 +08:00
Andrew Nicols
bd2e5ef17d Merge branch 'MDL-53325-master' of git://github.com/merrill-oakland/moodle 2016-03-09 10:06:47 +08:00
Eric Merrill
075fa91271 MDL-53325 search: Remove commit from engine interface
Remove commit from engine, and instead notify when indexes
start and stop, allowing them to decide what to do.
2016-03-06 13:46:54 -05:00
Eric Merrill
bfd6c78f63 MDL-53281 search: Properly set timeout, and don't wait for optimize 2016-03-02 17:32:03 -05:00