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

Add search field to limit searching user

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1
    • 3.1
    • Global search
    • MOODLE_31_STABLE
    • MOODLE_31_STABLE
    • MDL-53354-master
    • 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.

    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

              emerrill Eric Merrill
              emerrill Eric Merrill
              David Monllaó David Monllaó
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Adrian Greeve Adrian Greeve
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                23/May/16