<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Problem with ACF generated fields]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I work on a design, I build from the ground up for a special project. (This means, the theme won't be available anywhere else...)</p>
<p dir="auto">In this theme I work with a lot of custom post types and custom fields (generated by ACF)</p>
<p dir="auto">Since acf fields aren't using post_meta but are only available via get_field('&lt;fieldname&gt;'), and I don't want to write new lines of code for every field into the functions.php I changed the routine you suggest in your Documentation like this:</p>
<pre><code>add_filter('wpfts_index_post', function($index, $post) {
	
	global $wpdb;
	
	$index[get_post_type()] = implode(' ',get_fields($post-&gt;ID));
	
	return $index;
	
}, 3, 2);
</code></pre>
<p dir="auto">It seems to work. In the SandBox at least. When I type in there a searchterm which can only be found in one of those custom fields, I get the correct results in the TestSearch Area.<br />
But I do get a "nothing can be found" non-result when I try to find the term using the search.php. The title of one of the custom posts creates the right result, but not the the entry from the custom field.</p>
<p dir="auto">Here is my search.php (it isn't really designed yet, it's just for proof of concept...)</p>
<pre><code>	$s=get_search_query();
	$args = array(
                's' =&gt;$s
            );
    // The Query
$the_query = new WP_Query( $args );
if ( $the_query-&gt;have_posts() ) {
        _e("&lt;h2 style='color:#1c1c1c'&gt;Search Results for: ".get_query_var('s')."&lt;/h2&gt;");
        while ( $the_query-&gt;have_posts() ) {
           $the_query-&gt;the_post();
                 ?&gt;
                    &lt;li&gt;
                        &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;
                    &lt;/li&gt;
                 &lt;?php
        }
    }else{
?&gt;
        &lt;h2 style='color:#1c1c1c'&gt;Nothing Found&lt;/h2&gt;
        &lt;div class="alert alert-info"&gt;
          &lt;p&gt;Sorry, but nothing matched your search criteria. Please try again with some different keywords.&lt;/p&gt;
	&lt;/div&gt;&lt;/main&gt;
&lt;?php } 
 

</code></pre>
<p dir="auto">What can I do?</p>
<p dir="auto">Best<br />
Martin</p>
]]></description><link>https://fulltextsearch.org/forum/topic/89/problem-with-acf-generated-fields</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Mar 2026 23:37:00 GMT</lastBuildDate><atom:link href="https://fulltextsearch.org/forum/topic/89.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 11 Aug 2021 14:42:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem with ACF generated fields on Thu, 12 Aug 2021 17:23:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/epsilonadmin">@<bdi>epsilonadmin</bdi></a></p>
<p dir="auto">Thanks!</p>
<p dir="auto">It does!!! It works.</p>
<p dir="auto">Thanks for your hard work!!!</p>
]]></description><link>https://fulltextsearch.org/forum/post/248</link><guid isPermaLink="true">https://fulltextsearch.org/forum/post/248</guid><dc:creator><![CDATA[Dornfeld]]></dc:creator><pubDate>Thu, 12 Aug 2021 17:23:16 GMT</pubDate></item><item><title><![CDATA[Reply to Problem with ACF generated fields on Thu, 12 Aug 2021 17:21:08 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/dornfeld">@<bdi>dornfeld</bdi></a></p>
<p dir="auto">Basically, you should not call WP_Query again inside the <code>search.php</code> because WP is calling this template automatically AFTER the main query is executed.</p>
<p dir="auto">By default, the WPFTS is applied to the main query only (to avoid interference with other plugins and themes), but you can force WPFTS usage in your custom WP_Query calls too.</p>
<p dir="auto">The solution for you is:</p>
<ol>
<li>
<p dir="auto">You can remove your own WP_Query() call and the respective code and use standard WP methods.</p>
</li>
<li>
<p dir="auto">You can add the parameter "wpfts_is_force =&gt; 1" to your WP_Query() parameters to force WPFTS execution.</p>
</li>
</ol>
<p dir="auto">Also, in case you don't use the main query, the Smart Excerpts will be also disabled. To force them, please add these two lines before have_posts() (before the loop, only once)</p>
<pre><code class="language-php">global $wpfts_core;

$wpfts_core-&gt;ForceSmartExcerpts(isset($_GET['s']) ? $_GET['s'] : '');
</code></pre>
<p dir="auto">Hope this will help.</p>
]]></description><link>https://fulltextsearch.org/forum/post/247</link><guid isPermaLink="true">https://fulltextsearch.org/forum/post/247</guid><dc:creator><![CDATA[EpsilonAdmin]]></dc:creator><pubDate>Thu, 12 Aug 2021 17:21:08 GMT</pubDate></item></channel></rss>