Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Nutch Wiki" for change 
notification.

The "WritingPluginExample" page has been changed by LewisJohnMcgibbney:
http://wiki.apache.org/nutch/WritingPluginExample?action=diff&rev1=12&rev2=13

+ This plugin example focuses on the urlmeta plugin which which is packaged 
with Nutch-1.3. It aims to provide a comprehensive introduction to plugin 
development for Apache Nutch.
+ 
  == The Example ==
- Consider this as a plugin example: We want to be able to recommend specific 
web pages for given search terms.  For this example we'll assume we're indexing 
this site.  As you may have noticed, there are a number of pages that talk 
about plugins.  What we want to do is have it so that if someone searches for 
the term "plugin" we recommend that they start at the PluginCentral page, but 
we also want to return all the normal hits in the expected ranking.  We'll 
seperate the search results page into a section of recommendations and then a 
section with the normal search results.
+ Consider this as a plugin example: We want to be able to recommend specific 
web pages for given search terms.  For this example we'll assume we're crawling 
this site with Nutch and indexing it with Apache Solr. As you may have noticed, 
there are a number of pages that talk about plugins. If someone searches for 
the term "plugin", we want the first hit returned to be the Nutch PluginCentral 
page, however we also want to return all the normal hits in the expected 
ranking.
  
- You go through your site and add meta-tags to pages that list what terms they 
should be recommended for.  The tags look something like this:
+ In order to do this we go through our site and add meta-tags to pages that 
list what terms they should be recommended for. The tags look something like 
this:
  
  {{{
  <meta name="recommended" content="plugins" />
  }}}
- In order to do this we need to write a plugin that extends 3 different 
extension points.  We need to extend the HTMLParser in order to get the 
recommended terms out of the meta tags.  The !IndexingFilter will need to be 
extended to add a recommended field to the index.  The !QueryFilter needs to be 
extended to add the ability to search againsed the new field in the index.
+ In order to do this we need to write a plugin that extends 3 different 
extension points.  We need to extend the HTMLParser in order to get the 
recommended terms out of the meta tags.  The !IndexingFilter will need to be 
extended to add a recommended field to the index.  Finally we need to add the 
new field to our Solr !QueryFilter needs to be extended to add the ability to 
search againsed the new field in the index.
  
  == Setup ==
  Start by 
[[http://www.apache.org/dev/version-control.html#anon-svn|downloading]] the 
Nutch source code.  Once you've got that make sure it compiles as is before you 
make any changes.  You should be able to get it to compile by running ant from 
the directory you downloaded the source to.  If you have trouble you can write 
to one of the [[Mailing|Mailing Lists]].

Reply via email to