Search returns no results

Get help with installation and running PivotX 2.0.x here. Please do not post Extension or Theme related questions here.

Search returns no results

Postby christofb » Tue May 31, 2011 3:02 pm

Hello,

whenever I do a seach I only get "No results for '...'." The strings I search for are longer than 3 characters and occur in entries. I also have more than 3 entries. I already tried rebuilding the cache, the index, the search index and the tag index. The indexes were recreated but nothing changed. I also tried with different templates. In the debug log I see the following messages:

<div class='timetaken'>2011-05-31 16:55:25 - <span class='timetaken'>0.070</span> -- modules/module_smarty.php:2781 / _smarty_link_entry() -- ( 8393552 ) </div>Can't creat
e entry link since uid isn't set.
<div class='timetaken'>2011-05-31 16:55:25 - <span class='timetaken'>0.099</span> -- modules/module_debug.php:414 / userErrorHandler() -- ( 8734260 ) </div><b>Warning</b>:
Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 494)
<b>Warning</b>: Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 500)
<b>Warning</b>: Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 494)
<b>Warning</b>: Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 500)
<b>Warning</b>: Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 494)
<b>Warning</b>: Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 500)
<b>Warning</b>: Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 494)
<b>Warning</b>: Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 500)
<b>Warning</b>: Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 494)
<b>Warning</b>: Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 500)
<b>Warning</b>: Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 494)
<b>Warning</b>: Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 500)
<b>Warning</b>: Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 494)
<b>Warning</b>: Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 500)
<b>Warning</b>: Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 494)
<b>Warning</b>: Invalid argument supplied for foreach(). (in <em>'modules/entries_flat.php'</em> on line 500)

I am using PivotX 2.2.6 with flat file db. I do not know since when this occured because my site is rather small so I don't use search that often. I know for sure that it worked with PivotX 2.0.X so it probably stopped working after an upgrade.

Any advice?

Regards,
Christof
christofb
 
Posts: 8
Joined: Thu Sep 09, 2010 3:17 pm

Re: Search returns no results

Postby hansfn » Tue May 31, 2011 4:43 pm

Those warnings are not relevant.

I'm always developing with flat file database and run my sites with flat file database, and I can't reproduce the problems.

A link to your site might help. You could check the files in db/search and see if you find some of the words you expect.
hansfn
Developer
 
Posts: 3072
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Search returns no results

Postby christofb » Wed Jun 01, 2011 9:09 am

Sadly I cannot provide a link to my site because it's behind my company's firewall. I checked the files in db/search and found that many words which appear in entries do not appear in the file with the corresponding first letter (a.php, b.php, ...). What are the criteria for a word to be included in those files? I also found that searching for some words which are contained in a file in db/search only produces a blank page which doesn't even have the message "Kein Treffer für '...'. Bitte einen anderen Suchbegriff nehmen." This happens for words containing characters like "." or "-".
christofb
 
Posts: 8
Joined: Thu Sep 09, 2010 3:17 pm

Re: Search returns no results

Postby hansfn » Wed Jun 01, 2011 9:34 am

Turn on debugging (in the configuration), rebuild index and then search index. Open the debug windows (after each indexing) and see if you got any errors.
hansfn
Developer
 
Posts: 3072
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Search returns no results

Postby christofb » Fri Oct 21, 2011 1:28 pm

I found out that the culprit is includes/strip_punctuation_preg_utf8.php. If I change includes/strip_punctuation.php so, that only US-ASCII punctuation is stripped, like this:

Code: Select all
if (false && @preg_match('/\p{L}/u', 'a') == 1) {
    require_once dirname(__FILE__) . '/strip_punctuation_preg_utf8.php';
} else {
    ...
}

then my search index get much larger. Without the change 393 words are indexed, with the change 4363 words are indeded. I checked the latest version (2.3) and saw that the file has not been changed so an upgrade obviously would not help. What can be done about this?

Regards,
Christof
christofb
 
Posts: 8
Joined: Thu Sep 09, 2010 3:17 pm

Re: Search returns no results

Postby hansfn » Thu Nov 17, 2011 9:23 am

I need either access to your server (FTP) or at least much more info about your server/setup to find the real problem. If we can't find a proper fix working for everyone, you'll have to patch that file every time you upgrade.
hansfn
Developer
 
Posts: 3072
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Search returns no results

Postby christofb » Thu Nov 17, 2011 1:43 pm

This is my config:

<removed>

System environment:
SUSE Linux Enterprise Server 10 (x86_64)

I tried to upload a zip file containing output of phpinfo.php, but I only got the error message: Could not upload attachment to ./files/863_1d850401fbbc6dfe6baab938f3f941ab.

This is the content of the core section of phpinfo:
PHP Version 5.3.1

Directive Local Value Master Value
allow_call_time_pass_reference On On
allow_url_fopen On On
allow_url_include Off Off
always_populate_raw_post_data Off Off
arg_separator.input & &
arg_separator.output & &
asp_tags Off Off
auto_append_file no value no value
auto_globals_jit On On
auto_prepend_file no value no value
browscap no value no value
default_charset no value no value
default_mimetype text/html text/html
define_syslog_variables Off Off
disable_classes no value no value
disable_functions no value no value
display_errors On On
display_startup_errors Off Off
doc_root no value no value
docref_ext no value no value
docref_root no value no value
enable_dl On On
error_append_string no value no value
error_log no value no value
error_prepend_string no value no value
error_reporting 22519 22519
exit_on_timeout Off Off
expose_php On On
extension_dir ./ ./
file_uploads On On
highlight.bg #FFFFFF #FFFFFF
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
html_errors On On
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path .:/home/oracle/product/as10g/mid1012/lib/php .:/home/oracle/product/as10g/mid1012/lib/php
log_errors Off Off
log_errors_max_len 1024 1024
magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
mail.add_x_header Off Off
mail.force_extra_parameters no value no value
mail.log no value no value
max_execution_time 30 30
max_file_uploads 20 20
max_input_nesting_level 64 64
max_input_time 60 60
memory_limit 128M 128M
open_basedir no value no value
output_buffering no value no value
output_handler no value no value
post_max_size 8M 8M
precision 12 12
realpath_cache_size 16K 16K
realpath_cache_ttl 120 120
register_argc_argv On On
register_globals Off Off
register_long_arrays On On
report_memleaks On On
report_zend_debug On On
request_order no value no value
safe_mode Off Off
safe_mode_exec_dir no value no value
safe_mode_gid Off Off
safe_mode_include_dir no value no value
sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
serialize_precision 100 100
short_open_tag On On
SMTP localhost localhost
smtp_port 25 25
sql.safe_mode Off Off
track_errors Off Off
unserialize_callback_func no value no value
upload_max_filesize 1000M 1000M
upload_tmp_dir no value no value
user_dir no value no value
user_ini.cache_ttl 300 300
user_ini.filename .user.ini .user.ini
variables_order EGPCS EGPCS
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
y2k_compliance On On
zend.enable_gc On On

Regards,
Christof
Last edited by christofb on Thu Nov 17, 2011 2:01 pm, edited 1 time in total.
christofb
 
Posts: 8
Joined: Thu Sep 09, 2010 3:17 pm

Re: Search returns no results

Postby hansfn » Thu Nov 17, 2011 1:54 pm

Thx, but I need more info from phpinfo - maybe just send it to hansfn@pivotx.net? (You can remove the PivotX config above.)
hansfn
Developer
 
Posts: 3072
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway


Return to 2.x Support Forum

Who is online

Users browsing this forum: No registered users and 2 guests

cron