svn commit: r388293 - /lucene/nutch/trunk/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/HtmlParser.java

2006-03-23 Thread jerome
Author: jerome
Date: Thu Mar 23 15:21:03 2006
New Revision: 388293

URL: http://svn.apache.org/viewcvs?rev=388293view=rev
Log:
Set the configuration of the parser used in the main method to fix NPEs

Modified:

lucene/nutch/trunk/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/HtmlParser.java

Modified: 
lucene/nutch/trunk/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/HtmlParser.java
URL: 
http://svn.apache.org/viewcvs/lucene/nutch/trunk/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/HtmlParser.java?rev=388293r1=388292r2=388293view=diff
==
--- 
lucene/nutch/trunk/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/HtmlParser.java
 (original)
+++ 
lucene/nutch/trunk/src/plugin/parse-html/src/java/org/apache/nutch/parse/html/HtmlParser.java
 Thu Mar 23 15:21:03 2006
@@ -269,9 +269,11 @@
 byte[] bytes = new byte[(int)file.length()];
 DataInputStream in = new DataInputStream(new FileInputStream(file));
 in.readFully(bytes);
-Parse parse = new HtmlParser().getParse(
-new Content(url, url, bytes, text/html, new Metadata(),
-NutchConfiguration.create()));
+Configuration conf = NutchConfiguration.create();
+HtmlParser parser = new HtmlParser();
+parser.setConf(conf);
+Parse parse = parser.getParse(
+new Content(url, url, bytes, text/html, new Metadata(), conf));
 System.out.println(data: +parse.getData());
 
 System.out.println(text: +parse.getText());




[Nutch Wiki] Update of FrontPage by tyrellperera

2006-03-23 Thread Apache Wiki
Dear Wiki user,

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

The following page has been changed by tyrellperera:
http://wiki.apache.org/nutch/FrontPage

--
   * HardwareRequirements
   * [http://lucene.apache.org/nutch/tutorial.html Tutorial] -- A Step-by-Step 
guide to getting Nutch up and running.
   * NutchTutorial ''on the wiki''
+  * [Nutch - The Java Search Engine] (Builds on the basic turorials. 
Includes index maintenance scripts)
   * NutchHadoopTutorial
   * [FAQ]
   * CommandLineOptions for the nutch shell script.


[Nutch Wiki] Update of Nutch - The Java Search Engine by tyrellperera

2006-03-23 Thread Apache Wiki
Dear Wiki user,

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

The following page has been changed by tyrellperera:
http://wiki.apache.org/nutch/Nutch_-_The_Java_Search_Engine

New page:
By Tyrell Perera ([EMAIL PROTECTED]), Virtusa Corp. (http://www.virtusa.com)

= 1 Introduction =

== 1.1 What is Nutch? ==

Nutch is an effort to build a Free and Open Source search engine. It uses 
Lucene for the search and index component. The fetcher (robot) has been written 
from scratch solely for this project.

Nutch has a highly modular architecture allowing developers to create plug-ins 
for activities such as media-type parsing, data retrieval, querying and 
clustering.

''Doug Cutting'' is the lead developer of Nutch.


== 1.2 What is Lucene? ==

Lucene is a Free and Open Source search and index API released by the Apache 
Software Foundation. It is written in Java and is released under the Apache 
Software License.

Lucene is just the core of a search engine. As such, it does not include things 
like a web spider or parsers for different document formats. Instead these 
things need to be added by a developer who uses Lucene.

Lucene does not care about the source of the data, its format, or even its 
language, as long as you can convert it to text. This means you can use Lucene 
to index and search data stored in files: web pages on remote web servers, 
documents stored in local file systems, simple text files, Microsoft Word 
documents, HTML or PDF files, or any other format from which you can extract 
textual information.

Lucene has been ported or is in the process of being ported to various 
programming languages other than Java:

  * {{{ Lucene4c - C }}}
  * {{{ CLucene - C++ }}}
  * {{{ MUTIS - Delphi }}}
  * {{{ NLucene - .NET }}}
  * {{{ DotLucene - .NET }}}
  * {{{ Plucene - Perl }}}
  * {{{ Pylucene - Python }}}
  * {{{ Ferret and RubyLucene – Ruby }}}


== 1.3 What License? ==

Both Nutch and Lucene are Apache projects and carry the Apache license 
(http://www.opensource.org/licenses/apache2.0.php).


= 2 The Design of Nutch =

== 2.1 Core Components of Nutch ==

The Nutch search engine consists, very roughly, of three components:

1. The Crawler, which discovers and retrieves web pages
2. The ‘WebDB’, a custom database that stores known URLs and fetched page 
contents
3. The ‘Indexer’, which dissects pages and builds keyword-based indexes 
from them

After the initial creation of an Index, it is usual to perform periodic updates 
of the index, in order to keep it up-to-date. We will look into the details of 
index maintenance in the parts following this.

== 2.2 The Nutch Web Application ==

Apart from the above three components, it has a Search Web Application. This 
application is a JSP application that can be configured and deployed in a 
servlet container.

== 2.3 The Nutch API ==

All components listed above use the nutch API. The users can utilize the API 
via two approaches, which depends on the task at hand.

1. Through the nutch Shell Script for administrative tasks, such as creating 
and maintaining indexes
2. Through the Search Web Application, in order to perform a search using 
keywords


= 3 Implementing a Nutch Search =

Implementing our own version of Nutch is fairly easy, provided that you;

1. have a basic understanding of how a web search engine works and 
2. are comfortable working in a command line and finally
3. have a fair knowledge of Java and Servlet containers

If you said ‘yes’ to all three questions above, you have a very high 
probability of having your Nutch implementation up and running by the end of 
the steps which follows. 


== 3.1 Before We Begin ==

=== 3.1.1 Download Nutch ===

Go to http://www.apache.org/dyn/closer.cgi/lucene/nutch/ and select a mirror to 
download Nutch. The version described in this document is version 0.7. After 
downloading the archive, extract it to your disk. 

NOTE: This document assumes that the archive was extracted to 
/home/tyrell/nutch-0.7 change this path to reflect your location.

=== 3.1.2 Download and Install a Servlet Container ===

Apache Tomcat is a popular Open Source servlet container. We will use this to 
deploy the Nutch search web application in this document. The version referred 
to in this document is version 5.5. You can download Tomcat from 
http://tomcat.apache.org/download-55.cgi 

=== 3.1.3 To Cygwin or not to Cygwin ===

To run the Nutch shell scripts and create the indexes, we require a UNIX like 
environment. If you do not have access to a UNIX environment, you can use 
Cygwin as an alternative. More details and download information for Cygwin can 
be found at http://www.cygwin.com/ 


=== 3.2 Creating the Index ===
In order for the nutch web application to function, it will require at least 
one search index. A search index in nutch is represented in the file system as 
a directory. However, it is much more than that 

[Nutch Wiki] Trivial Update of Nutch - The Java Search Engine by tyrellperera

2006-03-23 Thread Apache Wiki
Dear Wiki user,

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

The following page has been changed by tyrellperera:
http://wiki.apache.org/nutch/Nutch_-_The_Java_Search_Engine

--
- By Tyrell Perera ([EMAIL PROTECTED]), Virtusa Corp. (http://www.virtusa.com)
+ By Tyrell Perera, Virtusa Corp. (http://www.virtusa.com)
  
  = 1 Introduction =