OS Property support center

Location / Keywords Search Box

  • jeffrey
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
10 years 3 months ago #63936 by jeffrey
Location / Keywords Search Box was created by jeffrey
Hi, May i know how to set the Location / Keywords in search box is only match to title and location of the Advertisement put in by agent / owner?
Currently i facing the problems if i keyed-in some keywords in the search box. All the keywords in title, location and description match to the keywords i searching will be appear on my search results. (Please see the attachment for screen snap shoot)
I wish to switch "OFF" the search results is match to description, and made it "ON" only to the keywords is match with Title, Location information only.

Best Regards,

Jeffrey

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

More
10 years 3 months ago #63944 by Dang Thuc Dam
Replied by Dang Thuc Dam on topic Location / Keywords Search Box
Hi Jeffrey,
You can modify the Advanced search function of OS Property at file:

components > com_osproperty > classes > listing.php

Find
Code:
if($address != ""){ $address = str_replace(";","",$address); if(strpos($address,",")){ $addressArr = explode(",",$address); if(count($addressArr) > 0){ $where .= " AND ("; foreach ($addressArr as $address_item){ $where .= " a.ref like '%$address_item%' OR"; $where .= " a.pro_name$lang_suffix like '%$address_item%' OR"; $where .= " a.address like '%$address_item%' OR"; $where .= " a.region like '%$address_item%' OR"; $where .= " a.postcode like '%$address_item%' OR"; $where .= " g.state_name$lang_suffix like '%$address_item%' OR"; $where .= " h.city$lang_suffix like '%$address_item%' OR"; } $where = substr($where,0,strlen($where)-2); $where .= " )"; } }else{ $where .= " AND ("; $where .= " a.ref like '%$address%' OR"; $where .= " a.pro_name$lang_suffix like '%$address%' OR"; $where .= " a.address like '%$address%' OR"; $where .= " a.region like '%$address%' OR"; $where .= " g.state_name$lang_suffix like '%$address%' OR"; $where .= " h.city$lang_suffix like '%$address%' OR"; $where .= " a.postcode like '%$address%'"; $where .= " )"; } $no_search = false; }

and change to
Code:
if($address != ""){ $where .= " AND ("; $where .= " a.ref like '%$address%' OR"; $where .= " a.pro_name$lang_suffix like '%$address%' OR"; $where .= " a.address like '%$address%' OR"; $where .= " a.region like '%$address%' OR"; $where .= " g.state_name$lang_suffix like '%$address%' OR"; $where .= " h.city$lang_suffix like '%$address%' OR"; $where .= " a.postcode like '%$address%'"; $where .= " )"; $no_search = false; }

Good luck
Dam

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

Moderators: Dang Thuc DamNguyen Phu Quan