<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: And Search Returns&#8230;?</title>
	<atom:link href="http://third-bit.com/blog/archives/1765.html/feed" rel="self" type="application/rss+xml" />
	<link>http://third-bit.com/blog/archives/1765.html</link>
	<description>Data is ones and zeroes &#124; Software is ones and zeroes and hard work.</description>
	<lastBuildDate>Fri, 03 Feb 2012 17:07:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: DrObvious</title>
		<link>http://third-bit.com/blog/archives/1765.html#comment-2303</link>
		<dc:creator>DrObvious</dc:creator>
		<pubDate>Fri, 17 Oct 2008 05:21:33 +0000</pubDate>
		<guid isPermaLink="false">http://pyre.third-bit.com/blog/archives/1765.html#comment-2303</guid>
		<description>Answered your own question with SearchResult, but use composition, not inheritance.  i.e. wrap the item in a search result.</description>
		<content:encoded><![CDATA[<p>Answered your own question with SearchResult, but use composition, not inheritance.  i.e. wrap the item in a search result.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kosta Zabashta</title>
		<link>http://third-bit.com/blog/archives/1765.html#comment-2302</link>
		<dc:creator>Kosta Zabashta</dc:creator>
		<pubDate>Thu, 16 Oct 2008 19:50:05 +0000</pubDate>
		<guid isPermaLink="false">http://pyre.third-bit.com/blog/archives/1765.html#comment-2302</guid>
		<description>I can see the pros and cons of both solutions.

Returning the actual models.
PROS: they&#039;re already there, no need to create extra classes.
CONS: it might be difficult to abstract the models. How tickets and wikis are searched is different (search fields). The search needs more information about the models to know which fields to search for.

Creating custom objects.
PROS: we have control over the logic for performing search by subclassing SearchResult. Polymorphism will allow the caller to handle search results uniformly, and if they want to get clever they can check the type and do something custom for wiki/ticket results. Seems like a good OO design.
CONS: adds extra objects. Also, any time a new model is created that has to be indexed and searched, it also needs a corresponding Result object.

I&#039;m +1 towards the latter.</description>
		<content:encoded><![CDATA[<p>I can see the pros and cons of both solutions.</p>
<p>Returning the actual models.<br />
PROS: they&#8217;re already there, no need to create extra classes.<br />
CONS: it might be difficult to abstract the models. How tickets and wikis are searched is different (search fields). The search needs more information about the models to know which fields to search for.</p>
<p>Creating custom objects.<br />
PROS: we have control over the logic for performing search by subclassing SearchResult. Polymorphism will allow the caller to handle search results uniformly, and if they want to get clever they can check the type and do something custom for wiki/ticket results. Seems like a good OO design.<br />
CONS: adds extra objects. Also, any time a new model is created that has to be indexed and searched, it also needs a corresponding Result object.</p>
<p>I&#8217;m +1 towards the latter.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gavin Terrill</title>
		<link>http://third-bit.com/blog/archives/1765.html#comment-2301</link>
		<dc:creator>Gavin Terrill</dc:creator>
		<pubDate>Thu, 16 Oct 2008 18:49:56 +0000</pubDate>
		<guid isPermaLink="false">http://pyre.third-bit.com/blog/archives/1765.html#comment-2301</guid>
		<description>Sounds like a potential fit for &lt;a href=&quot;http://www.opensearch.org/Home&quot; rel=&quot;nofollow&quot;&gt;OpenSearch&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Sounds like a potential fit for <a href="http://www.opensearch.org/Home" rel="nofollow">OpenSearch</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Boothe</title>
		<link>http://third-bit.com/blog/archives/1765.html#comment-2300</link>
		<dc:creator>Peter Boothe</dc:creator>
		<pubDate>Thu, 16 Oct 2008 18:20:07 +0000</pubDate>
		<guid isPermaLink="false">http://pyre.third-bit.com/blog/archives/1765.html#comment-2300</guid>
		<description>Your search results should look as much like Google&#039;s as possible.  That is what people are conditioned to expect searches to look like.  If you want to put a little tag to the left, so people can see &quot;ticket&quot;, &quot;wiki page&quot;, &quot;faq&quot;, &quot;comment&quot;, and the like, then go ahead.  But I think that people want search results to look like other search results from other sites.  Otherwise users will have to think, and they hate that.

To do that, it definitely seems like search(string) should return a series of items that are, at the very least, convertible into URLs.  Why not just return the objects themselves?  A Ticket or a WikiPage or a whatever.  Then each of them should have a method entitle URL() that will give you the URL for that item, but perhaps another entitled &quot;__str__()&quot; or whatever the local equivalent is for the language you are using that will give a good text representation.

But it seems like search(string) should return a sequence of objects, and those objects should be THE objects, and not a double-indirection thing like TicketSearchResult, but instead just be Tickets and WikiPages, etc.</description>
		<content:encoded><![CDATA[<p>Your search results should look as much like Google&#8217;s as possible.  That is what people are conditioned to expect searches to look like.  If you want to put a little tag to the left, so people can see &#8220;ticket&#8221;, &#8220;wiki page&#8221;, &#8220;faq&#8221;, &#8220;comment&#8221;, and the like, then go ahead.  But I think that people want search results to look like other search results from other sites.  Otherwise users will have to think, and they hate that.</p>
<p>To do that, it definitely seems like search(string) should return a series of items that are, at the very least, convertible into URLs.  Why not just return the objects themselves?  A Ticket or a WikiPage or a whatever.  Then each of them should have a method entitle URL() that will give you the URL for that item, but perhaps another entitled &#8220;__str__()&#8221; or whatever the local equivalent is for the language you are using that will give a good text representation.</p>
<p>But it seems like search(string) should return a sequence of objects, and those objects should be THE objects, and not a double-indirection thing like TicketSearchResult, but instead just be Tickets and WikiPages, etc.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

