PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

PHP warning - Trying to access array offset on value Line 595

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

  • PHP warning - Trying to access array offset on value Line 595

    I use Zoom v8 build 1020, which works perfect including wildcards, exact match etc.. But now I came across a very odd thing. I made a certain search string in quotes: "word1 word2" (regular English words) and I get 704 similar PHP Warnings ("Warning: Trying to access array offset on value of type int in ...\search.php on line 595", which line is: "if ($termNum == $i || $contextArray[$termNum][0] > $DictReservedLimit)"). After the long list of repeated warnings I get 12 pcs valid and normal matches.

    The word1 alone or in combination with any other word produce no warnings. Same applies on word2. Only this exact match of word1 and word2 produces the warnings.

  • #2
    What version of PHP is this with?

    Comment


    • #3
      This is PHP 8.1.26. But same problem applies with PHP 7.4.33 and 8.2.6.

      Comment


      • #4
        We tested this with PHP 8.1.28 on Linux with Zoom 8.0 build 1020.

        We didn't see any warnings.

        So maybe there is something special about the index you built. Either the index content, or the options selected, or maybe your PHP options or the specific search term used. Or maybe you have customised our PHP code and broken it in a subtle way.

        Can you Zip up all your index files and (including your search.php script) and make it available to us. Post or EMail us a link.

        Comment


        • #5
          Looks like it is a bug related to selecting a very large context display in the search results. So it will only happen with your index.

          Default value is 30 words. You have selected 1000 words. Which maybe doesn't make much sense as it implies up to a 10,000 word search response. Basically a complete book.

          But bug as now been fixed for next patch release.

          Alternative solution would be to reduce the context size to something more reasonable. e.g. 50 words.

          Comment


          • #6
            Thank you for your efforts to find the problem and the fix in next patch release.

            However, there was a purpose to have context size of 1000 words. This selection gets around an other bug in Zoom, where the result page looses preceding text around matched word. This occurs only in the very first file(s) in the index list. That's why I included a dummy file to be first in the index list (with 1000 dummy 'zzz'-words).

            Discussed in thread:
            https://forums.zoomsearchengine.com/...rounding-words
            - Further email recommendation from Ray, 18th Jan 2019.

            Anyway, your forthcoming patch should do the work, thanks!

            Comment

            Working...
            X