PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Partial (substring) matching of custom metadata

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Partial (substring) matching of custom metadata

    I have set up a custom metafield as type text, partial (substring) matching. I'm probably missing something blindlingly obvious, but I only get matches when I provide a full character string.

    For example, the author custom field for a file is set to Stephen Jones. This file is picked up correctly when "Stephen Jones" is entered into the custom search field but not when I enter Jones.

  • #2
    When you set up the custom meta fields in the Zoom configuration panel, there is an option to have text fields match only when there is an "exact match" or when there is a "partial substring match".

    Comment


    • #3
      Originally posted by wrensoft View Post
      When you set up the custom meta fields in the Zoom configuration panel, there is an option to have text fields match only when there is an "exact match" or when there is a "partial substring match".
      I have these fields set to partial substring match, but only seem able to match full strings.

      Comment


      • #4
        What scripting option are you using? ASP, PHP, JS, or CGI?
        What is the URL for your search function so we can see the problem?

        Comment


        • #5
          Originally posted by wrensoft View Post
          What scripting option are you using? ASP, PHP, JS, or CGI?
          What is the URL for your search function so we can see the problem?
          I've sent you an email with site information and various files.

          Comment


          • #6
            There is a bug in the PHP script, it seems, with partial matching on custom meta text fields. At the moment it is effectively doing an exact string match. If you edit your existing search.php script and replace the mystristr function with the code below, it should fix the problem. We'll include this fix into the mid Jan release.

            Code:
             
            function mystristr($word1, $word2)
            {
              global $UseUTF8;
              global $UseMBFunctions;
             
            if ($UseUTF8 == 1 && $UseMBFunctions == 1)   {
                if (preg_match('/^[\x80-\xff]/', $word1) || preg_match('/^[\x80-\xff]/', $word2))
                  return strstr(mb_strtolower($word1, "UTF-8"), mb_strtolower($word2, "UTF-8"));
               else
                  return stristr($word1, $word2);
            }
            else
              return stristr($word1, $word2);
            }
            The same issue might also effect the CGI script. We still need to check.

            Also there is another bug, It seems numeric meta fields are not being picked up in .desc files, but are being picked up from HTML files. Changing the year field to a text field in the Zoom configuration might be a suitable work around for the moment. Again we'll fix this up for the mid Jan release.

            Comment


            • #7
              These bugs will be fixed for the upcoming V6.0 build 1005 release scheduled to be made available in the next few days.

              When it is ready, you will find it available for download here:
              http://www.wrensoft.com/zoom/whatsnew.html
              --Ray
              Wrensoft Web Software
              Sydney, Australia
              Zoom Search Engine

              Comment

              Working...
              X