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

File search areas for database activity entries need to index using the content id

XMLWordPrintable

    • MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-77791_401
    • MDL-77791_master
    • Hide

      Demo video of problem and solution

      MDL-77791-testing_music.mp4

      Requirements

      1. Turn on Elasticsearch with Tika or Solr with file support and configure the site for global search with file indexing support

        docker run -d -p 8983:8983 --name my_solr solr:7 solr-create -c gettingstarted
        docker start my_solr
        

        Setup

      1. Login as admin.
      2. Enable Global search in "Site administration > Advanced features".
      3. Go to "Site administration >  Plugins > Manage global search > Select search engine " and set "Select search engine" to "Solr".
      4. Go to "Setup search engine" (admin/settings.php?section=searchsolr) and set Index name to "gettingstarted".
      5. Import the Database activity backup: backup-moodle2-activity-2-data2-20230426-0130.mbz into a course. The activity has 29 entries in multiple languages and PDF files with multiple lang strings for the translation of "Hello world!".

      Testing instructions

      1. Run the site indexing CLI script or run cron multiple times:

        php search/cli/indexer.php --reindex --force

      2. Check the file areas page(/admin/searchareas.php) to validate that the database entries have been indexed
      3. Run global search queries on text that is included in the PDF files. All the translated strings can be found in MDL-77791_test_strings.txt.
      4. Result: Database entries which have the searched text in the pdf files are displayed in the global search item list. None should be absent.
      Show
      Demo video of problem and solution MDL-77791-testing_music.mp4 Requirements Turn on Elasticsearch with Tika or Solr with file support and configure the site for global search with file indexing support docker run -d -p 8983:8983 --name my_solr solr:7 solr-create -c gettingstarted docker start my_solr Setup Login as admin. Enable Global search in "Site administration > Advanced features". Go to "Site administration >  Plugins > Manage global search > Select search engine " and set "Select search engine" to "Solr". Go to "Setup search engine" (admin/settings.php?section=searchsolr) and set Index name to "gettingstarted". Import the Database activity backup: backup-moodle2-activity-2-data2-20230426-0130.mbz into a course. The activity has 29 entries in multiple languages and PDF files with multiple lang strings for the translation of "Hello world!". Testing instructions Run the site indexing CLI script or run cron multiple times: php search/cli/indexer.php --reindex --force Check the file areas page(/admin/searchareas.php) to validate that the database entries have been indexed Run global search queries on text that is included in the PDF files. All the translated strings can be found in MDL-77791_test_strings.txt . Result: Database entries which have the searched text in the pdf files are displayed in the global search item list. None should be absent.

      When indexing the files from mod_data, the files being attached to the search document are being looked for using the record id as the file item id, when the files are actually created using the content id by the file field.

      Steps to reproduce

      1. Turn on Elasticsearch with Tika or Solr with file support and configure the site for global search with file indexing support
      2. Create a database activity in a course
      3. Create a file field in the database activity
      4. Create other fields if you want for adding context to the activity
      5. Create multiple entries with PDF files attached to them
      6. Run the site indexing CLI script or run cron multiple times:
        1. search/cli/indexer.php --reindex --force
      7. Check the file areas page(/admin/searchareas.php) to validate that the database entries have been indexed
      8. Run global search queries on text that is included in the PDF files

      Observed behavior

      Some files may be returned, and some others not.

      Expected outcome

      Any text from any indexed file should be searchable and should appear in the results.

        1. backup-moodle2-activity-2-data2-20230426-0130.mbz
          444 kB
        2. MDL-77791_test_strings.txt
          1 kB
        3. MDL-77791-1.png
          MDL-77791-1.png
          154 kB
        4. MDL-77791-2.png
          MDL-77791-2.png
          49 kB
        5. MDL-77791-3.png
          MDL-77791-3.png
          50 kB
        6. MDL-77791-testing_music.mp4
          15.23 MB

            david.castro@moodle.com David Castro
            david.castro@moodle.com David Castro
            Jordi Pujol-Ahulló Jordi Pujol-Ahulló
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Mikel Martín Corrales Mikel Martín Corrales
            Votes:
            7 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day
                1d

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.