WordPress.org

Ready to get started?Download WordPress

Forums

Fixed Search Everything so it searches metadata, slugs, excerps properly (3 posts)

  1. snakefoot
    Member
    Posted 6 years ago #

    Right now when including excerps in search, then it only matches the complete search sentence and not every single term in the sentence.

    Right now when including metadata in search, then it automatically includes pages, even if having configured pages not to be included.

    Right now it is not possible to search the permalink-slug.

    I have fixed the problem for Search Everything 3.9.9. Please report if the code contains any bugs.

    //search excerpts
    function SE3_search_excerpt($where) {
       $where = preg_replace("/ OR \(post_content LIKE \'\%([^\%]*)\%/", " OR (post_content LIKE '%$1%') OR (post_excerpt LIKE '%$1%", $where);
       SE3_log("excerpts where: ".$where);
       return $where;
    }
    
    //search slugs
    function SE3_search_slug($where) {
       $where = preg_replace("/ OR \(post_content LIKE \'\%([^\%]*)\%/", " OR (post_content LIKE '%$1%') OR (post_name LIKE '%$1%", $where);
       SE3_log("slugs where: ".$where);
       return $where;
    }
    
    //search metadata
    function SE3_search_metadata($where) {
       $where = preg_replace("/ OR \(post_content LIKE \'\%([^\%]*)\%/", " OR (post_content LIKE '%$1%') OR (meta_value LIKE '%$1%", $where);
       SE3_log("metadata where: ".$where);
       return $where;
    }
  2. Dan Cameron
    Member
    Posted 6 years ago #

    Hasn't this been resolved?

  3. snakefoot
    Member
    Posted 5 years ago #

    This has not been resolved:

    Right now when including excerps (or metadata) in search, then it only matches the complete search sentence and not every single term in the sentence.

    Right now it is not possible to search the permalink-slug.

Topic Closed

This topic has been closed to new replies.

About this Topic