Advertisement:

Author Topic: Search fails to find keyword in unless " Search in topic subjects only" checked  (Read 16533 times)

Offline draconins

  • Newbie
  • *
  • Posts: 5
Hi All,

I got an issue for search, which is for some reason it can not find a word which only appears in the subject of the post.
If I enable " Search in topic subjects only", the post can be found, but not when the " Search in topic subjects only" unchecked.

I suspect it is a search database part and I have manually patched http://www.simplemachines.org/community/index.php?topic=470906.0 into DbPackages-PostgreSQL and enable large index database as I got case insensitive search problem.

This is for PostGres 9.2 + SMF 2.0.7

Offline draconins

  • Newbie
  • *
  • Posts: 5
Patching here and there , mainly hxxp:github.com/SimpleMachines/SMF2.1/pull/785 [nonactive] improves the situation.
But still comes to error

2: preg_replace(): No ending delimiter '~' found
Apply Filter: Only show the errors from this file
File: C:/PHPWeb/Root/forum/Sources/DbSearch-postgresql.php

Any idea where it comes from? I have checked old post at http://www.simplemachines.org/community/index.php?topic=350920.0
but from what i can see, this is fixed already in 2.0.7


Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
What line is that error being generated on, and what code is on that line? Without that info it's tough to figure out what's going on.
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline draconins

  • Newbie
  • *
  • Posts: 5
Line 93

It is when    

if (isset($replacements[$identifier]))
==>93:    $db_string = preg_replace(array_keys($replacements[$identifier]), array_values($replacements[$identifier]), $db_string);
94:    elseif (preg_match('~^\s*INSERT\sIGNORE~i', $db_string) != 0)
95:    {
96:    $db_string = preg_replace('~^\s*INSERT\sIGNORE~i', 'INSERT', $db_string);
97:    // Don't error on multi-insert.
98:    $db_values['db_error_skip'] = true;
99:    }
100:    
101:    $return = $smcFunc['db_query']('', $db_string,
102:    $db_values, $connection
103:    );
104:    
105:    return $return;
106:    }

Offline draconins

  • Newbie
  • *
  • Posts: 5
looking on variable replacement

It seems on the following part:
'create_tmp_log_search_messages' => array(
         '~mediumint\(\d\)' => 'int',
         '~unsigned~i' => '',
         '~ENGINE=MEMORY~i' => '',
      ),

It is missing "~i" on the trailing

Offline draconins

  • Newbie
  • *
  • Posts: 5
Seems fixing the above part solves the problem. The location is on line 68 on same file.

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Oh I forgot to say thanks for the debugging and the fix...

Thanks! ;D


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non รจ una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.