Advertisement:

Author Topic: IMPORTANT - How to Have a really funcional Search  (Read 10222 times)

Pigeon

  • Sr. Member
  • ****
  • Posts: 498
Re: IMPORTANT - How to Have a really funcional Search
« Reply #60 on: September 07, 2016, 05:08:20 am »
.
« Last Edit: September 09, 2016, 02:16:11 am by Pigeon »

Pigeon

  • Sr. Member
  • ****
  • Posts: 498
Re: IMPORTANT - How to Have a really funcional Search
« Reply #61 on: September 09, 2016, 02:16:27 am »
?

Pigeon

  • Sr. Member
  • ****
  • Posts: 498
Re: IMPORTANT - How to Have a really funcional Search
« Reply #62 on: September 13, 2016, 07:42:49 am »
?



_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4689
Re: IMPORTANT - How to Have a really funcional Search
« Reply #65 on: September 14, 2016, 10:00:30 am »
Because the original question is answered already, you asked a different one and I don't have time to answer every single question posted in the forums.

You need to modify the osc_highlight function to your needs. Please, create a new topic for each different question and show what modifications did you already made.

Pigeon

  • Sr. Member
  • ****
  • Posts: 498
Re: IMPORTANT - How to Have a really funcional Search
« Reply #66 on: September 14, 2016, 10:50:16 pm »
Because the original question is answered already, you asked a different one and I don't have time to answer every single question posted in the forums.

You need to modify the osc_highlight function to your needs. Please, create a new topic for each different question and show what modifications did you already made.

thank you very much, yes now  made one  ;)

BabyDunk

  • Jr. Member
  • **
  • Posts: 66
  • I Am A Noob But I Am Here To Learn. :D
Re: IMPORTANT - How to Have a really funcional Search
« Reply #67 on: September 16, 2016, 05:26:52 am »
Hello and thank you for the previous help i have received

i am now wondering is it possible to add listing id to this search function?? that would be excellent if possible.

thanks

ezybusy

  • Full Member
  • ***
  • Posts: 193
Re: IMPORTANT - How to Have a really funcional Search
« Reply #68 on: September 16, 2016, 12:32:23 pm »
BabyDunk,  if you are trying to search item by Id there is a plugin for that.
I can't remember the name or where I saw it, but I came across it some days ago.

BabyDunk

  • Jr. Member
  • **
  • Posts: 66
  • I Am A Noob But I Am Here To Learn. :D
Re: IMPORTANT - How to Have a really funcional Search
« Reply #69 on: September 16, 2016, 04:06:09 pm »
thanks ezybusy.

i will have a look shortly.
« Last Edit: September 16, 2016, 08:04:01 pm by BabyDunk »

BabyDunk

  • Jr. Member
  • **
  • Posts: 66
  • I Am A Noob But I Am Here To Learn. :D
Re: IMPORTANT - How to Have a really funcional Search
« Reply #70 on: September 21, 2016, 02:37:41 am »
@ezybusy
thanks for the info but i cant find the plugin you are talking about. i have searched on and off for a few days.

does anyone else know of this plugin??

or

is it possible to add the function search by item Id to this already brilliant code?  ;) ;D ::)

thanks

BabyDunk

  • Jr. Member
  • **
  • Posts: 66
  • I Am A Noob But I Am Here To Learn. :D
Re: IMPORTANT - How to Have a really funcional Search
« Reply #71 on: September 21, 2016, 03:13:35 am »
can anyone tell me if im going in the right direction??


Code: [Select]
<?php
//Add Username search function to the search engine
function cust_search_keyword_wildcard_with_user_username($params) {

    if (
$params['sPattern']) {
        
$mSearch =  Search::newInstance();
        
$query_elements = (array) json_decode($mSearch->toJson());
        
$pattern $query_elements['sPattern'];
  
        
$query_elements['sPattern'] = str_replace(' ''* '$pattern) . '*';

        
$mSearch->setJsonAlert($query_elements);

        
// Search by user.Username too
        
$mSearch->addJoinTable(count($query_elements['tables_join']), DB_TABLE_PREFIX."t_user u""fk_i_user_id = u.pk_i_id"'INNER');
        
        
$aPattern explode(' '$pattern);
        
$userNameCond '';
        
$userItemCond '';

        foreach (
$aPattern as $word) {
            if (
$word$userNameCond .= sprintf(" || u.s_username = '%s'"$word);
        }
        
        foreach (
$aPattern as $item) {
            if (
$item$userItemCond .= sprintf(" || t_item_description.fk_i_item_id = '%s'"$item);
        }

        
$mSearch->addConditions("1 = 1 " $userNameCond);
        
$mSearch->addConditions("1 = 1 " $userItemCond);
        
$mSearch->addGroupBy(DB_TABLE_PREFIX.'t_item.pk_i_id');
        
     }
}

osc_add_hook('search_conditions''cust_search_keyword_wildcard_with_user_username'1);
?>


thanks