Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-53354

Add search field to limit searching user

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1
    • Component/s: Global search
    • Labels:
    • Testing Instructions:
      Hide

      Note: There is no current search area that implements this feature, so we are a) making sure search doesn't break, and b) relying on unit tests.

      1. Install and configure Solr search.
      2. Create content such as a page.
      3. Index the content and make sure you can search for it.
      4. Make sure solr phpunit is configured.
      5. Run php unit, make sure search_solr_testsuite and core_search_testsuite run successfully.
      Show
      Note: There is no current search area that implements this feature, so we are a) making sure search doesn't break, and b) relying on unit tests. Install and configure Solr search. Create content such as a page. Index the content and make sure you can search for it. Make sure solr phpunit is configured. Run php unit, make sure search_solr_testsuite and core_search_testsuite run successfully.
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-53354-master

      Description

      We are looking at adding search indexing support to a plugin, and while it technically possible, there is a significant performance problem. Here is the scenario:

      We have a course specific email module, which provides basically webmail that happens totally within a Moodle course. We would like to index all the emails into search.
      The problem happens when a search is done. Right now, the only limiting/filtering is done by context, so when a search happens, all matching emails in the course are returned, and we have to check each one to see if they have access. The problem is that the hit to miss ratio is VERY low, since generally only 2 users in a course have access to a particular message.

      What I propose is adding a field to the schema, something like alloweduserid. It's set to 0 by default, or a search area can set it when building a doc. Then on all searches add alloweduserid:(0 OR $USER->id) to every query, just like we add context filtering.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              emerrill Eric Merrill
              Reporter:
              emerrill Eric Merrill
              Peer reviewer:
              David Monllaó
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Adrian Greeve
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                23/May/16