Author Topic: Dynamic Field Searches  (Read 2438 times)

wilyba82

  • Newbie
  • *
  • Posts: 4
    • View Profile
Dynamic Field Searches
« on: March 19, 2007, 08:24:00 AM »
I have a lot of different reviews on my site totalling over 100. I it possible to add to the search mambot a few lines that would search the dynamic fields. This would be a huge lifesaver because right now I have the reviews and all the info in those fields.  Check it out at www.javelincts.com (http://www.javelincts.com)
As I mentioned in another thread I would be willing to create some tutorials for Simple Review in return for this help.
Thank you once again for the best review option on the internet bar none. It is a little cranky now and then but the programming commenting is so well done it is easy to fix anything I need to.

row1

  • SR Sole Developer
  • Hero Member
  • *****
  • Posts: 1244
    • View Profile
    • Sockware
Re: Dynamic Field Searches
« Reply #1 on: March 20, 2007, 12:10:43 AM »
Hi,
glad your getting some good use out of it  :D

Searching dynamics is a good idea and quite an easy change.
What you need to do is change the search bot code in simple_review.searchbot.php this should be in somewhere like www/joomla/mambots

On line 73 there should be something like:
Code: [Select]
$query = "SELECT CONCAT_WS( ' ', r.title1, r.title2, r.title3 ) AS title, r.title1, r.title2, r.title3, "
. "\n r.content AS text,"
. "\n DATE_FORMAT(r.createdDate, '"._SR_GLOBAL_DATE_FORMAT."') AS created,"
. "\n c.name as categoryName,"
. "\n '2' AS browsernav,"
. "\n r.reviewID AS reviewID, r.categoryID AS categoryID, score"
. "\n FROM #__simplereview_review AS r"
. "\n LEFT JOIN #__simplereview_category as c on r.categoryID = c.categoryID"
. "\n WHERE ( r.title1 LIKE '%$text%' or r.title2 LIKE '%$text%' or r.title3 LIKE '%$text%'"
. "\n OR r.content LIKE '%$text%' )"
. "\n AND r.published = '1'"
. "\n ORDER BY $order"
;

change it to:
Code: [Select]
$query = "SELECT CONCAT_WS( ' ', r.title1, r.title2, r.title3 ) AS title, r.title1, r.title2, r.title3, "
. "\n r.content AS text,"
. "\n DATE_FORMAT(r.createdDate, '"._SR_GLOBAL_DATE_FORMAT."') AS created,"
. "\n c.name as categoryName,"
. "\n '2' AS browsernav,"
. "\n r.reviewID AS reviewID, r.categoryID AS categoryID, score"
. "\n FROM #__simplereview_review AS r"
. "\n LEFT JOIN #__simplereview_category as c on r.categoryID = c.categoryID"
. "\n WHERE ( r.title1 LIKE '%$text%' or r.title2 LIKE '%$text%' or r.title3 LIKE '%$text%' or r.dynamicFields LIKE '%$text%' "
. "\n OR r.content LIKE '%$text%' )"
. "\n AND r.published = '1'"
. "\n ORDER BY $order"
;
the only difference is this line:
Code: [Select]
. "\n WHERE ( r.title1 LIKE '%$text%' or r.title2 LIKE '%$text%' or r.title3 LIKE '%$text%' or r.dynamicFields LIKE '%$text%' "

I have not tested this so I can't promise that it will work.
If it doesn't or you have any more questions feel free to ask.

Hopefully we can get some tutorials out of you  8)

thanks
If you find Simple Review useful please submit a Review (http://extensions.joomla.org/extensions/communities-&-groupware/ratings-&-reviews/4725/details), your positive reviews will help keep me going!
Please also make suggestions and possible improvements in the forum!

wilyba82

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Dynamic Field Searches
« Reply #2 on: March 20, 2007, 05:13:28 AM »
100% Functional in less than a couple minutes. I am not worthy, lol. Seeing as you just saved me hours of time with that beaut of a fix as promised I will host a few tutorials on my website www.javelincts.com. Look for them soon!

row1

  • SR Sole Developer
  • Hero Member
  • *****
  • Posts: 1244
    • View Profile
    • Sockware
Re: Dynamic Field Searches
« Reply #3 on: March 21, 2007, 11:02:31 PM »
Glad it worked  ;D
If you find Simple Review useful please submit a Review (http://extensions.joomla.org/extensions/communities-&-groupware/ratings-&-reviews/4725/details), your positive reviews will help keep me going!
Please also make suggestions and possible improvements in the forum!

wilyba82

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Dynamic Field Searches
« Reply #4 on: March 22, 2007, 05:22:16 AM »
I hope you like the review I posted on Joomla.org you deserve a medal. If you need any sort of hosting or help in any way drop me a line. I have a lot of projects on the go, but I am hoping to get to building out those tutorials very soon, hopefully in the next week. Cheers to the best review component.

row1

  • SR Sole Developer
  • Hero Member
  • *****
  • Posts: 1244
    • View Profile
    • Sockware
Re: Dynamic Field Searches
« Reply #5 on: March 22, 2007, 11:04:53 PM »
Hi,
I haven't seen the review, sometimes the review take a day to appear, thanks for that  :D

My hosting is sweet at the moment but thats anyway.
If you find Simple Review useful please submit a Review (http://extensions.joomla.org/extensions/communities-&-groupware/ratings-&-reviews/4725/details), your positive reviews will help keep me going!
Please also make suggestions and possible improvements in the forum!