<?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: Fun with WebService::Solr, Part I of III</title>
	<atom:link href="http://infomotions.com/blog/2009/01/fun-with-webservicesolr-part-i-of-iii/feed/" rel="self" type="application/rss+xml" />
	<link>http://infomotions.com/blog/2009/01/fun-with-webservicesolr-part-i-of-iii/</link>
	<description>Thoughts in libraries and librarianship</description>
	<lastBuildDate>Thu, 03 Sep 2009 14:26:26 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Infomotions Mini-Musings &#187; Blog Archive &#187; Indexing and searching the Alex Catalogue / Eric Lease Morgan</title>
		<link>http://infomotions.com/blog/2009/01/fun-with-webservicesolr-part-i-of-iii/comment-page-1/#comment-1165</link>
		<dc:creator>Infomotions Mini-Musings &#187; Blog Archive &#187; Indexing and searching the Alex Catalogue / Eric Lease Morgan</dc:creator>
		<pubDate>Tue, 18 Aug 2009 01:24:04 +0000</pubDate>
		<guid isPermaLink="false">http://infomotions.com/blog/?p=118#comment-1165</guid>
		<description>[...] well, and interfacing with it was made much simpler through the use of a set of Perl modules called WebService::Solr. On the other hand, there are many ways the index could be improved such as implementing [...]</description>
		<content:encoded><![CDATA[<p>[...] well, and interfacing with it was made much simpler through the use of a set of Perl modules called WebService::Solr. On the other hand, there are many ways the index could be improved such as implementing [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Lease Morgan</title>
		<link>http://infomotions.com/blog/2009/01/fun-with-webservicesolr-part-i-of-iii/comment-page-1/#comment-842</link>
		<dc:creator>Eric Lease Morgan</dc:creator>
		<pubDate>Fri, 23 Jan 2009 01:49:59 +0000</pubDate>
		<guid isPermaLink="false">http://infomotions.com/blog/?p=118#comment-842</guid>
		<description>The source code to Parts I, II, and III are available at http://infomotions.com/blog/wp-content/uploads/2009/01/fun-with-webservice-solr.tar.gz</description>
		<content:encoded><![CDATA[<p>The source code to Parts I, II, and III are available at <a href="http://infomotions.com/blog/wp-content/uploads/2009/01/fun-with-webservice-solr.tar.gz" rel="nofollow">http://infomotions.com/blog/wp-content/uploads/2009/01/fun-with-webservice-solr.tar.gz</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Lease Morgan</title>
		<link>http://infomotions.com/blog/2009/01/fun-with-webservicesolr-part-i-of-iii/comment-page-1/#comment-811</link>
		<dc:creator>Eric Lease Morgan</dc:creator>
		<pubDate>Sat, 10 Jan 2009 18:48:15 +0000</pubDate>
		<guid isPermaLink="false">http://infomotions.com/blog/?p=118#comment-811</guid>
		<description>&lt;p&gt;
The following is a comment from Brian Cassidy, a co-author of WebService::Solr. &quot;Re-printed&quot; with permission:
&lt;/p&gt;


&lt;blockquote&gt;&lt;p&gt;
I just noticed your 1st of a series of articles on WebService::Solr. Looks great so far! :)
&lt;/p&gt;

&lt;p&gt;
Here are some comments about the code:
&lt;/p&gt;

&lt;p&gt;
In the first script, you could probably use the much simpler syntax for add() rather than then full-on OOP way with Document and Field objects:
&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;my $id  = WebService::Solr::Field-&gt;new( id  =&gt; $index );
my $title = WebService::Solr::Field-&gt;new( title =&gt; $_ );
my $doc = WebService::Solr::Document-&gt;new;
$doc-&gt;add_fields(( $id, $title ));
$solr-&gt;add( $doc );
$solr-&gt;commit;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
could be as simple as:
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$solr-&gt;add( { id =&gt; $index, title =&gt; $_ } );&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;
The full object notation is available when you need it, but for simple docs, I wouldn&#039;t bother with it.
&lt;/p&gt;

&lt;p&gt;
Also, note that I&#039;ve left off the call to &lt;code&gt;commit()&lt;/code&gt;. WebService::Solr has an &quot;autocommit&quot; bit that is on by default, so, after operations that require a commit, it&#039;s already done for you.
&lt;/p&gt;

&lt;p&gt;
I should probably also mention that it would be more efficient to send multiple documents over the line rather than one at a time -- though this case wouldn&#039;t show much difference.
&lt;/p&gt;

&lt;p&gt;
In the searching script you write:
&lt;/p&gt;

&lt;p&gt;
&lt;code&gt;print &quot;Your search ($query) found &quot; . ( $#hits + 1 ) . &quot; document(s).\n\n&quot;;&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
While this is true for this particular index, in reality
&lt;/p&gt;

&lt;p&gt;
&lt;code&gt;my @hits = $response-&gt;docs;&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
only returns the documents attached to this particular response -- which could be, for example, 10 out of 100 actual results.
&lt;/p&gt;

&lt;p&gt;
The true number of matches can be found with the pager object:
&lt;/p&gt;

&lt;p&gt;
&lt;code&gt;$response-&gt;pager-&gt;total_entries&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
Hopefully I&#039;m not giving you a bunch of details that you&#039;re already aware of -- If i am, I apologize.
&lt;/p&gt;

&lt;p&gt;
Anyway, I can&#039;t wait for the rest of the series! :)
&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;&quot;Thanks, Brian!&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>
The following is a comment from Brian Cassidy, a co-author of WebService::Solr. &#8220;Re-printed&#8221; with permission:
</p>
<blockquote><p>
I just noticed your 1st of a series of articles on WebService::Solr. Looks great so far! :)
</p>
<p>
Here are some comments about the code:
</p>
<p>
In the first script, you could probably use the much simpler syntax for add() rather than then full-on OOP way with Document and Field objects:
</p>
<pre><code>my $id  = WebService::Solr::Field->new( id  => $index );
my $title = WebService::Solr::Field->new( title => $_ );
my $doc = WebService::Solr::Document->new;
$doc->add_fields(( $id, $title ));
$solr->add( $doc );
$solr->commit;</code></pre>
<p>
could be as simple as:
</p>
<p><code>$solr->add( { id => $index, title => $_ } );</code></p>
<p>
The full object notation is available when you need it, but for simple docs, I wouldn&#8217;t bother with it.
</p>
<p>
Also, note that I&#8217;ve left off the call to <code>commit()</code>. WebService::Solr has an &#8220;autocommit&#8221; bit that is on by default, so, after operations that require a commit, it&#8217;s already done for you.
</p>
<p>
I should probably also mention that it would be more efficient to send multiple documents over the line rather than one at a time &#8212; though this case wouldn&#8217;t show much difference.
</p>
<p>
In the searching script you write:
</p>
<p>
<code>print "Your search ($query) found " . ( $#hits + 1 ) . " document(s).\n\n";</code>
</p>
<p>
While this is true for this particular index, in reality
</p>
<p>
<code>my @hits = $response->docs;</code>
</p>
<p>
only returns the documents attached to this particular response &#8212; which could be, for example, 10 out of 100 actual results.
</p>
<p>
The true number of matches can be found with the pager object:
</p>
<p>
<code>$response->pager->total_entries</code>
</p>
<p>
Hopefully I&#8217;m not giving you a bunch of details that you&#8217;re already aware of &#8212; If i am, I apologize.
</p>
<p>
Anyway, I can&#8217;t wait for the rest of the series! :)
</p>
</blockquote>
<p>&#8220;Thanks, Brian!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
