0% and -nn% search results???

This is the place to discuss bugs that have been found in the most recent version of PivotX. Posting bugs will ensure that the Development Team is aware of them and that they will be addressed when resources are available.

0% and -nn% search results???

Postby VAXman » Wed Feb 08, 2012 12:28 pm

Is this a bug? An error in the collection or computation of the search results perhaps?

I did a search for a word that appears only in one entry. Search results correctly returned this entry but the percentage was listed as 0%. If I search for a word that appears in several entries, I again get the proper entries listed but percentages can be anywhere from 100% to some -nn%.

PivotX 2.3.1
PHP 5.3.6
Flat files.
VAXman
 
Posts: 5
Joined: Mon Jan 30, 2012 11:26 pm

Re: 0% and -nn% search results???

Postby VAXman » Wed Feb 08, 2012 2:45 pm

Nevermind. I see in module modulesearch.php in weighSearchResult() that there is an age penalty.

I copied out this routine, commented out the line:

// $weight -= $agepenalty;

put the result into a subdirectory of extensions as 'searchweight' and called it hook_searchweight.php

I added the required // header stuff and this:

$this->addHook(
'weigh_search_result',
'callback',
'hook_weighSearchResult'
);

To make a hook for the callout which exists in module_search.php.

No more NEGATIVES!!!
VAXman
 
Posts: 5
Joined: Mon Jan 30, 2012 11:26 pm

Re: 0% and -nn% search results???

Postby hansfn » Wed Feb 08, 2012 4:33 pm

Or just use the latest 2.3.x version (pivotx-2.3.x-latest.zip) from http://pivotx.net/files/unstable-development/

In other words, this has been fixed and will be part of 2.3.2.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: 0% and -nn% search results???

Postby VAXman » Wed Feb 08, 2012 7:45 pm

Wilco. However, this was as good a time as any to get my feet wet with the "hooks." Pretty simple.

I did make a modification to the actual source in 'scheduler.php' because I'm running this on VMS. VMS has a versioning file system. I wound up with a HUGE number of schedule.txt;n files used just to store a simple number. I modified the code to store the value in a VMS logical name that's define in the group logical table of the Apache server. It's ridiculous to save this time and time again in a file.

Also, I'd like an option for the list of "executable" files that the admin reports on. I'd like to be able to remove .COM!!!
VAXman
 
Posts: 5
Joined: Mon Jan 30, 2012 11:26 pm


Return to 2.x Bugs

Who is online

Users browsing this forum: No registered users and 2 guests

cron