Make the Search "not to" index/scan the listing description.

This topic contains 10 replies, has 3 voices, and was last updated by  Manfred Van Ursel 4 years, 5 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #513080

    Manfred Van Ursel
    Expired Member
    Post count: 295

    In GD V1 and I suppose in V2 as well, we have a “way too sensitive” search, and if we casually include a word like “food” on a listing description that is not related to food (for example using the expression “food for thought”), it will appear on a “food-related” search.

    My client feraked out because of this.

    How can we tell the search tool not to search by description but only by title, tags and categories?

    Thanks,

    #513136

    Alex Rollin
    Moderator
    Post count: 27815

    Hello,

    as far as I know this is not possible without a customization but I will check with the developers in case there is a workaround. Thanks for your patience while we look into it.

    A

    #513159

    Kiran
    Moderator
    Post count: 7069

    Hi Manfred,

    Add following PHP snippet to don’t search in post description.

    
    
    
    /**
     * Skip searching in post description.
     */
    function gd_snippet_191015_search_content_where( $content_where ) {
    	$content_where = '';
    	
    	return $content_where;
    }
    add_filter( 'geodir_search_content_where', 'gd_snippet_191015_search_content_where', 20, 1 );

    Regards,
    Kiran

    #513291

    Manfred Van Ursel
    Expired Member
    Post count: 295

    This is awesome, thanks!!

    #513484

    Manfred Van Ursel
    Expired Member
    Post count: 295

    Is the search cached / indexed somewhere? As we seem to stumble upon the same search results but we added this code. Thanks,

    #513509

    Kiran
    Moderator
    Post count: 7069

    Hi Manfred,

    Provide example urls of search in which you see same results.

    Kiran

    #513610

    Manfred Van Ursel
    Expired Member
    Post count: 295
    This reply has been marked as private.
    #513688

    Kiran
    Moderator
    Post count: 7069

    Hi Manfred,

    Where did you added snippet that provided at here? #513159

    Kiran

    #513787

    Manfred Van Ursel
    Expired Member
    Post count: 295

    I added it to my functions.php (Supreme child theme).

    #514079

    Kiran
    Moderator
    Post count: 7069

    Hi Manfred,

    I checked functions.php file in supreme directory theme and there is no snippet found there.

    Kiran

    #514507

    Manfred Van Ursel
    Expired Member
    Post count: 295

    I added it by FTP and it worked thanks.

Viewing 11 posts - 1 through 11 (of 11 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket