Keyword

K2 AJAX Search Module

  • Lee Tempest
  • Lee Tempest's Avatar Topic Author
  • Offline
  • New Member
More
7 years 2 months ago #162690 by Lee Tempest
K2 AJAX Search Module was created by Lee Tempest
Hello,
Is it possible to modify the K2 AJAX Search Module so that it only searches on the K2 Item title and not the entire item?

I've tried looking in the module code but cannot see any obvious place.

Thanks

Lee

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 2 months ago #162700 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 AJAX Search Module
Hello Lee,

We are not affiliated with this module.
Unfortunately I am not familiar with the module either.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Lee Tempest
  • Lee Tempest's Avatar Topic Author
  • Offline
  • New Member
More
7 years 2 months ago #162706 by Lee Tempest
Replied by Lee Tempest on topic K2 AJAX Search Module
I actually found the solution, open up:

plugins/k2ajaxsearch/k2ajaxsearch/k2ajaxsearch.php

Around line 100 and 125 is this code:

$wheres2 = array();
$wheres2[] = 'i.title LIKE '.$text;
$wheres2[] = 'i.introtext LIKE '.$text;
$wheres2[] = 'i.fulltext LIKE '.$text;
$wheres2[] = 'i.extra_fields_search LIKE '.$text;
$wheres2[] = 'i.image_caption LIKE '.$text;
$wheres2[] = 'i.image_credits LIKE '.$text;
$wheres2[] = 'i.video_caption LIKE '.$text;
$wheres2[] = 'i.video_credits LIKE '.$text;
$wheres2[] = 'i.metadesc LIKE '.$text;
$wheres2[] = 'i.metakey LIKE '.$text;
$wheres2[] = 'i.created_by_alias LIKE '.$text;

Then comment out the lines you do not want the module to search through. Save and upload the modified file and then test your search.

Hope that helps.

Lee

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 2 months ago #162708 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 AJAX Search Module
Nice one Lee :)

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum