Search fails to find keyword in unless " Search in topic subjects only" checked

Started by draconins, March 05, 2014, 07:05:00 PM

Previous topic - Next topic

draconins

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

draconins

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


Oldiesmann

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
Christian Metal Fans

draconins

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:    }

draconins

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

draconins

Seems fixing the above part solves the problem. The location is on line 68 on same file.

emanuele



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.

Advertisement: