Extended WP_Query

You can control the WPFTS plugin search function using some additional parameters for WP_Query().

Here they are:

  • wpfts_disable
    0 (default value) = WPFTS Search is enabled;
    1 = WPFTS Search is disabled, and the usual WP search is used)
  • wpfts_nocache
    0 (default value) = The MySQL query cache will be used for search,
    1 = disable search – useful for benchmarking or to solve some issues)
  • word_logic
    (set ‘and’ or ‘or’ to specify the default search logic. “and” – only post records which have all words from the search phrase will be added to search results, “or” – all the posts containing at least one word from the queried phrase will be added to the search result)
  • cluster_weights
    an array contains key-value pairs like “post_content” => 0.5 which will be used for relevance calculations. You can effectively remove specific post parts from the search by setting the respective cluster weight to 0. For example, if you want to search for posts by post_title only, you can set up “post_title” => 1.0 and all other cluster weights to 0.
  • deeper_search
    0 (default value) will always search words that have the same beginning part as the queried word,
    1 = will try to search queried words in the middle of words). The value 1 definitely not recommended since it forces MySQL to make much more job.
  • limit_mimetypes
    A set of media mimetypes which are allowed to be shown in search results. There is a difference with native WP “post_mime_type” parameter. The WP native parameter will block usual posts and pages when “post_mime_type” is specified. Aside from this, “limit_mimetypes” will leave posts with empty “mime_type” allowed, so media files and usual posts can be shown in the same search results. The “limit_mimetypes” always override “post_mime_type” when set.



0 0 votes
Article Rating
This entry was posted in . Bookmark the permalink.
Notify of
Inline Feedbacks
View all comments