search errors when search option space is treated as AND

I have ZP 1431. In search option, if I select treat spaces as AND, search results page is wrong.

Example from Zenpage theme:
6 hits for A and B
Pages (1) with nothing following
Articles (4) with nothing following
Images (1) with one displayed image.
Debug log file follows.

Update: I did discover that I forgot to check "content" as one of the search fields which did fix the blank entries returned by pages/news, but the count is still wrong.

`
{Sun, 19 Aug 2012 16:15:24 GMT} Zenphoto v1.4.3.1[10590]

Backtrace: NOTICE: Undefined index: titlelink in C:\mysites\nif\galleries\zp-core\class-search.php on line 1585

SearchEngine->getSearchPages called

from SearchEngine->getPages (class-search.php [1549])

from getNumPages (zenpage-template-functions.php [2360])

from include (search.php [29])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: id in C:\mysites\nif\galleries\zp-core\class-search.php on line 1585

SearchEngine->getSearchPages called

from SearchEngine->getPages (class-search.php [1549])

from getNumPages (zenpage-template-functions.php [2360])

from include (search.php [29])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: in C:\mysites\nif\galleries\zp-core\class-search.php on line 1585

SearchEngine->getSearchPages called

from SearchEngine->getPages (class-search.php [1549])

from getNumPages (zenpage-template-functions.php [2360])

from include (search.php [29])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: id in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: titlelink in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: id in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: id in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: titlelink in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: id in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: id in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: titlelink in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: id in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: id in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: titlelink in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: id in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]

{Sun, 19 Aug 2012 16:15:24 GMT}

Backtrace: NOTICE: Undefined index: in C:\mysites\nif\galleries\zp-core\class-search.php on line 1657

SearchEngine->getSearchArticles called

from SearchEngine->getArticles (class-search.php [1613])

from getNumNews (zenpage-template-functions.php [201])

from include (search.php [30])

from index.php [92]
Zenphoto version 1.4.3.1 [10590] | License | User guide | Forum | Bugtracker | Change log | Server date: 2012-08-19 12:15:28
`

Comments

  • acrylian Administrator
    If you can try the trunk nightly on that install please do.
  • Your error messages above make absolutely no sense. They indicate that SQL is returning a result without providing the actual data from the query. Maybe there are also some query errors reported somewhere?
  • Upgraded to v1.4.3.1[10673]. Using Zenpage theme. Search option set to treat spaces as AND and to not return album matches. Searches on fields: content, extra content, custom data, description, tags, title. Tags set to exact match.

    Search query was two words with new search checked and all fields selected. Returns count of 5 items with 1 page (nothing listed), 3 articles, and 1 image. Following is entire log after I cleared it and then started ZP to run the search query only.

    `
    {Mon, 20 Aug 2012 14:51:26 GMT} Zenphoto v1.4.3.1[10673]

    Backtrace: NOTICE: Undefined index: titlelink in C:\mysites\nif\galleries\zp-core\class-search.php on line 1589

    SearchEngine->getSearchPages called

    from SearchEngine->getPages (class-search.php [1553])

    from getNumPages (zenpage-template-functions.php [2360])

    from include (search.php [29])

    from index.php [92]

    {Mon, 20 Aug 2012 14:51:26 GMT}

    Backtrace: NOTICE: Undefined index: id in C:\mysites\nif\galleries\zp-core\class-search.php on line 1591

    SearchEngine->getSearchPages called

    from SearchEngine->getPages (class-search.php [1553])

    from getNumPages (zenpage-template-functions.php [2360])

    from include (search.php [29])

    from index.php [92]

    {Mon, 20 Aug 2012 14:51:26 GMT}

    Backtrace: NOTICE: Undefined index: in C:\mysites\nif\galleries\zp-core\class-search.php on line 1591

    SearchEngine->getSearchPages called

    from SearchEngine->getPages (class-search.php [1553])

    from getNumPages (zenpage-template-functions.php [2360])

    from include (search.php [29])

    from index.php [92]
    `
  • Please add the following debugging code:

    change line 1588:
    `while ($row = db_fetch_assoc($search_result)) {`

    to:
    `
    debugLog("query:$search_query");
    while ($row = db_fetch_assoc($search_result)) {
    debugLogVar('row',$row)
    `
    And provide the resulting debug output.
  • I'm assuming you mean the class-search.php file in the zpcore directory? When I made above change, it generates a 500 internal server error. I am using a local testing server so that could make a difference.

    I've included the section that I changed in case it's the wrong place:

    `
    } else {
    $search_query = $this->searchDate($searchstring, $searchdate, 'pages', NULL, NULL);
    $search_result = query($search_query);
    }
    if ($search_result) {
    debugLog("query:$search_query");
    while ($row = db_fetch_assoc($search_result)) {
    debugLogVar('row',$row)
    if (isset($weights)) {
    $data['weight'] = $weights[$row['id']];
    }
    $result[] = $data;
    }
    }
    if (isset($weights)) {
    $result = sortMultiArray($result, 'weight', true);
    }
    `
  • There is a semicolon missing on the debugLogVar() statement. Not sure why that gave a 500 error, though.
  • `
    {Tue, 21 Aug 2012 14:49:07 GMT} Zenphoto v1.4.3.1[10673]

    query:SELECT @serachtarget AS name, @serachfield AS field, id AS objectid FROM zp_pages WHERE ( title LIKE '%plant%') ORDER BY id

    {Tue, 21 Aug 2012 14:49:07 GMT}

    rowarray(3) {

    ["name"]=>

    string(5) "plant"

    ["field"]=>

    string(5) "title"

    ["objectid"]=>

    string(1) "3"

    }

    {Tue, 21 Aug 2012 14:49:07 GMT}

    Backtrace: NOTICE: Undefined index: titlelink in C:\mysites\nif\galleries\zp-core\class-search.php on line 1591

    SearchEngine->getSearchPages called

    from SearchEngine->getPages (class-search.php [1553])

    from getNumPages (zenpage-template-functions.php [2360])

    from include (search.php [29])

    from index.php [92]

    {Tue, 21 Aug 2012 14:49:07 GMT}

    Backtrace: NOTICE: Undefined index: id in C:\mysites\nif\galleries\zp-core\class-search.php on line 1593

    SearchEngine->getSearchPages called

    from SearchEngine->getPages (class-search.php [1553])

    from getNumPages (zenpage-template-functions.php [2360])

    from include (search.php [29])

    from index.php [92]

    {Tue, 21 Aug 2012 14:49:07 GMT}

    Backtrace: NOTICE: Undefined index: in C:\mysites\nif\galleries\zp-core\class-search.php on line 1593

    SearchEngine->getSearchPages called

    from SearchEngine->getPages (class-search.php [1553])

    from getNumPages (zenpage-template-functions.php [2360])

    from include (search.php [29])

    from index.php [92]
    `
  • Thanks. I think I have found the problem. Try tonight's nightly build (changeset 10684).
  • Thank you. I think that fixed the issue.
Sign In or Register to comment.