<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Ranked Searches with&#160;SQL</title>
	<atom:link href="http://particletree.com/notebook/ranked-searches-with-sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://particletree.com/notebook/ranked-searches-with-sql/</link>
	<description>Everyone needs a hug.</description>
	<pubDate>Wed, 19 Nov 2008 11:32:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Jake</title>
		<link>http://particletree.com/notebook/ranked-searches-with-sql/#comment-24402</link>
		<dc:creator>Jake</dc:creator>
		<pubDate>Mon, 05 Nov 2007 07:55:41 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/notebook/ranked-searches-with-sql/#comment-24402</guid>
		<description>&lt;p&gt;Ready  to like&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Ready  to like</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Iqbal Naved</title>
		<link>http://particletree.com/notebook/ranked-searches-with-sql/#comment-24348</link>
		<dc:creator>Iqbal Naved</dc:creator>
		<pubDate>Mon, 29 Oct 2007 06:45:27 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/notebook/ranked-searches-with-sql/#comment-24348</guid>
		<description>&lt;p&gt;I think the best way to do this is to use the Full-Text Search Functions in MySql ie. MATCH (col1,col2,...) AGAINST (expr [IN BOOLEAN MODE &#124; WITH QUERY EXPANSION]). According to the MySQL manual :&lt;/p&gt;

&lt;p&gt;The MATCH() function performs a natural language search for a string against a text collection. A collection is a set of one or more columns included in a FULLTEXT index. The search string is given as the argument to AGAINST(). The search is performed in case-insensitive fashion. For every row in the table, MATCH() returns a relevance value, that is, a similarity measure between the search string and the text in that row in the columns named in the MATCH() list.&lt;/p&gt;

&lt;p&gt;When MATCH() is used in a WHERE clause, as in the preceding example, the rows returned are automatically sorted with the highest relevance first. Relevance values are non-negative floating-point numbers. Zero relevance means no similarity. Relevance is computed based on the number of words in the row, the number of unique words in that row, the total number of words in the collection, and the number of documents (rows) that contain a particular word.&lt;/p&gt;

&lt;p&gt;For natural-language full-text searches, it is a requirement that the columns named in the MATCH() function be the same columns included in some FULLTEXT index in your table. For the preceding query, note that the columns named in the MATCH() function (title and body) are the same as those named in the definition of the article table's FULLTEXT index. If you wanted to search the title or body separately, you would need to create FULLTEXT indexes for each column&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I think the best way to do this is to use the Full-Text Search Functions in MySql ie. MATCH (col1,col2,&#8230;) AGAINST (expr [IN BOOLEAN MODE | WITH QUERY EXPANSION]). According to the MySQL manual&#160;:</p>

<p>The MATCH() function performs a natural language search for a string against a text collection. A collection is a set of one or more columns included in a FULLTEXT index. The search string is given as the argument to AGAINST(). The search is performed in case-insensitive fashion. For every row in the table, MATCH() returns a relevance value, that is, a similarity measure between the search string and the text in that row in the columns named in the MATCH() list.</p>

<p>When MATCH() is used in a WHERE clause, as in the preceding example, the rows returned are automatically sorted with the highest relevance first. Relevance values are non-negative floating-point numbers. Zero relevance means no similarity. Relevance is computed based on the number of words in the row, the number of unique words in that row, the total number of words in the collection, and the number of documents (rows) that contain a particular word.</p>

<p>For natural-language full-text searches, it is a requirement that the columns named in the MATCH() function be the same columns included in some FULLTEXT index in your table. For the preceding query, note that the columns named in the MATCH() function (title and body) are the same as those named in the definition of the article table&#8217;s FULLTEXT index. If you wanted to search the title or body separately, you would need to create FULLTEXT indexes for each column</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Mihalcea Romeo</title>
		<link>http://particletree.com/notebook/ranked-searches-with-sql/#comment-24339</link>
		<dc:creator>Mihalcea Romeo</dc:creator>
		<pubDate>Sat, 27 Oct 2007 03:21:18 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/notebook/ranked-searches-with-sql/#comment-24339</guid>
		<description>&lt;p&gt;I think this is the best way to rank results by occurences for small to mid size websites as it outputs something relevant when it comes to the score result. Very nice example.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I think this is the best way to rank results by occurences for small to mid size websites as it outputs something relevant when it comes to the score result. Very nice example.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://particletree.com/notebook/ranked-searches-with-sql/#comment-24337</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Fri, 26 Oct 2007 16:18:11 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/notebook/ranked-searches-with-sql/#comment-24337</guid>
		<description>&lt;p&gt;This isn't relevant to your post, but what are you using for this comment system?  Whatever it is, I think it looks awesome.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This isn&#8217;t relevant to your post, but what are you using for this comment system?  Whatever it is, I think it looks awesome.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: ADG</title>
		<link>http://particletree.com/notebook/ranked-searches-with-sql/#comment-24333</link>
		<dc:creator>ADG</dc:creator>
		<pubDate>Fri, 26 Oct 2007 04:59:15 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/notebook/ranked-searches-with-sql/#comment-24333</guid>
		<description>&lt;p&gt;Wont it be significantly slower in SQL over say 100,000 rows, versus letting PHP handle the count?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Wont it be significantly slower in SQL over say 100,000 rows, versus letting PHP handle the count?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Campbell</title>
		<link>http://particletree.com/notebook/ranked-searches-with-sql/#comment-24326</link>
		<dc:creator>Ryan Campbell</dc:creator>
		<pubDate>Thu, 25 Oct 2007 15:40:08 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/notebook/ranked-searches-with-sql/#comment-24326</guid>
		<description>&lt;p&gt;I had the same thought, Adam. If I have a chance to run some tests, I'll post the results. Right now, it works fine for my dev environment with 1000 records and a one to many relationship join in the query. My guess would be that this doesn't scale too well though.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I had the same thought, Adam. If I have a chance to run some tests, I&#8217;ll post the results. Right now, it works fine for my dev environment with 1000 records and a one to many relationship join in the query. My guess would be that this doesn&#8217;t scale too well though.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Harmen Janssen</title>
		<link>http://particletree.com/notebook/ranked-searches-with-sql/#comment-24325</link>
		<dc:creator>Harmen Janssen</dc:creator>
		<pubDate>Thu, 25 Oct 2007 14:56:12 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/notebook/ranked-searches-with-sql/#comment-24325</guid>
		<description>&lt;p&gt;Awesome! Keep up these small SQL gems, they're very useful.
*bookmarked&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Awesome! Keep up these small SQL gems, they&#8217;re very useful.
*bookmarked</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Thody</title>
		<link>http://particletree.com/notebook/ranked-searches-with-sql/#comment-24324</link>
		<dc:creator>Adam Thody</dc:creator>
		<pubDate>Thu, 25 Oct 2007 12:08:41 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/notebook/ranked-searches-with-sql/#comment-24324</guid>
		<description>&lt;p&gt;Funny timing, I literally implemented Zend's Lucene search yesterday. In some preliminary testing, it's been VERY fast at returning results, but there are definitely some limitations as it's not fully developed. For example, wildcard searches for example aren't implemented yet, which is a huge drawback. It also converts numbers in your search string to spaces, so searching for "term1" will rank "term1", "term2", "term3" the same. I do think it will be a great solution given some time though...like I said, it's crazy fast.&lt;/p&gt;

&lt;p&gt;Ryan's solution is interesting, but I can't help but wonder about performance. While using SQL for the logic is a little more ninja, I can't help but feeling it will be slower, especially on large tables. Have you done any performance testing on this Ryan?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Funny timing, I literally implemented Zend&#8217;s Lucene search yesterday. In some preliminary testing, it&#8217;s been VERY fast at returning results, but there are definitely some limitations as it&#8217;s not fully developed. For example, wildcard searches for example aren&#8217;t implemented yet, which is a huge drawback. It also converts numbers in your search string to spaces, so searching for &#8220;term1&#8221; will rank &#8220;term1&#8221;, &#8220;term2&#8221;, &#8220;term3&#8221; the same. I do think it will be a great solution given some time though&#8230;like I said, it&#8217;s crazy fast.</p>

<p>Ryan&#8217;s solution is interesting, but I can&#8217;t help but wonder about performance. While using SQL for the logic is a little more ninja, I can&#8217;t help but feeling it will be slower, especially on large tables. Have you done any performance testing on this Ryan?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Campbell</title>
		<link>http://particletree.com/notebook/ranked-searches-with-sql/#comment-24317</link>
		<dc:creator>Ryan Campbell</dc:creator>
		<pubDate>Wed, 24 Oct 2007 19:25:11 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/notebook/ranked-searches-with-sql/#comment-24317</guid>
		<description>&lt;p&gt;Nathan, I've actually just begun implementing Lucene in a project. So far, it seems like a great solution. I'm new to it though, so still working out the indexing.&lt;/p&gt;

&lt;p&gt;Dave, your way should work also.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Nathan, I&#8217;ve actually just begun implementing Lucene in a project. So far, it seems like a great solution. I&#8217;m new to it though, so still working out the indexing.</p>

<p>Dave, your way should work also.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Hall</title>
		<link>http://particletree.com/notebook/ranked-searches-with-sql/#comment-24315</link>
		<dc:creator>Kevin Hall</dc:creator>
		<pubDate>Wed, 24 Oct 2007 18:19:01 +0000</pubDate>
		<guid isPermaLink="false">http://particletree.com/notebook/ranked-searches-with-sql/#comment-24315</guid>
		<description>&lt;p&gt;That's great... I was just trying to figure out a good way to do this when I didn't have fulltext indexing at my disposal in a database... thanks so much.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>That&#8217;s great&#8230; I was just trying to figure out a good way to do this when I didn&#8217;t have fulltext indexing at my disposal in a database&#8230; thanks so much.</p>]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.405 seconds -->
