global search problems

global search problems

Ulrike Albers -
回帖数:18

Hallo,

I just managed to set up the global search, but I have three problems:

- Search results don't display names of resources and contents of labels

- There seems to be a problem with special caracters: I find the first page of results for "passé" fine, but when I click on "next" or page "2" link, the program tells me that there's no results for "passé"

- Multi-language spans don't work and names of results are mixed up (tâchestaskstareasaufgaben)

Can anybody help me, with any of these items ?

Thank you !

回复Ulrike Albers

Re: global search problems

Valery Fremaux -
Hi Ulrike,

as actual maintainer/developper of the global search engine, I can give you a hand on this.

please first check the version you have of global search, and tell me more abourt moodle version you are using.

The global search up to date version runs only on 1.9.3 and over and has been updated deeply in early January.

If your release is older, some issues might have been fixed already.

There is no explicit version of the search engine, (something I should correct, because easier to track)...

there is a way to know although : take a document wrapper in search/documents/... say wiki_document.php and go to the end.

Is the $CFG->block_search_utf8dir used ? in the last function ? if yes you have the last version and we should try fix and find what you experiment.

Cheers.
回复Valery Fremaux

Re: global search problems

Ulrike Albers -

Hallo,

Thank you a lot for your answer !

I'm sorry I didn't quite understand (I'm a beginner and my English is not the best).

I understand you are NOT asking for the Moodle version (which is 1.9.1) but for the search function version, but what's a document wrapper (dictionary says "papier" so "paper" no entries for document wrapper); when I search, my link doesn't look like yours, for example

http://mysite.net/search/query.php?query_string=pass%C3%A9

and when I go to the end, there's nothing like $CFG->block_search_utf8dir

Sorry if I got it all wrong...

Ulrike

PS: Le forum français, c'est sympa, mais souvent, personne ne peut répondre à mes questions et je préfère venir ici....

回复Valery Fremaux

Re: global search problems

chandra bommidica -
Hi Valery,

i am using Moodle 1.9.3+

i got proble with Global Search...

its working properly when i login with Admin user.

but when i login with other accounts like Studnet ... it just displaying text "45 results returned" ... but its not showing the results.

is there any setting do i need to enable or ?

Please help me ..


Thank you,
Chandra 微笑
回复chandra bommidica

Re: global search problems

Luisa Freire -
Hi Chandra

I have the same problem when searching as student.

Did you manage to solve this?

Thanks

Luísa

回复Luisa Freire

Re: global search problems

Valery Fremaux -
Hi guys,

I'm just giving an eye back to the track and measure how pregnant comes this counting issue.

Althought I'm straightly hyperloaded, I will plan some worktime to check the actual dev state around this issue.

Cheers.
回复Valery Fremaux

Re: global search problems

Steve Killer -
Salut Valery!

Many thanks for the Global Search.

I've sort-of fixed Student-type users not getting Search items displayed. I give them capability moodle/course:view.
However some Search items are "hidden": the Student clicks the Item and gets a Pink Message saying they have no permission to view the result!

Could you exclude hidden items unless the user has moodle/course:viewhiddencourses
capability?

Our site uses version 1.9.4+ (Build: 20090211)




回复Valery Fremaux

Re: global search problems

Anthony Montalvo -
Hello Valery,

I am having the same problem mentioned by several people in this thread.

I am running a Global Search that should return only one result (a resource in one of my courses).
  1. When I search as site admin I get the correct result
  2. When I search as a student (enrolled in the course that owns the resource) I get zero results
  3. When I search as a teacher of the course where the resource is located, I get the correct result
  4. When I search as a teacher of a different course, I get zero results
Any ideas?

I am running version 1.9.4+ (Build 20090429)
回复Anthony Montalvo

Re: global search problems

Valery Fremaux -
What upsets me more is the point 2 :

If the student has permission to view the resource, he should be able to get it in search results,

The actual three checks that are performed on resouce are the following :

  • Course id visible OR I can see hidden courses (moodle/course:viewhiddencourses)
  • Course is open to guests OR I can view the course (moodle/course:view)
  • The course module is visible OR I can view hidden things in the couse (moodle/course:viewhiddenactivities)
Maybe your student is not matching one of those ?

Teachers in other courses, but not enrolled in that course WILL NOT have access to this resource indeed.

Cheers.
回复Valery Fremaux

Re: global search problems

Anthony Montalvo -
Hi, thanks for your reply.

I've checked the three issues you mention and everything seems to be OK. I am including several screenshots so you can see what is happening:

First, the statistics table for the search index: Statistics.jpg

The next screenshot is of the correct search results obtained as Admin: Search_as_admin.jpg


Finally, these three screenshots show the behavior when logged on as a student. The first is the home page showing that the course with the required resource is visible. The second shows the student's course view, highlighting the search block and the required resource (it is not hidden). The third image shows the search results obtained by the student.

Student_front_page.jpg Student_course_view.jpg Search_as_student.jpg

One final thing - because my site uses spanish and portuguese content, I have also had problems with accents so I have applied the encoding fix suggested by Jerome. This seems to be working perfectly.

Please let me know if there is any other info I can provide to help resolve the problem.

Thank you!
回复Valery Fremaux

Re: global search problems

Sue Wieteska -

Hi Valery,

Did this issue resolve - I have the same problem with students not able to see the search results (other than the statistics) even though they are enrolled in the relevant courses?  We are using moodle 1.9.3.

Thank-you

Sue

回复Ulrike Albers

Re: global search problems

Jerome Decuq -
Hello everybody,

Ulrike,

I have the same problem as you with French accents: the links for page numbers seem not to be properly encoded:

for example the link for page 2 for "passé" is:

www.mymoodlesite/search/query.php?query_string=passé&page=2 (which doesn't work as of course there are no occurences of "passé" in the site, only of "passé")

whereas for the browser to call a valid page it should be:

www.mymoodlesite/search/query.php?query_string=passé&page=2

The problem seems to come from function page_numbers() in querylib.php, but I haven't managed to fix it yet.


Chandra,

I get a similar problem: I think your students get the message 45 results returned, because there are indeed that many resources/activities containing your search words, but I think that the links don't appear because the students are not registered in the courses where these resources/activities are.

I think this is misleading and the number of results displayed should be the number of results the user can access, not the total one.

Valery,

By the way, in some courses, we have some forums for teachers only, but if students type a word in global search that appears in the discussions, they get the result with the title of the forum (although they can't access the forum by clicking on the link). That still displays some information that should stay confidential. But I guess this problem would be difficult to solve because it would need to filter the results based on contexts and capabilities instead ...

Shall I put all this in the tracker anyway?

PS I have moodle 1.9.4+
回复Jerome Decuq

Re: global search problems

Jerome Decuq -
Hi again,

For the encoding problem, you can change function page_numbers() on line 327 of search/querylib.php:

REPLACE
$query = htmlentities($this->term);

BY:
$query = htmlentities($this->term,ENT_NOQUOTES,'utf-8');


It works for me, it allows the use of French accents as well as the use of double quotes to look for a series of words.
回复Jerome Decuq

Re: global search problems

Tim Hunt -
Core developers的头像 Documentation writers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像
Everything in Moodle should be encoded as UTF-8.

And what you are seeing (é) what you get when your computer receives a stream of bytes that is UTF-8, but interprets it as if it was ISO-8859-1, or similar. There may be something wrong with the headers of that page.
回复Jerome Decuq

Re: global search problems

Valery Fremaux -
Sure Jérome.

We have all what we need in the global search implementation to have these kind of side access fixed. Just comment verbosely on the situation so I can reproduce it easily and fix those access checkings.

This should be set with high priority.

Thanks.
回复Valery Fremaux

Re: global search problems

Jerome Decuq -
I just filed MDL-18481 about the problem Chandra mentioned (uncorrect display of results when the user is not an administrator).

About Ulrike's problem with accents, the patch I mentioned seems to fix it (I've had no side effects so far!)

About my problem with hidden forums, I can't reproduce it in a regular forum in a regular section (mine were in hidden 3rd party "teacher section blocks" which display activities put in section 100), so I'll have to investigate further before I file a bug...

Thanks for your help!
回复Jerome Decuq

Re: global search problems

Ulrike Albers -

Hallo everybody,

Jerome fixed the accent problem, that's great.

Could you still help me with one question: How should users search for resource/activity titles (if I put "verbes" in advanced search "terms in title", there's no result either) ?

And one problem: I use multi-language spans and results are displayed like this:

Infos importantes - AideInformación - AyudaInformation - HelpWichtige Infos - Hilfe

TÂCHESTAREASTASKSAUFGABEN

Thankyou !

Ulrike