WPFTS Pro Main Site WPFTS Community Forum
    • Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. EpsilonAdmin
    3. Best
    Get WPFTS Pro today with 25% discount!
    • Profile
    • Following 0
    • Followers 0
    • Topics 35
    • Posts 212
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Best Practices for Implementing Full-Text Search in Large Databases ??

      Hi @marcellosalass

      Actually WPFTS could be not that great for you in case you have millions of records (e.g. posts).
      The whole Wordpress could be not good for you either, because to handle such amount of data you will need to use specific optimization and caching algorithms and even clustering.

      I would like to propose you to use full-text solutions based on Apache Solr or Elastic Search - those tools are implemented in Java and work way faster than PHP+MySQL solution provided by WPFTS and they are especially good for big data.

      Alternatively you can wait until we release a new WPFTS version (in 1-2 months) that can use self-hosted Elastic Search engine to keep full-text index and uses WPFTS data collecting algorithms.

      Thank you for the question.

      posted in General Discussion
      EpsilonAdminE
      EpsilonAdmin
    • RE: Documentation pages down?

      Hi @inkedraskal

      Thank you for this report. It was an issue on documentation server and now it's fixed.

      Please check if it look better now.

      Thanks!

      posted in Bugs and Fixes
      EpsilonAdminE
      EpsilonAdmin
    • RE: Filter and sort result list

      Hi @ilocimwca

      It's simple to do with this addon
      https://fulltextsearch.org/wpfts-addon-files-only-1.0.1.zip

      It contains some code to limit post_type to 'attachment' only:

      add_action('pre_get_posts', function(&$wpq)
      {
      	if ($wpq->is_search && $wpq->is_main_query()) {
      		$wpq->set('post_type', array('attachment'));
      		$wpq->set('post_status', array('inherit'));
      	}
      });
      

      Pretty simple. If you want to set up your own post_types, just modify this code. You can read about full WP_Query() parameters at the Wordpress official documentation.

      posted in Frequently Asked Questions
      EpsilonAdminE
      EpsilonAdmin
    • RE: metadata filter in WPFTS widget

      Hi @pfb6736

      1. Yes, you can do this via CSS, either by adding a new rule to your Theme custom CSS block, or you can use WPFTS Settings / Search & Output / Display / Smart Excerpts CSS editor block.
        I hope it's .widget.widget-search rule, you can set 'width: 100%' to extend widget's width to all available room.

      2. The plugin is growing, but we have not yet a powerful system to make customized search widgets. What I can propose to you is (depending on your PHP/WP knowledge): there is a file /includes/widgets/wpfts_widget.class.php which is actually a native WP search widget with some changes for Live Search functionality.
        I would recommend you to copy this file to your child theme and create your own widget (by adding a select input to existing code). In case you think your knowledge of PHP is not that good, I can gladly help you, but you need to explain to me what exactly you need.

      3. Yes, it's possible via the small code addition. Do you want to show a path to the file instead of the file title? Or it should be an additional line in the search result item? Do you think showing a local path to the file is OKAY and maybe it's better to show Category instead?

      4. As I can see they are highlighted (bolded) but you can change this again in the Smart Excerpts CSS block. For example, this rule will make found words RED and YELLOW highlighted.

      .wpfts-result-item .wpfts-smart-excerpt b {	
      	/* Excerpt text */
      	color: red;
      	background-color: #ff3;
      }
      

      Thanks.

      posted in Recipes and Known Solutions
      EpsilonAdminE
      EpsilonAdmin
    • Is it possible to make 2 different searches on the same website?

      Yes, actually you can make more than one search, the number of search filters is not limited.

      Each search filter can have it's own preset, which can be selected in the "WPFTS :: Live Search" widget option and thus will be automatically activated when someone makes a search with this specific widget instance.

      Let me explain to you in two words how to do this.

      Imagine, you want to have 2 different searches on your website: the main search (which searches for posts and pages only) and another search that will search for PDF files only.

      Okay, let's say we already have the main search configured, we only need to disable the "Search in Files" option (available in WPFTS Settings > Search & Output > Filter).

      Let's create another search filter that will search in PDF files only.

      add_action ('init', function()
      {
      	global $wpfts_core;
      
      	if ((!is_object($wpfts_core)) || (!$wpfts_core)) {
      		return;
      	}
      	
      	if (method_exists($wpfts_core, 'AddWidgetPreset')) {
      
      		// Repeat this block as much as you need
      		$wpfts_core->AddWidgetPreset('pdfonly', array(	// 'pdfonly' is the ID of your preset
      			'title' => 'PDF Only',		// This is a title of your preset (shown in WPFTS :: Live Search selector)
      			'filter' => 'pdfonly',		// This is the ID or the filter (can be the same as the preset name)
      			'results_url' => '/',		// The results page URL, it should be existing URL on your website
      			'autocomplete_mode' => 1,	// Should autosuggestion be ON for this widget?
      		));
      
      		// Put another preset here if you need that
      		// ...
      	}
      }, 255);
      

      Not hard, right? But that's not all. Now we need to force some WP_Query() parameters in case someone uses this preset.

      add_action('wpfts_pre_get_posts', function(&$wpq, $wdata)
      {
      	// The filter processor for the custom widget
      	if ($wdata['id'] == 'pdfonly') {	// Use your filter name here (not preset name, however they can be the same)
      		// Let's set up specific parameters for this filter
      		// Please refer to WP_Query() official documentation for possible parameters
                      // The WPFTS-specific parameters also will work here, check this link for them:
      		// https://fulltextsearch.org/docs/wpfts-api-description/extended-wp_query/
      
      		$wpq->set('post_type', 'attachment');
      		$wpq->set('post_status',  array('inherit'));
      	}
      
      	// Repeat the filter processor block for each your widget
      	// ...
      
      }, 20, 2);
      

      Here is it. You need to place this code in the functions.php file of your current theme.

      When it's done, you can place the WPFTS :: Live Search widget to the specific page and then select your preset ("PDF Only" in our case) from the select box.

      posted in Frequently Asked Questions multiple search widgets presets filters
      EpsilonAdminE
      EpsilonAdmin
    • RE: Full Site Editing Theme - Theme Compatibility Hook

      Hi @inkedraskal

      Thank you very much, I am going to examine this theme code and return back with my idea or even Hook code.

      Thanks!

      posted in Frequently Asked Questions
      EpsilonAdminE
      EpsilonAdmin