WordPress.org

Support

Support » Plugins and Hacks » Fixed Search Everything so it searches metadata, slugs, excerps properly

Fixed Search Everything so it searches metadata, slugs, excerps properly

  • 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;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hasn’t this been resolved?

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fixed Search Everything so it searches metadata, slugs, excerps properly’ is closed to new replies.