Advertisement:

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

newmediologo

  • Newbie
  • *
  • Posts: 30
IMPORTANT - How to Have a really funcional Search
« on: December 11, 2012, 05:23:15 pm »
Very big problem with Search: If I search for "nissan" I find every Items titled as "nissan" or containing "nissan", If I search for "nis" or for "niss" I get nothing back..

A fully functional Search is a core feature for a classified site and the search function of OSClass must be improved..

Another thing is a Search without Keywords, just clicking on a category to dispaly all ads..

Did anyone knows how to refine this function..?

I cannot put my site online if the the Search just find only the "exact" keywords..

Thank You Very Much..

lucky_strike

  • Guest

sharkey

  • Full Member
  • ***
  • Posts: 102
Re: IMPORTANT - How to Have a really funcional Search
« Reply #2 on: December 11, 2012, 06:31:32 pm »
That thread doesn't solve the problem.  Nissan is not a 3 letter word.
Attribute search is poor with osclass.

newmediologo

  • Newbie
  • *
  • Posts: 30
Re: IMPORTANT - How to Have a really funcional Search
« Reply #3 on: December 11, 2012, 06:39:02 pm »
Problem is related to "exact" keyword, in my site if I search for "puppy" I can't a listing with "puppies", search just match the exact keyword and not the similar, It is not just a problem with the length of words..

sharkey

  • Full Member
  • ***
  • Posts: 102
Re: IMPORTANT - How to Have a really funcional Search
« Reply #4 on: December 11, 2012, 06:43:23 pm »
You need to create a custom attribute plugin so the search is dropdown, not user defined, for your category.

http://doc.osclass.org/How_to_extend_fields


xPxxRx

  • Jr. Member
  • **
  • Posts: 81
Re: IMPORTANT - How to Have a really funcional Search
« Reply #5 on: May 24, 2013, 02:33:19 pm »
need help to with this! I have an item titel like "Holzkohlegrill" - when I trie to search "Grill" there are no results... only if I search exactly the item title......

thats really a problem...!

Are there any solutions yet?

greeetz  :)

bwakad247

  • Full Member
  • ***
  • Posts: 221
Re: IMPORTANT - How to Have a really funcional Search
« Reply #6 on: May 25, 2013, 02:31:14 am »
In my case I use the Bender theme. There is little to no explenation as to what and how the search function operates.
Search is using sPattern and in my case searches in the description.
When I try to search for a certain word, part or the whole word is strong in the description. NOT the title.

darmeth

  • Jr. Member
  • **
  • Posts: 75
Re: IMPORTANT - How to Have a really funcional Search
« Reply #7 on: December 13, 2014, 09:39:27 pm »
Resurrecting a very old post. I am (still also suffering from the same problem described above).

EXAMPLE: Advert containing the word RESTAURANTS do not appear when searching for RESTAURANT. All that is missing is the letter S.

Has anyone ever been able to find a work around to this? Please?

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: IMPORTANT - How to Have a really funcional Search
« Reply #8 on: December 13, 2014, 10:41:39 pm »
***CORRECTED***

Hi,

Try this:

Add this at the very bottom of your theme functions.php (take care not to leave blank lines after this):

Code: [Select]
<?php
function cust_search_keyword_wildcard() {

        
$mSearch =  Search::newInstance();
        
$query_elements = (array) json_decode($mSearch->toJson());

        
$query_elements['sPattern'] = str_replace(' ''* '$query_elements['sPattern']) . '*';

        
$mSearch->setJsonAlert($query_elements);
}

if (
Params::getParam('sPattern')) osc_add_hook('search_conditions''cust_search_keyword_wildcard');
?>


Regards
« Last Edit: December 18, 2014, 09:37:14 pm by teseo »

darmeth

  • Jr. Member
  • **
  • Posts: 75
Re: IMPORTANT - How to Have a really funcional Search
« Reply #9 on: December 14, 2014, 12:02:58 am »
Hi Teseo,

Unfortunately, your solution does not change.  :-[

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: IMPORTANT - How to Have a really funcional Search
« Reply #10 on: December 14, 2014, 12:07:43 am »
What keyword are you using for testing, that "restaurant" example?

What version of Osclass are you running?
« Last Edit: December 14, 2014, 12:13:47 am by teseo »

darmeth

  • Jr. Member
  • **
  • Posts: 75
Re: IMPORTANT - How to Have a really funcional Search
« Reply #11 on: December 14, 2014, 12:12:55 am »
I am on 350 with Modern

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: IMPORTANT - How to Have a really funcional Search
« Reply #12 on: December 14, 2014, 12:14:05 am »
What keyword are you using for testing, that "restaurant" example?

Adyyda

  • Sr. Member
  • ****
  • Posts: 435
Re: IMPORTANT - How to Have a really funcional Search
« Reply #13 on: December 14, 2014, 12:16:44 am »
This is a major bug and i am surprised to see that it is on osclass script for 2 years... I hope that anyone will have a fix soon

darmeth

  • Jr. Member
  • **
  • Posts: 75
Re: IMPORTANT - How to Have a really funcional Search
« Reply #14 on: December 14, 2014, 12:20:38 am »
I've loaded your code on my test site. I have several ads with the word "number" in them.

When I search "num" or "numb", no results. It works if I search with "numb*" or "num*" but this already works without your code added.