Keyword

Search K2 Problem

More
15 years 3 months ago #77813 by Pomba
Search K2 Problem was created by Pomba
Hello there,I'm having a problem with searching through my items.By choosing "All words" or "Any words" I'm not getting any results. I also get this error message; "Warning: Invalid argument supplied for foreach() in /home/xdxpnet/public_html/plugins/search/k2.php on line 282" When I choose "Exact Phrase" it works.Any way to fix it - and, where I can edit the style for searching? Certain things there I don't want to be shown.All plugins should be activated. Check out the site here.

Please Log in or Create an account to join the conversation.

More
15 years 3 months ago #77814 by Kaleb Camacho
Replied by Kaleb Camacho on topic Search K2 Problem
Hello,

I want to thank you for a such a powerful extension.

I'm looking into using jxextend's finder with k2 but thought I should mention that I too am having the same issue with the search except the error is on 142 of the k2.php.

When I choose exact phrase it works as well. Take care and thanks again.

-Kaleb

Please Log in or Create an account to join the conversation.

More
15 years 3 months ago #77815 by Pomba
Replied by Pomba on topic Search K2 Problem
Removed the error message now, but search still don't give any results.

Tried everything. Really annoying!! :-)

Please Log in or Create an account to join the conversation.

More
15 years 3 months ago #77816 by Pomba
Replied by Pomba on topic Search K2 Problem
Can't figure it out. Any solutions?

Please Log in or Create an account to join the conversation.

More
15 years 2 months ago #77817 by d.k.shukla
Replied by d.k.shukla on topic Search K2 Problem
Hi
I had also got the same error of line 142 and after experimenting I had discovered that search plug in file k2.php of older version v2.1 (September 9th, 2009) is working fine and performing full text search without any error.
I am hoping that developer will look in to it.

Pomba said:Can't figure it out. Any solutions?

Please Log in or Create an account to join the conversation.

More
15 years 2 months ago #77818 by Stephen Robb
Replied by Stephen Robb on topic Search K2 Problem
I am having the same problem. The issues seems to be with the SELECT statement, and specifically the "MATCH AGAINST" clause. I'm no SQL admin, but I can extract the query K2 is sending using debug mode and edit the query to work using LIKE, but I can't get it to work with the MATCH construct. Note that the exact match option uses "BOOLEAN MODE" in the match, and this seems to work for me too.

To me it looks like K2 is creating some invalid SQL.

This works (i.e. returns rows) where search string is found:

SELECT * FROM jos_k2_items as i WHERE MATCH(i.title, i.introtext, i.`fulltext`,i.extra_fields_search,i.image_caption,i.image_credits,i.video_caption,i.video_credits,i.metadesc,i.metakey) AGAINST ('"searchstring"' IN BOOLEAN MODE)

This doesn't work (i.e. returns no rows, neither in Joomla or in phpMyAdmin):

SELECT * FROM jos_k2_items as i WHERE
MATCH(i.title, i.introtext, i.`fulltext`,i.image_caption,i.image_credits,i.video_caption,i.video_credits,i.extra_fields_search,i.metadesc,i.metakey) AGAINST ('searchsrring')

Please Log in or Create an account to join the conversation.

More
15 years 2 months ago #77819 by d.k.shukla
Replied by d.k.shukla on topic Search K2 Problem
Hi
I would like to share my other experience about full text search with latest K2 ver 2.2, it is working fine without any error at my local machine. My local system information is following.
PHP Built on: Linux 2.6.32-ARCH #1 SMP PREEMPT Thu Jan 7 22:28:29 CET 2010 x86_64
Database Version: 5.1.42
Database Collation: utf8_general_ci
PHP Version: 5.3.1
Web Server: Apache/2.2.14 (Unix) PHP/5.3.1 with Suhosin-Patch Phusion_Passenger/2.2.2
Web Server to PHP interface: apache2handler
Joomla! Version: Joomla! 1.5.15 Stable [ Wojmamni Ama Mamni ] 05-November-2009 04:00 GMT
User Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100105 Shiretoko/3.5.7

After doing this test it seems that error is coming due to Mysql version but I am not sure.

I hope somebody will fix this error or express their views on this behaviour.

Shukla


Stephen Robb said:I am having the same problem. The issues seems to be with the SELECT statement, and specifically the "MATCH AGAINST" clause. I'm no SQL admin, but I can extract the query K2 is sending using debug mode and edit the query to work using LIKE, but I can't get it to work with the MATCH construct. Note that the exact match option uses "BOOLEAN MODE" in the match, and this seems to work for me too.
To me it looks like K2 is creating some invalid SQL.

This works (i.e. returns rows) where search string is found:

SELECT * FROM jos_k2_items as i WHERE MATCH(i.title, i.introtext, i.`fulltext`,i.extra_fields_search,i.image_caption,i.image_credits,i.video_caption,i.video_credits,i.metadesc,i.metakey) AGAINST ('"searchstring"' IN BOOLEAN MODE)

This doesn't work (i.e. returns no rows, neither in Joomla or in phpMyAdmin):

SELECT * FROM jos_k2_items as i WHERE
MATCH(i.title, i.introtext, i.`fulltext`,i.image_caption,i.image_credits,i.video_caption,i.video_credits,i.extra_fields_search,i.metadesc,i.metakey) AGAINST ('searchsrring')

Please Log in or Create an account to join the conversation.

More
15 years 2 months ago #77820 by Stephen Robb
Replied by Stephen Robb on topic Search K2 Problem
I have been doing some more analysis on this and think I have found what the problem might be (in my case at least). It's to do with the way FULLTEXT search works in MySQL. My apologies for blaming K2.

My database consist of car models and most are identified by a 3-digit model number (e.g. 911, 962, 956 etc). MySQL seems to exclude these criteria from the search, along with the car brand (e.g. 'Porsche'), which occurs in more than 50% of the rows within the table.

This page tells you how to modify the search to include 3-character words...
dev.mysql.com/doc/refman/5.1/en/fulltext-fine-tuning.html

Please Log in or Create an account to join the conversation.

More
15 years 2 months ago #77821 by Simon Wells
Replied by Simon Wells on topic Search K2 Problem
Pomba, can you post details of your fix so others know how to do it?

K2Joom


Pomba said:Removed the error message now, but search still don't give any results.
Tried everything. Really annoying!! :-)

Please Log in or Create an account to join the conversation.

More
15 years 2 months ago #77822 by Donovan Ryan Hay
Replied by Donovan Ryan Hay on topic Search K2 Problem
THANKS A MILL!! Dude, you are seriously a life saver!! THANK YOU! I hope the search function gets fixed soon, but this is working 100% for now. Thanks!

d.k.shukla said:Hi I had also got the same error of line 142 and after experimenting I had discovered that search plug in file k2.php of older version v2.1 (September 9th, 2009) is working fine and performing full text search without any error.
I am hoping that developer will look in to it.

Pomba said:Can't figure it out. Any solutions?

Please Log in or Create an account to join the conversation.

More
15 years 2 months ago #77823 by Pomba
Replied by Pomba on topic Search K2 Problem
Where can you get this file?

d.k.shukla said:Hi I had also got the same error of line 142 and after experimenting I had discovered that search plug in file k2.php of older version v2.1 (September 9th, 2009) is working fine and performing full text search without any error. I am hoping that developer will look in to it.

Pomba said:Can't figure it out. Any solutions?

Please Log in or Create an account to join the conversation.

More
15 years 2 months ago #77824 by Stephen Robb
Replied by Stephen Robb on topic Search K2 Problem
Hi Alwin,

I had this issue at one point and figured that the fields in the FULLTEXT search had to match exactly the fields with this flag set. (i.e. I needed to include all of the fields with FULLTEXT set in the MATCH clause). If you do that, you won't get the above error.

Stephen

Alwin said:I also have the same problem. When I run the query in mysql it is showing
ERROR 1191 (HY000): Can't find FULLTEXT index matching the column list.

and I think that is some problem with the FULLTEXT indexing...Anyone has got a solution..? also please let me know where I get the old file ...?

Please Log in or Create an account to join the conversation.

More
15 years 2 months ago #77825 by Hilary Cheyne
Replied by Hilary Cheyne on topic Search K2 Problem
My temporary fix.

Had the line 142 error

added RokAjax Search
extensions.joomla.org/extensions/search-a-indexing/site-search/9011

Then had the line 282 error

So thanks to this thread:

Downloaded the old file here September 11:

code.google.com/p/joomlaworks/source/browse/trunk/K2/plugins/search/k2/k2.php?spec=svn67&r=55

The errors have gone and search working as far as I can tell.

There must have been good reasons for K2 to update the file so it can only be a temporary fix which works.

Hils

Please Log in or Create an account to join the conversation.

More
15 years 2 months ago #77826 by James McCarthy
Replied by James McCarthy on topic Search K2 Problem
I just upgraded and now have this search error. Exact phrase searches work fine but default All Words errors out. I'm going to revert back to the old search plugin.

Please Log in or Create an account to join the conversation.

More
15 years 2 months ago #77827 by James McCarthy
Replied by James McCarthy on topic Search K2 Problem
I just compared the code for both the old and new versions of the search plugin - major differences, which makes me a little worried about using the old file to get around this bug (but it does seem to work okay and the new one definitely doesn't).

Please Log in or Create an account to join the conversation.

More
15 years 2 months ago #77828 by Arturo Guzman
Replied by Arturo Guzman on topic Search K2 Problem
Hi,

The problem is when trying to search in the tags, if you turn it off from the Search_K2 plugin parameters, the error won't show anymore, of course you'll lose the tag searching functionality.

As far as I can tell, this is a bug in the K2 Search plugin, since it uses MySQL's MATCH function incorrectly. So the best thing to do is to go back to the old plugin, where the search is done using the LIKE operator.

In the MySQL Site it explains that the MATCH function in NATURAL LANGUAGE MODE performs a search against a text collection, and a text collection can only exist within a table. When the plugin tries to search the tags it adds a foreign column into the MATCH function, which of course breaks the query.

Art.

Please Log in or Create an account to join the conversation.

More
15 years 2 months ago #77829 by philip locke
Replied by philip locke on topic Search K2 Problem
Hi All

We have simply used the standard Joomla search (mod_search). Because, as Fotis has pointed out recently the K2 search box in mod_k2_tools module is simply a form which calls up com_search but pulls back in a blog view.

So what have we done...

Using the latest J! & latest K2 v2.2 - as seen on this website: www.mousetrap.org.uk

1. We have enabled the J! mod_search
2. Created an HTML override in the templates folder
3. We copied the com_search into the templates/my-template/html/

We didn't want the K2, Articles, Sections, Categories, Web Links, etc, checkboxes to show in the search results page, so we did the following:

1. In Admin, went to Plugin Manager and disabled the following:
...Search - Content
...Search - Weblinks
...Search - Contacts
...Search - Categories
...Search - Sections
...Search - Newsfeeds
2. We left the 'Search - K2' plugin enabled, as we wanted to search all K2 items.

The only problem is that the K2 checkbox was still visable on the search results page, so we did the following:

1. In the html override folder (as above - templates/my-template/html/com_search) we edited the 'default_form.php' file.
2. Deleted lines 32 to 42 (as screenshot shows)



Done ;-)

Hope this helps... or is an good altrenative for someone out there
Phil

Please Log in or Create an account to join the conversation.

More
15 years 2 months ago #77830 by Simon Wells
Replied by Simon Wells on topic Search K2 Problem
Hi Phil,
Just some comments, from my test of this.

1) I have always had J! Search enabled, infact all search plugins are enabled
3) Copied com_search to my template folder Avanti.
For those that use Avanti from Joomlabamboo, there already is a com_search folder but it does not contain the same files as the original search component.

I am not interested to turn off the check boxes, to be honest, I would love to actually see some check boxes to prove it works so I have not followed any of the other steps.

At this stage, still no check boxes appear, still no indication that the results are even a search page.
Again, I noticed that there is a mod_search folder in my Avanti template folders which just contained index.html and default.php so I copied the mod_search to the template.

K2 search still not working correctly.
J! search is displaying K2 items with K2 tick box so shall now be using J! Search as default and remove K2 search.

Frustrating problem this one.

Thanks Phil, hope this help some users.

Simon

Please Log in or Create an account to join the conversation.

More
15 years 1 month ago #77831 by Roland Wampers
Replied by Roland Wampers on topic Search K2 Problem
This worked for me, after several other tries (allthoug in my case, search only works well with standard search and not with RokAjax search) Thanks a lot for posting this solution.

Hilary Cheyne said:My temporary fix. Had the line 142 error
added RokAjax Search
extensions.joomla.org/extensions/search-a-indexing/site-sear...

Then had the line 282 error

So thanks to this thread:

Downloaded the old file here September 11:

code.google.com/p/joomlaworks/source/browse/trunk/K2/plugins...

The errors have gone and search working as far as I can tell.

There must have been good reasons for K2 to update the file so it can only be a temporary fix which works.

Hils

Please Log in or Create an account to join the conversation.

More
15 years 1 month ago #77832 by Simon Wells
Replied by Simon Wells on topic Search K2 Problem
I now have Joomla and RokAjaxSearch working on K2Joom, check this page ow.ly/1c6J7
However, K2 search still produces full item not the list.
There were NO changes to Rok, it just worked upon install folowing changes to mod/com search changes.

So much has gone on over the weeked, my head is still spinning, but I will be going through all com/mod search files to compare changes.
I also have a further demo site which Rok is not working on, so will then verify the changes on that site.

Finally, I will then make 1 further virgin J! install, with K2 V2.2 and Ajaxsearch to completley test out before publishing the results.

Looks like progress has been made.

Thanks to you all.

Simon
K2Joom.com

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum