Ticket #315 (closed defect: fixed)

Opened 6 years ago

Last modified 3 months ago

optimize and fix FullCategorySearchText ()

Reported by: DotMG Owned by: DotMG
Priority: normal Milestone: 1.3.1
Component: core Version: 1.1.6.2
Severity: normal Keywords: optimization linktracking category
Cc:

Description

Action {{category}} calls FullCategorySearchText, which searches for the word category name in the `body' field of **ALL** active pages. Not only this is inefficient (consumes too much resources), it also has an issue (If you simply put the word categorywiki inside a page, and if a page CategoryWiki exists and is a category, the page containing the word categorywiki will be listed as member of CategoryWiki).

This is how things should be done :

*FullCategorySearchText must search through the wikka_links table, and not wikka_pages *wikka_links table must be up to date everytime.

Related ticket: #313

Attachments

relink.php Download (2.5 KB) - added by vincent.fretin 6 years ago.
My implementation to rebuild the links table

Change History

Changed 6 years ago by DarTar

Mahefa,

it would be nice if you documented in a more detailed way the new optimisation code submitted as [179]. It's not clear to me what it does, when it has to be called and why. Maybe a general presentation of this new code could be added at wikkawiki.org? Also, consider that the phpdoc header should not contain developer notes, i.e. notes for oneself on what to fix, but a general documentation of the code, for developers who are not familiar with it. Bugs to be fixed can be added as @todo's. Furthermore, I see the code uses an obsolete regex, which doesn't take into account the new table formatters: http://wush.net/trac/wikka/browser/trunk/setup/links.php?rev=179#L47

Changed 6 years ago by DarTar

After updating my working copy, I have an encoding problem with the regex containing special characters in setup/links.php (line 58).

Here's how they look like in my local copy:

		"\{\{.*?\}\}|".																			# action
		"\b[A-ZÄÖÜ][A-Za-zÄÖÜßäöü]+[:](?![=_])\S*\b|".											# InterWiki link
		"\b([A-ZÄÖÜ]+[a-zßäöü]+[A-Z0-9ÄÖÜ][A-Za-z0-9ÄÖÜßäöü]*)\b".								# CamelWords

Changed 6 years ago by DarTar

I've fixed the above issues in [185] - please check and take care of the todo's.

Changed 6 years ago by vincent.fretin

My implementation to rebuild the links table

Changed 6 years ago by vincent.fretin

Your version to rebuild the links table is very very bad. It doesn't return the good results. Please test my version, copy the relink.php file into actions.

To use it, add {{relink}} to a page.

To execute it when you upgrade, in install.php

replace :

include('links.php');

by:

$wakka = new Wakka($config); $wakka->Action('relink');

Dump your links table before and after and kompare it.

Changed 6 years ago by DotMG

Vincent, I've compared the results of our 2 versions, and there was ABSOLUTELY no difference (except the date of the dump). I insisted in the way of not using Link() method as a matter of execution time. I need this process to be done as fast as possible, each milliseconds counts for me.

Please, could you mail me any example of page where my version does not return the good result? <dotmg@…> , use domain name users.sourceforge.net

Until then, I leave this ticket opened.

Changed 6 years ago by vincent.fretin

It's okay for me now. I found the same results. Thanks. I think you can close the ticket now.

Changed 6 years ago by DotMG

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from 1.1.7.1 to 1.1.7

Fixed [179]

Changed 5 years ago by DarTar

  • version changed from 1.1.6.2-beta to 1.1.6.2

Changed 3 years ago by DarTar

  • milestone changed from 1.2 to 1.3

Retargeting to 1.3, this ticket has already been closed in trunk, from which 1.3 will be branched. Consider backporting urgent issues to 1.2.X

Changed 15 months ago by BrianKoontz

  • milestone changed from 1.3 to 1.3.1

Updated milestone to 1.3.1

Changed 3 months ago by DotMG

(In [1850]) The new categorization process. refs #809, #313, #315, #233 Re-submitting [179], [185], [190]

Note: See TracTickets for help on using tickets.