Wordgraph : custom query

Post Reply

Topic author
arukAdo
Active Member
Posts: 4
Joined: 10. November 2008 09:33

Wordgraph : custom query

Post by arukAdo »

Hello,

Im using wordgraph block, it work very good and exactly like it should

But id like to change a few things in the file wordgraph.php, im not sure whats the best and look for some help in order to make it, the fastest for sql and not too heavy for php

I understand how it was intend to work (catch "top" words) but that doesnt fit me

What i aim for is doing 3 (or more) array of keywords that i define manualy myself:

Code: Select all

$wordz1 = array( "text", "text" );$wordz2 = array( "text", "text" );$wordz3 = array( "text", "text" );
My search index is quite big (15000+ posts) and id like to modify the sql so it try to catch only my array of words (and not only the top words)
I use a 0% parameter (all words are in index)
The top words are off course the most common, but anyway what matter is i have a real keyword list already (suited to my site), and they are of course less top than what i want (or then the % is too high)
What im sure is my list of keywords will never been catched like i want if i use a auto setting, some are a lot repeat, some are near never used too

So far what i do is under:

Code: Select all

foreach ( $words as $word ) {
I put another test :

Code: Select all

if (in_array($word, $wordz1)) {
(then i will put || and wordz2 ect...)

So my question is how can i make the sql only select my $wordz1 list of words
Also, how to deal with 2 words pattern, + seem not to be ok (to have the result of composed words or small expression)

This is the part i need to change but i dont realy understand

Code: Select all

$words_array = array();

// Get words and number of those words
$sql = 'SELECT l.word_text, COUNT(*) AS word_count  
	FROM ' . SEARCH_WORDLIST_TABLE . ' AS l, ' . SEARCH_WORDMATCH_TABLE . ' AS m
	WHERE m.word_id = l.word_id 
	GROUP BY m.word_id 
	ORDER BY word_count DESC';
$result = $db->sql_query_limit($sql, $portal_config['portal_wordgraph_max_words']);
Any help is welcome! :D

Also, i believe with my list word, i should be able to limit the sql query
Unmodded the wordgraph take around 2 sec query
With my changes take about 4 sec (need to set to 0 max words in acp)
If possible to get under 2 seconds would also nice

Topic author
arukAdo
Active Member
Posts: 4
Joined: 10. November 2008 09:33

Re: Wordgraph : custom query

Post by arukAdo »

Nobody have a hint for me?
Post Reply

Return to “Modifications Support”