Note: You are currently viewing documentation for Moodle 3.0. Up-to-date documentation for the latest stable version of Moodle may be available here: Course search.

Course search: Difference between revisions

From MoodleDocs
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Work_in_progress}}
{{Infobox plugin
{{Infobox plugin
|type = Course search plugin
|type = Course search plugin
|entry = TODO
|entry = https://moodle.org/plugins/view.php?plugin=tool_coursesearch
|tracker = https://tracker.moodle.org/browse/CONTRIB-4335
|tracker = https://tracker.moodle.org/browse/CONTRIB-4335
|discussion = https://moodle.org/mod/forum/discuss.php?d=230469
|discussion = https://moodle.org/mod/forum/discuss.php?d=230469
Line 11: Line 12:
== Introduction ==
== Introduction ==


"Advance course search" is a plugin that makes course search more flexible, fast , case-insensitive and can sort results by relevance. The plugin
'''"Advance course search"''' is a plugin that makes course search more flexible, fast , case-insensitive and can sort results by relevance. The plugin
also have the capability to search into course attachments(course overview files and summary files). Its gives more powerful way of searching
also have the capability to search into course attachments(course overview files and summary files). Its gives more powerful way of searching
into courses via features like results caching, Sorting with different aspects, spelling correction(Did you mean?) feature, fuzzy search
into courses via features like results caching, Sorting with different aspects, spelling correction(Did you mean?) feature, fuzzy search
Line 18: Line 19:
== Installation ==
== Installation ==


To enable searching with "Advance course search plugin" you need to install both admin tool, search_cleantheme. enabling cleantheme will take control over your moodle course search.


Setting up Advance course search is quite easy ! you just need to go thorough these steps.
<mediaplayer>http://www.youtube.com/watch?feature=player_embedded&v=oe2KgGznnBg</mediaplayer>


=== Installing Admin tool ===


Download the admin tool from here (https://github.com/shashirepo/moodle-tool_coursesearch)
=== Prerequisite ===
Extract the Course Search folder. and put it under moodle installation /admin/tool directory.
If you are already logged in just refreshing the browser should trigger your moodle site to begin the install 'Plugins Check'.
If not then navigate to Administration > Notifications.


Java 5 or higher (a.k.a. 1.5.x), PHP 5.1.4 or higher, moodle 2.5 or higher.


=== Installing search_cleantheme ===
=== Installing admin tool ===


1. Download the admin tool from here. (https://moodle.org/plugins/view.php?plugin=tool_coursesearch)


Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)
2. Extract the Course Search folder. Put it under moodle installation/admin/tool directory.
Extract the theme folder. and put it under moodle installation theme directory.
If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install 'Plugins Check'.
If not then navigate to Administration > Notifications.


3. It should be named coursesearch. If you are already logged in just refreshing the browser should trigger your moodle
site to begin the install 'Plugins Check'.
4. If not then navigate to Administration > Notifications.
=== Installing search_cleantheme OR replacing/copying the renderer.php file ===
Here is two options either you may replace/copy your existing theme renderer with the one found in
search_cleantheme(https://github.com/shashirepo/moodle-theme_cleantheme).
OR you may install cleantheme itself.
replacing /copying the renderer file to your theme.
1. Copy renderer.php file from search_cleantheme replace it with your theme's renderer file.
2. Standard moodle theme doesn't have any renderer file so you may simply copy this to your
theme directory.
3. Rename renderer class name according to your theme name.
for example if you are using theme 'clean'.
then rename the class names to 'theme_clean_core_renderer' & 'theme_clean_core_course_renderer'.
OR you may either use search_cleantheme. This is based on bootstrap clean theme.
1. Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)
2. Extract the theme folder. and put it under moodle installation theme directory.
3. If you are already logged in just refreshing the browser should trigger your Moodle
site to begin the install 'Plugins Check'.
4. If not then navigate to Administration > Notifications.


=== Installing Solr & placing the plugin Schema ===
=== Installing Solr & placing the plugin Schema ===




Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/
Download the latest Solr 4.4.0 release from:
 
http://lucene.apache.org/solr/
Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).


The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.
Unpack the tarball somewhere not visible to the web (not in your apache docroot
and not inside of your moodle directory).


Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.
The Solr download comes with an example application that you can use for
testing, development, and even for smaller production sites. This
application is found at apache-solr-4.4.0/example.


Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.
Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to
something like schema.bak. Then move the schema.xml that comes  
with moodle course search admin tool plugin to take its place.


Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.
Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename
it like solrconfig.bak. Then move the solrconfig.xml that comes with the
moodle course search admin tool plugin to take its place.


Make sure that the conf directory includes the following files - the Solr core may not load if you don't have at least an empty file present:
Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename
it like protwords.bak. Then move the protwords.txt that comes with the
moodle course search admin tool plugin  to take its place.


Make sure that the conf directory includes the following files - the Solr core
may not load if you don't have at least an empty file present:
solrconfig.xml
solrconfig.xml
schema.xml
schema.xml
Line 64: Line 103:
synonyms.txt
synonyms.txt


Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar
Now start the solr application by opening a shell, changing directory to
apache-solr-4.4.0/example, and executing the command java -jar start.jar
 
Test that your solr server is now available by visiting
http://localhost:8983/solr/admin/
 
 
=== Testing with ping to solr ===
 
1. Advance Course can be found under :-
 
Administration->course->Course search settings(URL:- http://127.0.0.1/MoodleInstalltionURL/admin/tool/coursesearch)
 
2. Give the solr configuration options here:-
 
Solr Host:- localhost or 127.0.0.1
Solr Port:- 8983 (Default port for Solr )
Solr path :- /solr (Configuration directory for solr)
 
3. Click on "Check Solr instance Setting". if it Shows ping successful(with an success image). Now click save changes.
 
4. Now click on "Index courses" to index all the courses. After successful indexing. It will come up with a success image.
 
5. Click on "Optimize" to optimize the existing indexes And improve solr performance.
 
 
Enjoy the Search by going on page (http://127.0.0.1/MoodleInstallationURL/course/search.php)


To configure navigation with the course search page goto Site administration -> Front page -> Front page settings.


== Features ==
== Features ==




* Non Latin support with search queries.
* works consistently on different DB engines and different content languages( Non latin languages support)
 
 
* Search results with relevance( Score )
 
 
* Case insensitive search capability


* Search results with relevance(Score)


* Searchable Document Formats
* Searchable Document Formats


   * HyperText Markup Language
 
   * Hyper Text Markup Language
   * XML and derived formats
   * XML and derived formats
   * Microsoft Office document formats
   * Microsoft Office document formats
   * OpenDocument Format
   * Open Document Format
   * Portable Document Format  
   * Portable Document Format  
   * Rich Text Format
   * Rich Text Format
Line 86: Line 158:




* Indexing to make course search fast and efficient 
* Autocomplete ( autosuggest with non-latin languages too )
 
 
* Very fast than existing course search implementation.
 
 
* Spell Checking capability ( Did you mean ?)
 
 
* Keyword Matching (Searching within specific field)
 
 
    Example :- "summary:Getting started with python" searches for the "Getting started with python" in summary field of courses.
 
 
* Proximity Search
 
    Example :- "moodle perth"~4 Search for "moodle perth" within 4 words from each other.
 
 
* Wildcard Search
 


* Sorting by relevance
* Fuzzy search support ( Alternate form of words )


  *  spelling correction (Did you mean?) feature.
  *  fuzzy search (alternate form of words).
  *  Sorting results by score, by shortname, by startdate


* Work consistently on different database engines and different content language.
* Filtering results by startdate (Range queries)


* Pagination & sorting results by relevance, startdate, shortname.


== How it works ? ==
== How it works ? ==


TODO
* '''Flow diagram'''


[[File:coursesearch_flow.png]]


== How to report a bug ==
== How to report a bug ==
Line 114: Line 207:
== See also ==
== See also ==


* [[GSOC/2013|Moodle GSoC projects for 2013]]
* [https://docs.moodle.org/dev/GSOC/2013 Moodle GSoC projects for 2013]
* [[GSOC|Moodle GSoC Overview page]]
* [https://docs.moodle.org/dev/GSOC Moodle GSoC Overview page]
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]
*  [http://www.google-melange.com/gsoc/proposal/review/google/gsoc2013/shashitechno/1 GSOC Proposal]
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]
*  [https://docs.moodle.org/dev/Projects_for_new_developers#Course_search Original idea]
[[Category:GSOC]]
[[Category:Project]]

Latest revision as of 17:00, 19 September 2013

Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.



Introduction

"Advance course search" is a plugin that makes course search more flexible, fast , case-insensitive and can sort results by relevance. The plugin also have the capability to search into course attachments(course overview files and summary files). Its gives more powerful way of searching into courses via features like results caching, Sorting with different aspects, spelling correction(Did you mean?) feature, fuzzy search (alternate form of words).

Installation

<mediaplayer>http://www.youtube.com/watch?feature=player_embedded&v=oe2KgGznnBg</mediaplayer>


Prerequisite

Java 5 or higher (a.k.a. 1.5.x), PHP 5.1.4 or higher, moodle 2.5 or higher.

Installing admin tool

1. Download the admin tool from here. (https://moodle.org/plugins/view.php?plugin=tool_coursesearch)

2. Extract the Course Search folder. Put it under moodle installation/admin/tool directory.

3. It should be named coursesearch. If you are already logged in just refreshing the browser should trigger your moodle site to begin the install 'Plugins Check'.

4. If not then navigate to Administration > Notifications.

Installing search_cleantheme OR replacing/copying the renderer.php file

Here is two options either you may replace/copy your existing theme renderer with the one found in search_cleantheme(https://github.com/shashirepo/moodle-theme_cleantheme). OR you may install cleantheme itself.

replacing /copying the renderer file to your theme.

1. Copy renderer.php file from search_cleantheme replace it with your theme's renderer file.

2. Standard moodle theme doesn't have any renderer file so you may simply copy this to your theme directory.

3. Rename renderer class name according to your theme name.

for example if you are using theme 'clean'. then rename the class names to 'theme_clean_core_renderer' & 'theme_clean_core_course_renderer'.

OR you may either use search_cleantheme. This is based on bootstrap clean theme.

1. Download the cleantheme from here (https://github.com/shashirepo/moodle-theme_cleantheme)

2. Extract the theme folder. and put it under moodle installation theme directory.

3. If you are already logged in just refreshing the browser should trigger your Moodle site to begin the install 'Plugins Check'.

4. If not then navigate to Administration > Notifications.

Installing Solr & placing the plugin Schema

Download the latest Solr 4.4.0 release from: http://lucene.apache.org/solr/

Unpack the tarball somewhere not visible to the web (not in your apache docroot and not inside of your moodle directory).

The Solr download comes with an example application that you can use for testing, development, and even for smaller production sites. This application is found at apache-solr-4.4.0/example.

Move apache-solr-4.4.0/example/solr/collection1/conf/schema.xml and rename it to something like schema.bak. Then move the schema.xml that comes with moodle course search admin tool plugin to take its place.

Similarly, move apache-solr-4.4.0/example/solr/collection1/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solrconfig.xml that comes with the moodle course search admin tool plugin to take its place.

Finally, move apache-solr-4.4.0/example/solr/collection1/conf/protwords.txt and rename it like protwords.bak. Then move the protwords.txt that comes with the moodle course search admin tool plugin to take its place.

Make sure that the conf directory includes the following files - the Solr core may not load if you don't have at least an empty file present: solrconfig.xml schema.xml elevate.xml mapping-ISOLatin1Accent.txt protwords.txt stopwords.txt synonyms.txt

Now start the solr application by opening a shell, changing directory to apache-solr-4.4.0/example, and executing the command java -jar start.jar

Test that your solr server is now available by visiting http://localhost:8983/solr/admin/


Testing with ping to solr

1. Advance Course can be found under :-

Administration->course->Course search settings(URL:- http://127.0.0.1/MoodleInstalltionURL/admin/tool/coursesearch)

2. Give the solr configuration options here:-

Solr Host:- localhost or 127.0.0.1 Solr Port:- 8983 (Default port for Solr ) Solr path :- /solr (Configuration directory for solr)

3. Click on "Check Solr instance Setting". if it Shows ping successful(with an success image). Now click save changes.

4. Now click on "Index courses" to index all the courses. After successful indexing. It will come up with a success image.

5. Click on "Optimize" to optimize the existing indexes And improve solr performance.


Enjoy the Search by going on page (http://127.0.0.1/MoodleInstallationURL/course/search.php)

To configure navigation with the course search page goto Site administration -> Front page -> Front page settings.

Features

  • works consistently on different DB engines and different content languages( Non latin languages support)


  • Search results with relevance( Score )


  • Case insensitive search capability


  • Searchable Document Formats


 * Hyper Text Markup Language
 * XML and derived formats
 * Microsoft Office document formats
 * Open Document Format
 * Portable Document Format 
 * Rich Text Format
 * Compression and packaging formats [See Rebuilding Solr Cell]
 * Text formats


  • Autocomplete ( autosuggest with non-latin languages too )


  • Very fast than existing course search implementation.


  • Spell Checking capability ( Did you mean ?)


  • Keyword Matching (Searching within specific field)


   Example :- "summary:Getting started with python" searches for the "Getting started with python" in summary field of courses.


  • Proximity Search
   Example :- "moodle perth"~4 Search for "moodle perth" within 4 words from each other.


  • Wildcard Search


  • Fuzzy search support ( Alternate form of words )


  • Filtering results by startdate (Range queries)


  • Pagination & sorting results by relevance, startdate, shortname.

How it works ?

  • Flow diagram

coursesearch flow.png

How to report a bug

Please, use Tracker[1]


Credits


See also