Document comparison / similarity using Whoosh Python Search Library


How do I get a similarity measure of a document using Whoosh?

I want to create a “Related” feature that ranks other previously indexed documents that have a high similarity to a document.

Do I input the document as a long query string? Do I add the document to the index and extract a similarity query result somehow from there?


Asked By: seanieb



The Whoosh searcher class has a method called ‘more_like()’.

It allows you to compare and indexed document to other indexed documents and returns a list of documents similar to the given document.

And the class whoosh.searching.Hit can give a rank and a score.

Updated links:

more_like() :
whoosh.searching.Hit :

Answered By: seanieb
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.