Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions chapter4/searchengine.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ def separatewords(self,text):

# Return true if this url is already indexed
def isindexed(self,url):
u=self.con.execute("select rowid from urllist where url='%s'" % url).fetchone()
if u!=None:
# Check if it has actually been crawled
v=self.con.execute( 'select * from wordlocation where urlid=%d' % u[0]).fetchone()
if v!=None: return True
return False

# Add a link between two pages
Expand Down