Tornado – Whoosh – MoreLike and MoreLikeThis


Like other search engines, Whoosh too provides more_like() and more_like_this() methods to find similar documents in the index, Typically, morelikethis doesnt execute any special query to get the list of similar documents to the one specified, but in fact it searches all other documents in the index relative to the document content that is specified. Here’s a example of more_like() method of Whoosh integrated with Tornado

User enters the document path and submits it to the index which then presents the similar morelike documents. User form code here

In the code below:

  • document_number(path=path) gets the document number of the specified document path in the index
  • more_like(docnum, ‘content’) method then find documents *like* the specified document based on content
  • more_like_this(“content”, top=1) method searches the top 1 sub-hits

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s