Moodle
  1. Moodle
  2. MDL-19342

We can not search by search keyword which include multi-byte strings in Globa search.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.5
    • Fix Version/s: 1.9.6, 2.0
    • Component/s: Global search
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Rank:
      31673

      Description

      In multibyte language environment (ex. Japanese), we can not seach by multibyte strings on global search.

      The cause of this problem is only forgetting character encoding;

      Patch is as follows;

      In search/Zend/Search/Lucene.php, function find()

      public function find($query)
      {
      if (is_string($query))

      { // (Shirai144): modify from here // $query = Zend_Search_Lucene_Search_QueryParser::parse($query); $query = Zend_Search_Lucene_Search_QueryParser::parse($query, 'UTF-8'); // (Shirai144): modify to here }

        Issue Links

          Activity

          Hide
          Valery Fremaux added a comment -

          Hi Tatsuva,

          This is a valuable input, indeed.

          The fact is that we didn't spend a lot of time within the Zend Lucene package itself, mostly because it is an external integration, and merely because any change we make in Lucene distribution might break a bit the upgrading chain for an updated engine from Zend.

          As we have no direct connection with Zend team for Lucene, it is not usable for us to feed that miss back, or maybe is it already fixed in the actual distribution.

          Any way this is an interesting fix we need to commit for all non english languages using such sequences,

          I integrate it ASAP in CVS versions.

          Thanks.

          Show
          Valery Fremaux added a comment - Hi Tatsuva, This is a valuable input, indeed. The fact is that we didn't spend a lot of time within the Zend Lucene package itself, mostly because it is an external integration, and merely because any change we make in Lucene distribution might break a bit the upgrading chain for an updated engine from Zend. As we have no direct connection with Zend team for Lucene, it is not usable for us to feed that miss back, or maybe is it already fixed in the actual distribution. Any way this is an interesting fix we need to commit for all non english languages using such sequences, I integrate it ASAP in CVS versions. Thanks.
          Hide
          Tatsuya Shirai added a comment -

          Hi Valery!
          Global search block is not perfect, but the block will take very important role in the near future.
          I'm beliving it now!

          I had modifyed and improved Global search in two days.
          I had reported only three ponts in tracker including this issue.

          (Shirai135): The multibyte strings in index files will be broken (2009/05/28)
          (Shirai136): When the course module does not exist in mdl_course_modules, SQL syntax error will occur (2009/05/29)
          (Shirai137): User pictures are not displayed in results of blogs (2009/05/29)
          (Shirai138): Change Title from Author to Posted title when the search result is blog (2009/05/29)
          (Shirai139): Change link address from blog entry to posted blog when the search result is blog (2009/05/29)
          (Shirai140): The course name is not displayed when the search result is wiki (2009/05/29)
          (Shirai141): Search option does not work (2009/05/29)
          (Shirai142): Search keyword parameter(Multibyte character) is broken at direct link to the pages (2009/05/29)
          (Shirai143): user_id is not returned (2009/05/29) c.f.(Shirai137)
          (Shirai144): When input multibyte characters as search key, iconv library does not work and the search process halt by the error (2009/05/29)
          (Shirai145): Adding path for external converter and modifying "exectuable" -> "executable" (2009/05/30)
          (Debug004): 'UTF8' is not right encoding name (2009/05/29)

          After modifying these problems, Global search on my moodle site is running fine.

          I attached a zip file (includijng diff-file, original search folder and modified search forlder) named as 'Patches-GlobalSearch.zip'.
          Please check and investigate and test these modifications.

          P.S. Sorry, English is not my native language...hard to read for you...

          Show
          Tatsuya Shirai added a comment - Hi Valery! Global search block is not perfect, but the block will take very important role in the near future. I'm beliving it now! I had modifyed and improved Global search in two days. I had reported only three ponts in tracker including this issue. (Shirai135): The multibyte strings in index files will be broken (2009/05/28) (Shirai136): When the course module does not exist in mdl_course_modules, SQL syntax error will occur (2009/05/29) (Shirai137): User pictures are not displayed in results of blogs (2009/05/29) (Shirai138): Change Title from Author to Posted title when the search result is blog (2009/05/29) (Shirai139): Change link address from blog entry to posted blog when the search result is blog (2009/05/29) (Shirai140): The course name is not displayed when the search result is wiki (2009/05/29) (Shirai141): Search option does not work (2009/05/29) (Shirai142): Search keyword parameter(Multibyte character) is broken at direct link to the pages (2009/05/29) (Shirai143): user_id is not returned (2009/05/29) c.f.(Shirai137) (Shirai144): When input multibyte characters as search key, iconv library does not work and the search process halt by the error (2009/05/29) (Shirai145): Adding path for external converter and modifying "exectuable" -> "executable" (2009/05/30) (Debug004): 'UTF8' is not right encoding name (2009/05/29) After modifying these problems, Global search on my moodle site is running fine. I attached a zip file (includijng diff-file, original search folder and modified search forlder) named as 'Patches-GlobalSearch.zip'. Please check and investigate and test these modifications. P.S. Sorry, English is not my native language...hard to read for you...
          Hide
          Tatsuya Shirai added a comment -

          search_original : moodle1.9.5+ (2009/05/20)
          search: modifyed by me.

          Show
          Tatsuya Shirai added a comment - search_original : moodle1.9.5+ (2009/05/20) search: modifyed by me.
          Hide
          Valery Fremaux added a comment -

          Updated in CVS 19_STABLE and HEAD.
          to be checked.

          Show
          Valery Fremaux added a comment - Updated in CVS 19_STABLE and HEAD. to be checked.
          Hide
          Tatsuya Shirai added a comment -

          Thanks Valery!

          I had checked modifications by your team.
          I think that the work is fine! and very very quick!
          It make me surprised!

          I had made homeworks for you, valery, please see MDL-19426.

          P.S Global search is now working on Japanese environment too. It's a VERY powerful tool, thanks!

          Show
          Tatsuya Shirai added a comment - Thanks Valery! I had checked modifications by your team. I think that the work is fine! and very very quick! It make me surprised! I had made homeworks for you, valery, please see MDL-19426 . P.S Global search is now working on Japanese environment too. It's a VERY powerful tool, thanks!
          Hide
          Tatsuya Shirai added a comment -

          MDL-19426 is not blocker!!! It's my mistake! Sorry.

          Show
          Tatsuya Shirai added a comment - MDL-19426 is not blocker!!! It's my mistake! Sorry.

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: