Page 1 of 1

Phoca Download Search not returning exact phrase results

Posted: 29 Jan 2015, 19:35
by clingc
Hello everyone,

I recently installed the Phoca Download Search plugin so that the search on my site will also return Phoca documents in the results.

The problem I am having is that if we use an exact phrase search by containing the phrase in double quotes (ie, "some exact phrase"), the result is not returned. Searching for the individual words in the phrase returns the results expected.

Can someone assist me? Is there something that needs to be changed for the Phoca Download Search to have it see the double quotes as an exact search like the joomla search does?

Thank you!

Re: Phoca Download Search not returning exact phrase results

Posted: 29 Jan 2015, 22:31
by Jan
Hi, which version you are using?

To see and edit the SQL query for the search, see:
plugins/search/phocadownload/phocadownload.php

:idea:

Jan

Re: Phoca Download Search not returning exact phrase results

Posted: 30 Jan 2015, 20:26
by clingc
Hello Jan,

I am using version 2.0.1 of the search plugin.

The only change I have made to the plugins/search/phocadownload/phocadownload.php file is to change it to default to file view:

line 273:
$listFiles[$key]->href = JRoute::_(PhocaDownloadHelperRoute::getFileRoute($value->id, $value->catid, $value->alias));


The rest of the code is as it was from install. I see two switch cases for "exact" searches and the query that is there. But I am not sure if it is 1) getting exact as the case and/or 2) needs changes to the actual query?

:?

Re: Phoca Download Search not returning exact phrase results

Posted: 31 Jan 2015, 00:42
by Jan
The difference is:

Code: Select all

$text		= $db->Quote('%'.$db->getEscaped($text, true).'%', false);
and

Code: Select all

$word		= $db->Quote('%'.$db->getEscaped($word, true).'%', false);
if you search "abc def"

in 1) case: file which includes "abc def" will be searched
in 2) case: file which include "abc" or "def" will be sarched

Jan

Re: Phoca Download Search not returning exact phrase results

Posted: 02 Feb 2015, 17:23
by clingc
Jan,

I see that the case 1 you listed is being used when $phrase is "exact" and case 2 is used when $phrase is "all" or "any" or default.

But when I use my site search, if I type in the search:

diagram outlining
- I get 2 document results that have these two words in the description (highlighted separately)

but if I type in the search:

"diagram outlining"
- I get 0 results.

Re: Phoca Download Search not returning exact phrase results

Posted: 07 Feb 2015, 22:40
by Jan
And if you remove the quotes and set exact phrase in search settings :idea: