Crawling Ida Mele.

Slides:



Advertisements
Similar presentations
© Copyright 2012 STI INNSBRUCK Apache Lucene Ioan Toma based on slides from Aaron Bannert
Advertisements

Crawling, Ranking and Indexing. Organizing the Web The Web is big. Really big. –Over 3 billion pages, just in the indexable Web The Web is dynamic Problems:
Pete Bohman Adam Kunk.  Introduction  Related Work  System Overview  Indexing Scheme  Ranking  Evaluation  Conclusion.
A Brief Look at Web Crawlers Bin Tan 03/15/07. Web Crawlers “… is a program or automated script which browses the World Wide Web in a methodical, automated.
Web Crawlers Nutch. Agenda What are web crawlers Main policies in crawling Nutch Nutch architecture.
Lucene & Nutch Lucene  Project name  Started as text index engine Nutch  A complete web search engine, including: Crawling, indexing, searching  Index.
Crawler-Based Search Engine By: Bryan Chapman, Ryan Caplet, Morris Wright.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
IDK0040 Võrgurakendused I Building a site: Publicising Deniss Kumlander.
Sharepoint Portal Server Basics. Introduction Sharepoint server belongs to Microsoft family of servers Integrated suite of server capabilities Hosted.
Enterprise Search. Search Architecture Configuring Crawl Processes Advanced Crawl Administration Configuring Query Processes Implementing People Search.
Databases & Data Warehouses Chapter 3 Database Processing.
Web Information Retrieval Projects Ida Mele. Rules Students can work in teams (max 3 people) The project must be delivered by the deadline that will be.
Search engine structure Web Crawler Page archive Page Analizer Control Query resolver ? Ranker text Structure auxiliary Indexer.
Projects ( ) Ida Mele. Rules Students have to work in teams (max 2 people). The project has to be delivered by the deadline that will be published.
Nutch Search Engine Tool. Nutch overview A full-fledged web search engine Functionalities of Nutch  Internet and Intranet crawling  Parsing different.
Crawling Ida Mele. Nutch Apache Nutch is an open source Java implementation of a search engine We can use Nutch for crawling a portion of the Web Useful.
CS344: Introduction to Artificial Intelligence Vishal Vachhani M.Tech, CSE Lecture 34-35: CLIR and Ranking, Crawling and Indexing in IR.
Wasim Rangoonwala ID# CS-460 Computer Security “Privacy is the claim of individuals, groups or institutions to determine for themselves when,
Crawlers - March (Web) Crawlers Domain Presented by: Or Shoham Amit Yaniv Guy Kroupp Saar Kohanovitch.
© 2011 Delmar, Cengage Learning Chapter 7 Managing a Web Server and Files.
Crawlers and Spiders The Web Web crawler Indexer Search User Indexes Query Engine 1.
XHTML Introductory1 Linking and Publishing Basic Web Pages Chapter 3.
Nutch in a Nutshell (part I) Presented by Liew Guo Min Zhao Jin.
Building Search Portals With SP2013 Search. 2 SharePoint 2013 Search  Introduction  Changes in the Architecture  Result Sources  Query Rules/Result.
Nutch in a Nutshell Presented by Liew Guo Min Zhao Jin.
Web Categorization Crawler Mohammed Agabaria Adam Shobash Supervisor: Victor Kulikov Winter 2009/10 Design & Architecture Dec
Crawlers - Presentation 2 - April (Web) Crawlers Domain Presented by: Or Shoham Amit Yaniv Guy Kroupp Saar Kohanovitch.
Crawling Slides adapted from
Introduction to Nutch CSCI 572: Information Retrieval and Search Engines Summer 2010.
Ranking Ida Mele. Introduction The set of software components for the management of large sets of data is made of: MG4J Fastutil the DSI Utilities Sux4J.
Gregor Gisler-Merz How to hit in google The anatomy of a modern web search engine.
Module 10 Administering and Configuring SharePoint Search.
استاد : مهندس حسین پور ارائه دهنده : احسان جوانمرد Google Architecture.
The Anatomy of a Large-Scale Hyper textual Web Search Engine S. Brin, L. Page Presenter :- Abhishek Taneja.
CS 347Notes101 CS 347 Parallel and Distributed Data Processing Distributed Information Retrieval Hector Garcia-Molina Zoltan Gyongyi.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Search Overview Search Features: WSS and Office Search Architecture Content Sources and.
Evaluating & Maintaining a Site Domain 6. Conduct Technical Tests Dreamweaver provides many tools to assist in finalizing and testing your website for.
1 University of Qom Information Retrieval Course Web Search (Spidering) Based on:
Design a full-text search engine for a website based on Lucene
1 MSRBot Web Crawler Dennis Fetterly Microsoft Research Silicon Valley Lab © Microsoft Corporation.
Ranking Ida Mele. Introduction The set of software components for the management of large sets of data is made of: – MG4J, – Fastutil, – the DSI Utilities,
GROUP PresentsPresents. WEB CRAWLER A visualization of links in the World Wide Web Software Engineering C Semester Two Massey University - Palmerston.
Apache Solr Dima Ionut Daniel. Contents What is Apache Solr? Architecture Features Core Solr Concepts Configuration Conclusions Bibliography.
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
The Anatomy of a Large-Scale Hypertextual Web Search Engine S. Brin and L. Page, Computer Networks and ISDN Systems, Vol. 30, No. 1-7, pages , April.
General Architecture of Retrieval Systems 1Adrienn Skrop.
Search Engine and Optimization 1. Introduction to Web Search Engines 2.
The Nutch Open-Source Search Engine CSE 454 Slides by Michael J. Cafarella.
Emdeon Office Batch Management Services This document provides detailed information on Batch Import Services and other Batch features.
Search Engine Optimization
ArcGIS for Server Security: Advanced
Dr. Frank McCown Comp 250 – Web Development Harding University
Statistics Visualizer for Crawler
IST 516 Fall 2010 Dongwon Lee, Ph.D. Wonhong Nam, Ph.D.
Improving searches through community clustering of information
Processes The most important processes used in Web-based systems and their internal organization.
Building Search Systems for Digital Library Collections
Implementation Issues & IR Systems
MG4J – Managing GigaBytes for Java Introduction
Configuring Internet-related services
Managing a Web Server and Files
Data Mining Chapter 6 Search Engines
Searching for Truth: Locating Information on the WWW
Introduction to Nutch Zhao Dongsheng
Searching for Truth: Locating Information on the WWW
Planning and Storyboarding a Web Site
Searching for Truth: Locating Information on the WWW
The Search Engine Architecture
Anwar Alhenshiri.
Presentation transcript:

Crawling Ida Mele

Nutch Apache Nutch is an open source Java implementation of a search engine. We can use Nutch for crawling a portion of the Web. Useful links: http://nutch.apache.org/ http://wiki.apache.org/nutch/NutchTutorial http://nutch.apache.org/apidocs-2.1/index.html Ida Mele Crawling

Nutch Advantages of Nutch: Understanding. We have the source code and we can use it to see how a large search engine works. Nutch has been built using ideas from academia and industry, and it is very useful for researchers who want to try out new search algorithms. Ida Mele Crawling

Nutch Transparency. The details of the ranking algorithms used by commercial search engines are secret, and usually there are economical reason behind the ranked list of results. Nutch implementation is transparent. We know how the ranking algorithms work, and we can trust on the fairness of the final rankings. Ida Mele Crawling

Nutch Extensibility. Nutch is a platform for adding search to heterogeneous collections of information. It allows to customize the search interface. We can use extend the out-of-the-box functionality through the plugin mechanism. Ida Mele Crawling

Nutch vs. Lucene Nutch is built on top of Lucene. Apache Lucene is a Java library for text indexing and searching. Lucene ensures high-performance, full-featured text search, it provides support for any application that requires full-text search, but it is not a crawler. Ida Mele Crawling

Architecture Nutch can be divided into two pieces: crawler, which fetches pages and turns them into an inverted index. searcher, which answers users' search queries. The index is the interface between the crawler and the searcher. The crawler and searcher systems can be on separate hardware platforms. Ida Mele Crawling

Architecture Crawler and searcher systems can be scaled independently. Example: if we have a highly trafficked search page that provides searching for a relatively modest set of sites. We may use a modest crawler infrastructure, and invest more substantial resources for supporting the searcher. Ida Mele Crawling

Crawler System The crawler system is driven by the Nutch tool called crawl, and by other related tools to build and maintain the data structures. Data structures are: the web database, a set of segments, the index. Ida Mele Crawling

WebDB The web database (WebDB) is a data structure for mirroring the structure and properties of the web graph being crawled. It stores two types of entities: Page. It is indexed by its URL and the MD5 hash of its contents. Other information: the # of outlinks, fetch information, the score of the page. Link. It represents the connection between the source page and the target page. Ida Mele Crawling

Segment The segment is a collection of pages that are fetched and indexed by the crawler in a run. The fetchlist is a list of URLs to fetch, and it is generated from the WebDB. The fetcher output is the data retrieved from the pages in the fetchlist. Any segment has a lifespan (30 days is the default re-fetch interval). Ida Mele Crawling

Index Inverted index of all of the pages the system has retrieved. The index is created by merging all of the individual segment indexes. Nutch uses Lucene to build the index. Note that in Lucene there is the concept of segment, but it is different. In Lucene, the index segment is a portion of the index. In Nutch, the segment is a fetched and indexed portion of the WebDB. Ida Mele Crawling

Crawling Nutch can operate at one of these three different scales: Local filesystem; Intranet; Web. All three scales have different characteristics. Example: crawling the file system is reliable compared to the other two scales. Ida Mele Crawling

Crawling For crawling billions of pages from the web, we have to: define the seed set: the set of pages we start with; decide how many crawlers we use and how partition the work among them; decide how often we want to do the re-crawling; cope with broken links, unresponsive sites, and unintelligible or duplicate content. Ida Mele Crawling

Crawling The crawling process is basically a cycle made of three steps: the crawler generates a set of fetchlists from the WebDB (generate), a set of fetchers downloads the content from the Web (fetch), the crawler updates the WebDB with new links that were found (update). Ida Mele Crawling

Crawling Nutch observes: Politeness, URLs with the same host are always assigned to the same fetchlist, so that a web site is not overloaded with requests from multiple fetchers in rapid succession. Robots Exclusion Protocol, which allows site owners to control which parts of their site may be crawled. Ida Mele Crawling

Crawling: low-level tools Crawling is done by the crawl tool of Nutch, that is a front-end to lower-level tools. The crawl tool can be used to get started with crawling websites, but then we need to use the lower-level tools to perform re-crawls and other maintenance on the data structures built during the initial crawl. Ida Mele Crawling

Crawling: low-level tools We can use the lower-level tools in sequence: Create a new WebDB (admin db -create). Inject root URLs into the WebDB (inject). Generate a fetchlist from the WebDB in a new segment (generate). Fetch content from URLs in the fetchlist (fetch). Update the WebDB with links from fetched pages (updatedb). Repeat steps 3-5 until the required depth is reached. Ida Mele Crawling

Crawling: low-level tools Update segments with scores and links from the WebDB (updatesegs). Index the fetched pages (index). Eliminate duplicate content, and duplicate URLs, from the indexes (dedup). Merge the indexes into a single index for searching (merge). Ida Mele Crawling

Crawling: low-level tools We create a new WebDB (step 1), and we populate it with some seed URLs (step 2). Then we use the generate/fetch/update cycle (steps 3-6). When this cycle has finished, the crawler goes on to create an index (steps 7-10): each segment is indexed independently (step 8), the duplicate pages are removed (step 9), the individual indexes are combined into a single index (step 10). Ida Mele Crawling

Running a crawl with Nutch Download and unpack a Nutch distribution (for example apache-nutch-1.1-bin.zip). Make sure that the environment variable NUTCH_JAVA_HOME or JAVA_HOME is set properly, so as it tells Nutch where Java is: Run the following command or add it to the .bashrc file: export NUTCH_JAVA_HOME= %pathJava Ida Mele Crawling

Nutch configuration All of Nutch's configuration files are in the conf subdirectory of the Nutch distribution. The main configuration file is conf/nutch-default.xml. It contains the default settings, and should not be modified. To change a setting we can create or update the conf/nutch-site.xml file. Ida Mele Crawling

Nutch configuration Add your agent name in the value field of the http.agent.name property of the file conf/nutch-site.xml, for example we can use the name: Sapienza University. <property> <name>http.agent.name</name> <value>Sapienza University</value> <description> HTTP 'User-Agent' request header. MUST NOT be empty - please set this to a single word uniquely related to your organization. </description> </property> Ida Mele Crawling

Url filter The crawl tool uses a filter to decide which URLs can go into the WebDB (steps 2 and 5). This can be used to restrict the crawl
to the URLs that match any given pattern, specified by regular expressions. For example, if we want to restrict the domain to the DIS domain, we have to update the configuration file conf/crawl-urlfilter.txt. Ida Mele Crawling

Url filter +^http://([a-z0-9]*\.)*MY.DOMAIN.NAME/ with: Open the file conf/crawl-urlfilter.txt and replace the line: +^http://([a-z0-9]*\.)*MY.DOMAIN.NAME/ with: +^http://([a-z0-9]*\.)*dis.uniroma1.it/ The file conf/crawl-urlfilter.txt will contain: # accept hosts in MY.DOMAIN.NAME #+^http://([a-z0-9]*\.)*MY.DOMAIN.NAME/ +^http://([a-z0-9]*\.)*dis.uniroma1.it/ Ida Mele Crawling

Example Create a file called urls, that contains the root URLs. These URLs will be used to populate the initial fetchlist. For example, if we want to start from the home page of the department, we will use: echo ‘http://www.dis.uniroma1.it’ > urls Ida Mele Crawling

Example We run the crawler with: bin/nutch crawl urls -dir mycrawl -depth 5 > mycrawl.log where: urls is the name of the file with the seed URLs. mycrawl is the name of the directory. 5 is the depth of the crawling. mycrawl.log is the name of the log file. Ida Mele Crawling

Results of the Crawl The directory mycrawl contains the following subdirectories: crawldb linkdb segments index indexes Ida Mele Crawling

Results of the Crawl: readdb The readdb tool parses the WebDB and displays portions of it in human-readable form. The stats option displays the number of pages and links: bin/nutch readdb mycrawl/crawldb -stats >stats.txt Use: more stats.txt Ida Mele Crawling

Results of the Crawl: readdb The dump option gives the dump of the pages. Each page appears in a separate block, with one field per line. The ID field is the MD5 hash of the page contents. There is also information about when the pages should be next fetched (which defaults to 30 days), and the page scores. We issue the command: bin/nutch readdb mycrawl/crawldb -dump mydump and then use: more mydump/part-00000 Ida Mele Crawling

Results of the Crawl: readdb The readdb tool also supports extraction of an individual page or link by URL or MD5 hash. For example, to examine the info of the page http://cclii.dis.uniroma1.it/airo/index.php we issue the command: bin/nutch readdb mycrawl/crawldb -url http://www.dis.uniroma1.it/airo/index.php Ida Mele Crawling

Results of the Crawl: readlinkdb The readlinkdb tool can be used to create the dump of the link structure (the graph): bin/nutch readlinkdb mycrawl/linkdb/ -dump mylinks We can read the in-links by using: more mylinks/part-00000 Note that it gives us just the list of the in-links. For the out-links we have to merge the segments and read the result. Ida Mele Crawling

Results of the Crawl: readseg The crawl creates a few segments in timestamped subdirectories, one for each 
generate/fetch/update cycle. The readseg tool is the segment reader. The option list gives a summary of all of the generated segments: bin/nutch readseg -list -dir mycrawl/segments/ Ida Mele Crawling

Results of the Crawl: readseg The option dump gives a dump of a given segment: bin/nutch readseg -dump mycrawl/segments/20111204150100/ dump_seg1 Use: more dump_seg1/dump *Note that the name of the segment is given by the date and time we created the segment. For instance, 20111204150100 is the name of the segment created on 2011-12-04 at 15:01:00. Ida Mele Crawling

Results of the Crawl: mergeseg We have seen that the readlinkdb tool can be used to have the list of in-links. To have the out-links we need to merge the segments and read the result. We use the mergesegs tool: bin/nutch mergesegs whole-segments -dir mycrawl/segments/* Then we can use the dump option of the readseg tool on the result of the merge: bin/nutch readseg -dump whole-segments/20111204174133/ dump-outlinks Ida Mele Crawling

Exercise Install and configure Nutch. Create the file with the seed set (example urls). Update the conf/url-filter.txt file. Decide the depth of the crawling and crawl a portion of the web using the crawl tool. Download NutchGraph.jar and add it to the directory containing all the libraries. Update the set-classpath.sh file. Set the classpath. Ida Mele Crawling

Exercise Create the file with in-links using the following commands: bin/nutch readlinkdb mycrawl/linkdb/ -dump mylinks egrep -v $'^$' mylinks/part-00000 >inlinks.txt Merge the segments: bin/nutch mergesegs whole-segments -dir mycrawl/segments/* Use readseg to read the segments and create the file with out-links: bin/nutch readseg -dump whole-segments/20111204174133/ dump-outlinks cat dump-outlinks/dump | egrep 'URL|toUrl' >outlinks.txt Ida Mele Crawling

Exercise Print the in-links and out-links in the links.txt file by issuing the following commands: java nutchGraph.PrintInlinks inlinks.txt >links.txt java nutchGraph.PrintOutlinks outlinks.txt >>links.txt Remove the duplicates: LANG=C sort links.txt | uniq > cleaned-links.txt Ida Mele Crawling

Exercise Create the map of urls with the following commands: cut -f1 links.txt >url-list.txt cut -f2 links.txt >>url-list.txt LANG=C sort url-list.txt | uniq > sorted-url-list.txt java -Xmx2G it.unimi.dsi.util.FrontCodedStringList -u -r 32 umap.fcl < sorted-url-list.txt java -Xmx2G it.unimi.dsi.sux4j.mph.MWHCFunction umap.mph sorted-url-list.txt Ida Mele Crawling

Exercise Create the graph: java -Xmx2G nutchGraph.PrintEdges cleaned-links.txt umap.mph > webgraph.dat numNodes=$(wc -l < sorted-url-list.txt) java -Xmx2G nutchGraph.IncidenceList2Webgraph $numNodes webgraph java -Xmx2G it.unimi.dsi.webgraph.BVGraph -g ASCIIGraph webgraph webgraph Ida Mele Crawling

Indexing Once the crawling operation is completed, we have the graph and the indexed pages. Remember that Nutch uses Lucene for the indexing phase. If we want to use MG4J we can collect with wget the pages fetched during the crawling: wget –i sorted-url-list.txt Then we can use MG4J for indexing and querying the resulting collection of web documents. Ida Mele Crawling

Nutch getfiles MG4J WEB readdb ParserDB db graph.txt BVGraph Query Link structure ParserDB db graph.txt getfiles ASCIIGraph files BVGraph MG4J Query QueryMG4J PageRank RankPR Ida Mele Crawling

Homework Repeat the exercise using a different seed set. Create the corresponding webgraph. Compute the Pagerank for the nodes of the webgraph. Plot the distribution of the Pagerank values. Ida Mele Crawling