Limited results on Search

Hello, I am using the last version from OJS. 3.1.1.2

The search system is not working as I expect.
You can access and heck the problem here:

By typing the word: tamarit on the search bar, I got just one result:
image

With the advance filters if I set the date of today, I got 3 results.

image

But that is not always… sometimes I got 2 results.

image

And the only way to get all the 3 results is by playing with the from date.

image

I want the search bar working as the Archive search bar from the backend works…:
image

Any idea how to debug this?.

Hi @josuevalrob,

You could try increasing the results_per_keyword setting in config.inc.php to see if that improves the matching.

Note that you can always rebuild the search index by running tools/rebuildSearchIndex.php – this can take quite a while to run – and also note that keyword results are cached for 24 hours, so you may need to reset your data cache in order to have the most recent results queried.

Regards,
Alec Smecher
Public Knowledge Project Team

thanks, magicallyt it works after 24 hours… I will try to rebuild the search index.

How do I run tools/rebuildSearchIndex.php?
By going to: http://5.56.56.37/CEDEX/tools/rebuildSearchIndex.php?

I get a Unknown database type.
@asmecher

Hi @josuevalrob,

You’ll need to run tools/rebuildSearchIndex.php using the command line, e.g. by logging into your server using SSH.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

thanks, I got

$ php rebuildSearchIndex.php 
<h1> Unknown database type!</h1>

Why is this? is there any related topic with reindexing files? @asmecher

Maybe it is becaouse I used XML import with out mails and country for the authors.

I had filled country and email for all my authos…

nothing change yet…

The internal search works perfectly.

Hi @josuevalrob,

Run it from the OJS installation directory, e.g.:

cd /path/to/your/ojs
php tools/rebuildSearchIndex.php

Regards,
Alec Smecher
Public Knowledge Project Team

I did it, but I got:

$ php tools/rebuildSearchIndex.php
<h1>Unknown database type!</h1>

I am on a IIS Server(?) Is this a problem?
Also, on my localhost with a XAMPP serve.
I am using php 7 in both.
The php error log is empty

@asmecher The responsible for that message is in Application.inc.php

/**
	 * Returns the name of the context column in plugin_settings
	 * @return string
	 */
	static function getPluginSettingsContextColumnName() {
		if (defined('SESSION_DISABLE_INIT')) {
			$pluginSettingsDao = DAORegistry::getDAO('PluginSettingsDAO');
			$driver = $pluginSettingsDao->getDriver();
			switch ($driver) {
				case 'mysql':
				case 'mysqli':
					$checkResult = $pluginSettingsDao->retrieve('SHOW COLUMNS FROM plugin_settings LIKE ?', array('context_id'));
					if ($checkResult->NumRows() == 0) {
						return 'journal_id';
					}
					break;
				case 'postgres':
					$checkResult = $pluginSettingsDao->retrieve('SELECT column_name FROM information_schema.columns WHERE table_name = ? AND column_name = ?', array('plugin_settings', 'context_id'));
					if ($checkResult->NumRows() == 0) {
						return 'journal_id';
					}
					break;
				default: fatalError('Unknown database type -- fck!');
			}
		}
		return 'context_id';
	}

I checked the $driver that was comming and found this:
var_dump($driver);
Mysql with Uppercase.
string(6) "MYSQLI"
So I changed the Case with:
case 'MYSQLI':
Maybe it was becasue in my config.inc.php I have:
[database]

driver = MYSQLI
host = localhost

Now it doesnt go to ‘unknow database type!’. but give me this error:

$ php rebuildSearchIndex.php
Restablecer índice ... hecho
Indexando "Ingeniería Civil" ... El sistema no puede encontrar la ruta esp
ecificada.

And repeat the message: The sistem cant find an specific route.

image

In the top left is the indexing process for my development site(IIS). At the right is the result in my localhost(XAMPP). At the button is the change at the $driver variable.

Hi @josuevalrob,

The driver should be mysqli, not MYSQLI.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like