You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@nutch.apache.org by Chandrajith U <uc...@gmail.com> on 2005/07/28 19:40:40 UTC

How do I crawl for only a certain type of file (MSword with a suffix .doc files)

Using nutch crawl option I want to look in the intranet only for files with 
an extension .doc.

is it possible and how do I do that.

I am not sure how to match only the url which has a .doc suffix


I tried the following, but it does not seem to get what i want , i.e to 
fetch and index only .doc files

nutch crawl myurl.txt -dir crawl.test -depth 10 

myurl.txt
------------
http://www.example.com


crawl-urlfilter.txt
----------------------
Creative Commnons crawl filter

# Each non-comment, non-blank line contains a regular expression
# prefixed by '+' or '-'. The first matching pattern in the file
# determines whether a URL is included or ignored. If no pattern
# matches, the URL is ignored.

# skip file:, ftp:, & mailto: urls
-^(file|ftp|mailto|https):

# skip image and other suffixes we can't yet parse
-\.(gif|GIF|jpg|JPG|ico|ICO|css|sit|eps|wmf|rtf|zip|ppt|mpg|xls|gz|rpm|tgz|mov|MOV|exe)$

# skip URLs containing certain characters as probable queries, etc.
-[?*!@=]

# accept anything else
+\.(doc)$ 

----------------------------------------------------------------------------------

The only change from the default crawl-urlfilter.txt is
the last line

+\.(doc)$ /* was +. */

I guess the above is self-defeating, as I guess it might skip over the root 
URL itself http://www.example.com, and
anything below that root is not explored. is that the way the crawler works.

The other option I am thinking is to eliminate all possible suffixes in the
-\.(gif|GIF|jpg|JPG|ico|ICO|css|sit|eps|wmf|rtf|zip|ppt|mpg|xls|gz|rpm|tgz|mov|MOV|exe|
<all other possible suffices>)$
which does not look very neat.

Any suggestions.


Thanks
Chandrajith