Issue Details (XML | Word | Printable)

Key: MDL-18404
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Valery Fremaux
Reporter: Urs Hunkler
Votes: 4
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Global search does not search label because doc->contents is set to the label name [with patch]

Created: 28/Feb/09 01:11 AM   Updated: 08/May/09 08:42 PM
Return to search
Component/s: Global search
Affects Version/s: 1.9.4
Fix Version/s: None

Participants: Urs Hunkler and Valery Fremaux
Security Level: None
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
Index: label_document.php
===================================================================
RCS file: /cvsroot/moodle/moodle/search/documents/Attic/label_document.php,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 label_document.php
--- label_document.php 27 Dec 2008 11:56:23 -0000 1.1.2.3
+++ label_document.php 27 Feb 2009 16:06:44 -0000
@@ -37,7 +37,7 @@
         $doc->title = strip_tags($label['name']);
         $doc->date = $label['timemodified'];
         $doc->author = '';
- $doc->contents = strip_tags($label['name']);
+ $doc->contents = strip_tags($label['content']);
         $doc->url = label_make_link($label['course']);
         
         // module specific information; optional



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Valery Fremaux added a comment - 28/Feb/09 03:32 AM
Hi Urs,

I don't know if this was the exact cause : for labels name and content field have almost same content. Maybe it comes because "name" has a filtered content, which strips all HTML tags, and might glue some words in the text so significant tokens are broken...

givin 'content' to the indexer might submit HTML content that is not expected in the indexing hasher...

The most problematic issue comes from the core label code itself that might be reviewed to not filter the name field when recording the label, and thus letting richer HTML sequences to be let unchanged there...

I think the mest compromise might be putting here a filtered string but replacing HTML tags by spaces, not by an empty string, so that indexed wordset keeps correct.

Cheers.


Urs Hunkler added a comment - 28/Feb/09 08:14 PM - edited
Valery, you wrote "for labels name and content field have almost same content". That's not right. The name field is set to "varchar(255)" and the content field is a text field. The name field holds a small part of the content.

We noticed the bug because some of the first words in a label where found but later words not.

Can't you handle the label content similar to the glossary entry or a forum message? Both can contain HTML.

The actual situation we need to consider a bug because user expectations are not met and people need to spend time to find out why some words in a label are found and some not.

Can you please correct the label handling?

Thank you very much.