<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>bbPress support forums Topic: Sometimes strange search results (no post_text?)</title>
<link>http://bbpress.org/forums/</link>
<description>bbPress support forums Topic: Sometimes strange search results (no post_text?)</description>
<language>en</language>
<pubDate>Tue, 02 Dec 2008 12:05:01 +0000</pubDate>

<item>
<title>Null on "Sometimes strange search results (no post_text?)"</title>
<link>http://bbpress.org/forums/topic/sometimes-strange-search-results-no-post_text#post-3266</link>
<pubDate>Wed, 17 Jan 2007 11:04:22 +0000</pubDate>
<dc:creator>Null</dc:creator>
<guid isPermaLink="false">3266@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Did you report it as a bug? (if it is one)
&#60;/p&#62;</description>
</item>
<item>
<title>chrishajer on "Sometimes strange search results (no post_text?)"</title>
<link>http://bbpress.org/forums/topic/sometimes-strange-search-results-no-post_text#post-3175</link>
<pubDate>Sat, 13 Jan 2007 02:57:02 +0000</pubDate>
<dc:creator>chrishajer</dc:creator>
<guid isPermaLink="false">3175@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;--selfish bump--&#60;/p&#62;
&#60;p&#62;I coded around this (hack!)  to make it work with PHP5, but is anyone seeing the same type of results that I was with PHP5?
&#60;/p&#62;</description>
</item>
<item>
<title>chrishajer on "Sometimes strange search results (no post_text?)"</title>
<link>http://bbpress.org/forums/topic/sometimes-strange-search-results-no-post_text#post-2823</link>
<pubDate>Tue, 02 Jan 2007 23:56:22 +0000</pubDate>
<dc:creator>chrishajer</dc:creator>
<guid isPermaLink="false">2823@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Narrowed it down a little bit.  When using PHP 5.2.0, the results are odd for some posts, as described above.  When using PHP 4.4.4, the search results are normal and as expected.  Could be something different with the install or the compiled options.  But, this is a little bit of the problem.  In the phpinfo, one small thing I noted is that PCRE is version 6.6 in PHP4 and version 6.7 in PHP5.  Is there anything else I can check in the phpinfo that would be helpful?
&#60;/p&#62;</description>
</item>
<item>
<title>chrishajer on "Sometimes strange search results (no post_text?)"</title>
<link>http://bbpress.org/forums/topic/sometimes-strange-search-results-no-post_text#post-2746</link>
<pubDate>Mon, 01 Jan 2007 04:26:34 +0000</pubDate>
<dc:creator>chrishajer</dc:creator>
<guid isPermaLink="false">2746@http://bbpress.org/forums/</guid>
<description>&#60;p&#62;Sometimes, when I search my forum, I get search results with a title and post meta (date, poster name, etc.) but the context of the search term is not shown.  It appears this piece of code is returning nothing (in bb-templates/search.php):&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#38;lt;?php echo show_context($q, $bb_post-&#38;gt;post_text); ?&#38;gt;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Here's the function from bb-includes/formatting-functions.php, which I don't understand:&#60;br /&#62;
&#60;code&#62;function show_context( $term, $text ) {&#60;br /&#62;
        $text = strip_tags($text);&#60;br /&#62;
        $term = preg_quote($term);&#60;br /&#62;
        $text = preg_replace(&#38;quot;&#124;.*?(.{0,80})$term(.{0,80}).*&#124;is&#38;quot;, &#38;quot;... $1&#38;lt;strong&#38;gt;$term&#38;lt;/strong&#38;gt;$2 ...&#38;quot;, $text, 1);&#60;br /&#62;
        $text = substr($text, 0, 210);&#60;br /&#62;
        return $text;&#60;br /&#62;
}&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;The source of the search results page just shows &#60;code&#62;&#60;br /&#62;
&#60;/code&#62; where that context would be shown.&#60;/p&#62;
&#60;p&#62;Is it possible that only the first (however many) characters/words are searched and used for context?  It seems like when the results are missing, it's because the search term appears late in a lengthy post.&#60;/p&#62;
&#60;p&#62;In one instance I checked, the search term is word 674, around 3796 characters into the post.  Total length of that post is 1360 words,   7546 characters.&#60;/p&#62;
&#60;p&#62;In another instance, the search term is word 1423, starting around character 8487.  Total length on this post is 2661 words, 15604 characters.&#60;/p&#62;
&#60;p&#62;It has happened in other instances, but I never looked into where the term appears in the post to see if that's related at all.  Maybe it's not related at all to where the search term is in the post, but just how long the post is?&#60;/p&#62;
&#60;p&#62;Also: I have edited the search.php file (should have put a copy in my-templates/search.php, but I didn't know then what I know now) BUT the same results happen with the stock &#60;code&#62;bb-templates/search.php&#60;/code&#62;.&#60;/p&#62;
&#60;p&#62;Any ideas?&#60;br /&#62;
Thanks
&#60;/p&#62;</description>
</item>

</channel>
</rss>
