2002-02-23 17:03:39 -05:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
|
|
2004-03-04 09:41:28 -05:00
|
|
|
<!--
|
|
|
|
Copyright 1999-2004 The Apache Software Foundation
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
2002-02-23 17:03:39 -05:00
|
|
|
<!-- Content Stylesheet for Site -->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- start the processing -->
|
|
|
|
<!-- ====================================================================== -->
|
2002-12-12 01:23:48 -05:00
|
|
|
<!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
|
2002-02-23 17:03:39 -05:00
|
|
|
<!-- Main Page Section -->
|
|
|
|
<!-- ====================================================================== -->
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-01-04 11:29:08 -05:00
|
|
|
|
2005-02-14 11:48:47 -05:00
|
|
|
<title>Apache Lucene - Plan for enhancements to Lucene</title>
|
2002-02-23 17:03:39 -05:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body bgcolor="#ffffff" text="#000000" link="#525D76">
|
|
|
|
<table border="0" width="100%" cellspacing="0">
|
|
|
|
<!-- TOP IMAGE -->
|
|
|
|
<tr>
|
|
|
|
<td align="left">
|
|
|
|
<a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" border="0"/></a>
|
|
|
|
</td>
|
|
|
|
<td align="right">
|
2005-02-14 11:48:47 -05:00
|
|
|
<a href="http://lucene.apache.org/"><img src="./images/lucene_green_300.gif" alt="Apache Lucene" border="0"/></a>
|
2002-02-23 17:03:39 -05:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<table border="0" width="100%" cellspacing="4">
|
|
|
|
<tr><td colspan="2">
|
|
|
|
<hr noshade="" size="1"/>
|
|
|
|
</td></tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<!-- LEFT SIDE NAVIGATION -->
|
|
|
|
<td width="20%" valign="top" nowrap="true">
|
2003-10-09 10:40:30 -04:00
|
|
|
|
|
|
|
<!-- ============================================================ -->
|
|
|
|
|
|
|
|
<p><strong>About</strong></p>
|
2002-02-23 17:03:39 -05:00
|
|
|
<ul>
|
|
|
|
<li> <a href="./index.html">Overview</a>
|
|
|
|
</li>
|
2004-05-18 09:32:01 -04:00
|
|
|
<li> <a href="http://wiki.apache.org/jakarta-lucene/PoweredBy">Powered by Lucene</a>
|
2002-02-23 17:03:39 -05:00
|
|
|
</li>
|
|
|
|
<li> <a href="./whoweare.html">Who We Are</a>
|
|
|
|
</li>
|
|
|
|
<li> <a href="http://jakarta.apache.org/site/mail.html">Mailing Lists</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p><strong>Resources</strong></p>
|
|
|
|
<ul>
|
2004-02-28 21:43:36 -05:00
|
|
|
<li> <a href="http://wiki.apache.org/jakarta-lucene">Wiki</a>
|
|
|
|
</li>
|
2004-12-30 16:50:43 -05:00
|
|
|
<li> <a href="http://wiki.apache.org/jakarta-lucene/LuceneFAQ">FAQ</a>
|
2002-06-20 10:23:48 -04:00
|
|
|
</li>
|
|
|
|
<li> <a href="./gettingstarted.html">Getting Started</a>
|
2002-05-16 01:16:10 -04:00
|
|
|
</li>
|
|
|
|
<li> <a href="./queryparsersyntax.html">Query Syntax</a>
|
2002-10-29 23:14:11 -05:00
|
|
|
</li>
|
|
|
|
<li> <a href="./fileformats.html">File Formats</a>
|
2002-02-23 17:03:39 -05:00
|
|
|
</li>
|
|
|
|
<li> <a href="./api/index.html">Javadoc</a>
|
|
|
|
</li>
|
|
|
|
<li> <a href="./contributions.html">Contributions</a>
|
2002-06-20 10:23:48 -04:00
|
|
|
</li>
|
2002-07-14 15:04:00 -04:00
|
|
|
<li> <a href="./resources.html">Articles, etc.</a>
|
2002-12-04 00:56:33 -05:00
|
|
|
</li>
|
|
|
|
<li> <a href="./benchmarks.html">Benchmarks</a>
|
2002-11-29 16:23:47 -05:00
|
|
|
</li>
|
2004-11-15 14:00:49 -05:00
|
|
|
<li> <a href="http://issues.apache.org/bugzilla/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=Lucene&short_desc=%5BPATCH%5D&short_desc_type=allwordssubstr&long_desc=&long_desc_type=allwordssubstr&bug_file_loc=&bug_file_loc_type=allwordssubstr&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&order=Importance">Patches</a>
|
2002-11-07 15:18:09 -05:00
|
|
|
</li>
|
|
|
|
<li> <a href="http://jakarta.apache.org/site/bugs.html">Bugs</a>
|
|
|
|
</li>
|
2004-11-15 14:00:49 -05:00
|
|
|
<li> <a href="http://issues.apache.org/bugzilla/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=Lucene&short_desc=&short_desc_type=allwordssubstr&long_desc=&long_desc_type=allwordssubstr&bug_file_loc=&bug_file_loc_type=allwordssubstr&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&order=Importance">Lucene Bugs</a>
|
2002-11-29 16:23:47 -05:00
|
|
|
</li>
|
2004-12-30 23:24:57 -05:00
|
|
|
<li> <a href="http://mail-archives.apache.org/eyebrowse/SummarizeList?listId=30">Lucene-user</a>
|
2002-11-29 16:23:47 -05:00
|
|
|
</li>
|
2004-12-30 23:24:57 -05:00
|
|
|
<li> <a href="http://mail-archives.apache.org/eyebrowse/SummarizeList?listId=29">Lucene-dev</a>
|
2002-12-04 00:56:33 -05:00
|
|
|
</li>
|
|
|
|
<li> <a href="./lucene-sandbox/">Lucene Sandbox</a>
|
2002-02-23 17:03:39 -05:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p><strong>Download</strong></p>
|
|
|
|
<ul>
|
2004-11-29 08:34:57 -05:00
|
|
|
<li> <a href="http://www.apache.org/dyn/closer.cgi/jakarta/lucene/binaries/">Binaries</a>
|
2002-02-23 17:03:39 -05:00
|
|
|
</li>
|
2004-11-29 08:34:57 -05:00
|
|
|
<li> <a href="http://www.apache.org/dyn/closer.cgi/jakarta/lucene/source/">Source Code</a>
|
2002-02-23 17:03:39 -05:00
|
|
|
</li>
|
2005-03-11 22:13:09 -05:00
|
|
|
<li> <a href="http://svn.apache.org/viewcvs.cgi/lucene/">Source Repository</a>
|
2002-02-23 17:03:39 -05:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</td>
|
|
|
|
<td width="80%" align="left" valign="top">
|
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
|
|
|
<tr><td bgcolor="#525D76">
|
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif">
|
|
|
|
<a name="Purpose"><strong>Purpose</strong></a>
|
|
|
|
</font>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>
|
2005-01-18 08:57:32 -05:00
|
|
|
<p>
|
2002-02-23 17:03:39 -05:00
|
|
|
<blockquote>
|
|
|
|
<p>
|
|
|
|
The purpose of this document is to outline plans for
|
|
|
|
making <a href="http://jakarta.apache.org/lucene">
|
2005-02-14 11:48:47 -05:00
|
|
|
Apache Lucene</a> work as a more general drop-in
|
2002-02-23 17:03:39 -05:00
|
|
|
component. It makes the assumption that this is an
|
|
|
|
objective for the Lucene user and development community.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
The best reference is <a href="http://www.htdig.org">
|
|
|
|
htDig</a>, though it is not quite as sophisticated as
|
|
|
|
Lucene, it has a number of features that make it
|
2002-06-08 16:43:01 -04:00
|
|
|
desirable. It however is a traditional c-compiled app
|
|
|
|
which makes it somewhat unpleasant to install on some
|
2002-02-23 17:03:39 -05:00
|
|
|
platforms (like Solaris!).
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
This plan is being submitted to the Lucene developer
|
|
|
|
community for an initial reaction, advice, feedback and
|
|
|
|
consent. Following this it will be submitted to the
|
|
|
|
Lucene user community for support. Although, I'm (Andy
|
2002-06-08 16:43:01 -04:00
|
|
|
Oliver) capable of providing these enhancements by
|
|
|
|
myself, I'd of course prefer to work on them in concert
|
2002-02-23 17:03:39 -05:00
|
|
|
with others.
|
|
|
|
</p>
|
|
|
|
<p>
|
2002-06-08 16:43:01 -04:00
|
|
|
While I'm outlaying a fairly large feature set, these can
|
2002-02-23 17:03:39 -05:00
|
|
|
be implemented incrementally of course (and are probably
|
|
|
|
best if done that way).
|
|
|
|
</p>
|
|
|
|
</blockquote>
|
|
|
|
</p>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td><br/></td></tr>
|
|
|
|
</table>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
|
|
|
<tr><td bgcolor="#525D76">
|
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif">
|
|
|
|
<a name="Goal and Objectives"><strong>Goal and Objectives</strong></a>
|
|
|
|
</font>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>
|
2005-01-18 08:57:32 -05:00
|
|
|
<p>
|
2002-02-23 17:03:39 -05:00
|
|
|
<blockquote>
|
|
|
|
<p>
|
|
|
|
The goal is to provide features to Lucene that allow it
|
2002-06-08 16:43:01 -04:00
|
|
|
to be used as a drop-in search engine. It should provide
|
2002-02-23 17:03:39 -05:00
|
|
|
many of the features of projects like <a href="http://www.htdig.org">htDig</a> while surpassing
|
2002-06-08 16:43:01 -04:00
|
|
|
them with unique Lucene features and capabilities such as
|
2002-02-23 17:03:39 -05:00
|
|
|
easy installation on and java-supporting platform,
|
2002-06-08 16:43:01 -04:00
|
|
|
and support for document fields and field searches. And
|
2002-02-23 17:03:39 -05:00
|
|
|
of course, <a href="http://apache.org/LICENSE">
|
|
|
|
a pragmatic software license</a>.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
To reach this goal we'll implement code to support the
|
|
|
|
following objectives that augment but do not replace
|
2002-06-08 16:43:01 -04:00
|
|
|
the current Lucene feature set.
|
2002-02-23 17:03:39 -05:00
|
|
|
</p>
|
|
|
|
<ul>
|
|
|
|
<li>
|
2002-06-08 16:43:01 -04:00
|
|
|
Document Location Independence - meaning mapping
|
2002-02-23 17:03:39 -05:00
|
|
|
real contexts to runtime contexts.
|
|
|
|
Essentially, if the document is at
|
|
|
|
/var/www/htdocs/mydoc.html, I probably want it
|
|
|
|
indexed as
|
2002-06-08 16:43:01 -04:00
|
|
|
http://www.bigevilmegacorp.com/mydoc.html.
|
2002-02-23 17:03:39 -05:00
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
Standard methods of creating central indicies -
|
|
|
|
file system indexing is probably less useful in
|
|
|
|
many environments than is *remote* indexing (for
|
|
|
|
instance http). I would suggest that most folks
|
|
|
|
would prefer that general functionality be
|
2002-06-08 16:43:01 -04:00
|
|
|
supported by Lucene instead of having to write
|
2002-02-23 17:03:39 -05:00
|
|
|
code for every indexing project. Obviously, if
|
|
|
|
what they are doing is *special* they'll have to
|
2002-06-08 16:43:01 -04:00
|
|
|
code, but general document indexing across
|
|
|
|
web servers would not qualify.
|
2002-02-23 17:03:39 -05:00
|
|
|
</li>
|
|
|
|
<li>
|
2002-06-08 16:43:01 -04:00
|
|
|
Document interpretation abstraction - currently
|
2002-02-23 17:03:39 -05:00
|
|
|
one must handle document object construction via
|
|
|
|
custom code. A standard interface for plugging
|
2002-06-08 16:43:01 -04:00
|
|
|
in format handlers should be supported.
|
2002-02-23 17:03:39 -05:00
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
Mime and file-extension to document
|
2002-06-08 16:43:01 -04:00
|
|
|
interpretation mapping.
|
2002-02-23 17:03:39 -05:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</blockquote>
|
|
|
|
</p>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td><br/></td></tr>
|
|
|
|
</table>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
|
|
|
<tr><td bgcolor="#525D76">
|
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif">
|
2002-02-24 10:58:41 -05:00
|
|
|
<a name="Crawlers"><strong>Crawlers</strong></a>
|
2002-02-23 17:03:39 -05:00
|
|
|
</font>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>
|
2005-01-18 08:57:32 -05:00
|
|
|
<p>
|
2002-02-23 17:03:39 -05:00
|
|
|
<blockquote>
|
|
|
|
<p>
|
2002-02-24 10:58:41 -05:00
|
|
|
Crawlers are data source executable code. They crawl a file
|
2002-02-23 17:03:39 -05:00
|
|
|
system, ftp site, web site, etc. to create the index.
|
2002-02-24 10:58:41 -05:00
|
|
|
These standard crawlers may not make ALL of Lucene's
|
2002-02-23 17:03:39 -05:00
|
|
|
functionality available, though they should be able to
|
|
|
|
make most of it available through configuration.
|
|
|
|
</p>
|
|
|
|
<p>
|
2002-02-24 10:58:41 -05:00
|
|
|
<b> Abstract Crawler </b>
|
2002-02-23 17:03:39 -05:00
|
|
|
</p>
|
|
|
|
<p>
|
2002-02-24 10:58:41 -05:00
|
|
|
The AbstractCrawler is basically the parent for all
|
|
|
|
Crawler classes. It provides implementation for the
|
2002-02-23 17:03:39 -05:00
|
|
|
following functions/properties:
|
|
|
|
</p>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
index path - where to write the index.
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
cui - create or update the index
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
root context - the start of the pathname
|
|
|
|
that should be replaced by the
|
|
|
|
replace with property or dropped
|
|
|
|
entirely. Example: /opt/tomcat/webapps
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
replace with - when specified replaces
|
|
|
|
the root context. Example:
|
|
|
|
http://jakarta.apache.org.
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
replacement type - the type of
|
2002-06-08 16:43:01 -04:00
|
|
|
replace with path: relative, URL or
|
2002-02-23 17:03:39 -05:00
|
|
|
path.
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
location - the location to start
|
|
|
|
indexing at.
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
doctypes - only index documents with
|
|
|
|
these doctypes. If not specified all
|
|
|
|
registered mime-types are used.
|
|
|
|
Example: "xml,doc,html"
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
recursive - if not specified is turned
|
|
|
|
off.
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
level - optional level of directory or
|
|
|
|
links to traverse. By default is
|
|
|
|
assumed to be infinite. Recursive must
|
|
|
|
be turned on or this is ignored. Range:
|
|
|
|
0 - Long.MAX_VALUE.
|
|
|
|
</li>
|
2002-02-24 10:58:41 -05:00
|
|
|
<li>
|
2002-06-08 16:43:01 -04:00
|
|
|
SleeptimeBetweenCalls - can be used to
|
|
|
|
avoid flooding a machine with too many
|
2002-02-24 10:58:41 -05:00
|
|
|
requests
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
RequestTimeout - kill the crawler
|
|
|
|
request after the specified period of
|
|
|
|
inactivity.
|
|
|
|
</li>
|
|
|
|
<li>
|
2002-06-08 16:43:01 -04:00
|
|
|
IncludeFilter - include only items
|
|
|
|
matching filter. (can occur multiple
|
2002-02-24 10:58:41 -05:00
|
|
|
times)
|
|
|
|
</li>
|
|
|
|
<li>
|
2002-06-08 16:43:01 -04:00
|
|
|
ExcludeFilter - exclude only items
|
2002-02-24 10:58:41 -05:00
|
|
|
matching filter. (can occur multiple
|
|
|
|
times)
|
|
|
|
</li>
|
2002-02-24 11:33:21 -05:00
|
|
|
<li>
|
|
|
|
ExpandOnly - use but do not index items
|
|
|
|
that match this pattern (regex?) (can
|
|
|
|
occur multiple times)
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
NoExpand - Index but do not follow the
|
|
|
|
links in items that match this pattern
|
|
|
|
(regex?) (can occur multiple times)
|
|
|
|
</li>
|
2002-02-24 10:58:41 -05:00
|
|
|
<li>
|
|
|
|
MaxItems - stops indexing after x
|
|
|
|
documents have been indexed.
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
MaxMegs - stops indexing after x megs
|
|
|
|
have been indexed.. (should this be in
|
|
|
|
specific crawlers?)
|
|
|
|
</li>
|
2002-02-23 17:03:39 -05:00
|
|
|
<li>
|
|
|
|
properties - in addition to the settings
|
|
|
|
(probably from the command line) read
|
|
|
|
this properties file and get them from
|
|
|
|
it. Command line options override
|
2002-06-08 16:43:01 -04:00
|
|
|
the properties file in the case of
|
2002-02-23 17:03:39 -05:00
|
|
|
duplicates. There should also be an
|
2002-06-08 16:43:01 -04:00
|
|
|
environment variable or VM parameter to
|
2002-02-23 17:03:39 -05:00
|
|
|
set this.
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p>
|
2002-02-24 10:58:41 -05:00
|
|
|
<b>FileSystemCrawler</b>
|
2002-02-23 17:03:39 -05:00
|
|
|
</p>
|
|
|
|
<p>
|
2002-02-24 10:58:41 -05:00
|
|
|
This should extend the AbstractCrawler and
|
2002-06-08 16:43:01 -04:00
|
|
|
support any additional options required for a
|
|
|
|
file system index.
|
2002-02-23 17:03:39 -05:00
|
|
|
</p>
|
|
|
|
<p>
|
2003-03-06 14:14:17 -05:00
|
|
|
<b>HTTP Crawler </b>
|
2002-02-23 17:03:39 -05:00
|
|
|
</p>
|
|
|
|
<p>
|
2002-06-08 16:43:01 -04:00
|
|
|
Supports the AbstractCrawler options as well as:
|
2002-02-23 17:03:39 -05:00
|
|
|
</p>
|
|
|
|
<ul>
|
|
|
|
<li>
|
2002-06-08 16:43:01 -04:00
|
|
|
span hosts - Whether to span hosts or not,
|
|
|
|
by default this should be no.
|
2002-02-23 17:03:39 -05:00
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
restrict domains - (ignored if span
|
|
|
|
hosts is not enabled). Whether all
|
|
|
|
spanned hosts must be in the same domain
|
|
|
|
(default is off).
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
try directories - Whether to attempt
|
|
|
|
directory listings or not (so if you
|
|
|
|
recurse and go to
|
|
|
|
/nextcontext/index.html this option says
|
|
|
|
to also try /nextcontext to get the dir
|
2002-06-08 16:43:01 -04:00
|
|
|
listing)
|
2002-02-23 17:03:39 -05:00
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
map extensions -
|
2002-06-08 16:43:01 -04:00
|
|
|
(always/default/never/fallback). Whether
|
2002-02-23 17:03:39 -05:00
|
|
|
to always use extension mapping, by
|
|
|
|
default (fallback to mime type), NEVER
|
|
|
|
or fallback if mime is not available
|
|
|
|
(default).
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
ignore robots - ignore robots.txt, on or
|
|
|
|
off (default - off)
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</blockquote>
|
|
|
|
</p>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td><br/></td></tr>
|
|
|
|
</table>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
|
|
|
<tr><td bgcolor="#525D76">
|
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif">
|
|
|
|
<a name="MIMEMap"><strong>MIMEMap</strong></a>
|
|
|
|
</font>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>
|
2005-01-18 08:57:32 -05:00
|
|
|
<p>
|
2002-02-23 17:03:39 -05:00
|
|
|
<blockquote>
|
|
|
|
<p>
|
|
|
|
A configurable registry of document types, their
|
2002-06-08 16:43:01 -04:00
|
|
|
description, an identifier, mime-type and file
|
|
|
|
extension. This should map both MIME -> factory
|
2002-02-23 17:03:39 -05:00
|
|
|
and extension -> factory.
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
This might be configured at compile time or by a
|
|
|
|
properties file, etc. For example:
|
|
|
|
</p>
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
|
|
|
|
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
|
|
|
|
Description
|
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
|
|
|
|
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
|
|
|
|
Identifier
|
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
|
|
|
|
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
|
|
|
|
Extensions
|
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
|
|
|
|
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
|
|
|
|
MimeType
|
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
|
|
|
|
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
|
|
|
|
DocumentFactory
|
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
|
|
|
|
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
|
|
|
|
"Word Document"
|
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
|
|
|
|
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
|
|
|
|
"doc"
|
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
|
|
|
|
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
|
|
|
|
"doc"
|
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
|
|
|
|
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
|
|
|
|
"vnd.application/ms-word"
|
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
|
|
|
|
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
|
|
|
|
POIWordDocumentFactory
|
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
|
|
|
|
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
|
|
|
|
"HTML Document"
|
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
|
|
|
|
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
|
|
|
|
"html"
|
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
|
|
|
|
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
|
|
|
|
"html,htm"
|
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
|
|
|
|
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
|
|
|
|
|
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
|
|
|
|
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
|
|
|
|
HTMLDocumentFactory
|
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</blockquote>
|
|
|
|
</p>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td><br/></td></tr>
|
|
|
|
</table>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
|
|
|
<tr><td bgcolor="#525D76">
|
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif">
|
|
|
|
<a name="DocumentFactory"><strong>DocumentFactory</strong></a>
|
|
|
|
</font>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>
|
2005-01-18 08:57:32 -05:00
|
|
|
<p>
|
2002-02-23 17:03:39 -05:00
|
|
|
<blockquote>
|
|
|
|
<p>
|
|
|
|
An interface for classes which create document objects
|
|
|
|
for particular file types. Examples:
|
|
|
|
HTMLDocumentFactory, DOCDocumentFactory,
|
|
|
|
XLSDocumentFactory, XML DocumentFactory.
|
|
|
|
</p>
|
|
|
|
</blockquote>
|
|
|
|
</p>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td><br/></td></tr>
|
|
|
|
</table>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
|
|
|
<tr><td bgcolor="#525D76">
|
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif">
|
|
|
|
<a name="FieldMapping classes"><strong>FieldMapping classes</strong></a>
|
|
|
|
</font>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>
|
2005-01-18 08:57:32 -05:00
|
|
|
<p>
|
2002-02-23 17:03:39 -05:00
|
|
|
<blockquote>
|
|
|
|
<p>
|
2002-06-08 16:43:01 -04:00
|
|
|
A class that maps standard fields from the
|
2002-02-23 17:03:39 -05:00
|
|
|
DocumentFactories into *fields* in the Document objects
|
|
|
|
they create. I suggest that a regular expression system
|
|
|
|
or xpath might be the most universal way to do this.
|
|
|
|
For instance if perhaps I had an XML factory that
|
|
|
|
represented XML elements as fields, I could map content
|
2002-06-08 16:43:01 -04:00
|
|
|
from particular fields to their fields or suppress them
|
2002-02-23 17:03:39 -05:00
|
|
|
entirely. We could even make this configurable.
|
|
|
|
</p>
|
|
|
|
<p>
|
2002-06-08 16:43:01 -04:00
|
|
|
|
2002-02-23 17:03:39 -05:00
|
|
|
for example:
|
|
|
|
</p>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
htmldoc.properties
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
suppress=*
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
author=content:g/author\:\ ........................................./
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
author.suppress=false
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
title=content:g/title\:\ ........................................./
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
title.suppress=false
|
|
|
|
</li>
|
|
|
|
</ul>
|
2002-06-08 16:43:01 -04:00
|
|
|
<p>
|
|
|
|
In this example we map html documents such that all
|
|
|
|
fields are suppressed but author and title. We map
|
|
|
|
author and title to anything in the content matching
|
|
|
|
author: (and x characters). Okay my regular expresions
|
2002-02-23 17:03:39 -05:00
|
|
|
suck but hopefully you get the idea.
|
|
|
|
</p>
|
|
|
|
</blockquote>
|
|
|
|
</p>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td><br/></td></tr>
|
|
|
|
</table>
|
|
|
|
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
|
|
|
<tr><td bgcolor="#525D76">
|
|
|
|
<font color="#ffffff" face="arial,helvetica,sanserif">
|
|
|
|
<a name="Final Thoughts"><strong>Final Thoughts</strong></a>
|
|
|
|
</font>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td>
|
2005-01-18 08:57:32 -05:00
|
|
|
<p>
|
2002-02-23 17:03:39 -05:00
|
|
|
<blockquote>
|
|
|
|
<p>
|
2002-06-08 16:43:01 -04:00
|
|
|
We might also consider eliminating the DocumentFactory
|
|
|
|
entirely by making an AbstractDocument from which the
|
|
|
|
current document object would inherit from. I
|
|
|
|
experimented with this locally, and it was a relatively
|
|
|
|
minor code change and there was of course no difference
|
|
|
|
in performance. The Document Factory classes would
|
|
|
|
instead be instances of various subclasses of
|
2002-02-23 17:03:39 -05:00
|
|
|
AbstractDocument.
|
|
|
|
</p>
|
|
|
|
<p>
|
2002-06-08 16:43:01 -04:00
|
|
|
My inspiration for this is HTDig (http://www.htdig.org/).
|
|
|
|
While this goes slightly beyond what HTDig provides by
|
|
|
|
providing field mapping (where HTDIG is just interested
|
|
|
|
in Strings/numbers wherever they are found), it provides
|
|
|
|
at least what I would need to use this as a drop-in for
|
|
|
|
most places I contract at (with the obvious exception of
|
|
|
|
a default set of content handlers which would of course
|
2002-02-23 17:03:39 -05:00
|
|
|
develop naturally over time).
|
|
|
|
</p>
|
|
|
|
<p>
|
2002-06-08 16:43:01 -04:00
|
|
|
I am able to certainly contribute to this effort if the
|
|
|
|
development community is open to it. I'd suggest we do
|
|
|
|
it iteratively in stages and not aim for all of this at
|
2002-02-23 17:03:39 -05:00
|
|
|
once (for instance leave out the field mapping at first).
|
|
|
|
</p>
|
|
|
|
<p>
|
2002-06-08 16:43:01 -04:00
|
|
|
|
|
|
|
Anyhow, please give me some feedback, counter
|
|
|
|
suggestions, let me know if I'm way off base or out of
|
2002-02-23 17:03:39 -05:00
|
|
|
line, etc. -Andy
|
|
|
|
</p>
|
|
|
|
</blockquote>
|
|
|
|
</p>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td><br/></td></tr>
|
|
|
|
</table>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<!-- FOOTER -->
|
|
|
|
<tr><td colspan="2">
|
|
|
|
<hr noshade="" size="1"/>
|
|
|
|
</td></tr>
|
|
|
|
<tr><td colspan="2">
|
|
|
|
<div align="center"><font color="#525D76" size="-1"><em>
|
2005-01-18 08:57:32 -05:00
|
|
|
Copyright © 1999-2005, The Apache Software Foundation
|
2002-02-23 17:03:39 -05:00
|
|
|
</em></font></div>
|
|
|
|
</td></tr>
|
|
|
|
</table>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
<!-- end the processing -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|