问题
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?
Thanks
回答1:
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.
来源:https://stackoverflow.com/questions/9010660/document-comparison-similarity-using-whoosh-python-search-library