org.mycore.services.fieldquery
Class MCRMoreLikeThis

java.lang.Object
  extended by org.mycore.services.fieldquery.MCRMoreLikeThis

public class MCRMoreLikeThis
extends Object

Uses package queries from lucene/contrib/queries to do a "more like this" query. When using this class, you have to define a field "score" in searchfields.xml:

Author:
Harald Richter, Frank Lützenkirchen

Constructor Summary
MCRMoreLikeThis()
           
 
Method Summary
static MCRResults moreLikeThis(MCRFieldValue value, double minScore, int maxResults)
          Does "more like this" query, used to find documents with similar content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MCRMoreLikeThis

public MCRMoreLikeThis()
Method Detail

moreLikeThis

public static MCRResults moreLikeThis(MCRFieldValue value,
                                      double minScore,
                                      int maxResults)
                               throws Exception
Does "more like this" query, used to find documents with similar content. The results contain a metadata field "score" which contains a value between 0 and 1 indicating similarity to the given field value.

Parameters:
value - the MCRFieldValue to search similar entries for
minScore - the minimum score the hits must reach, a value between 0 and 1, for example 0.9
maxResults - the maximum number of hits to return. A value less than 1 means to return all hits.
Returns:
the MCRResults of the search
Throws:
Exception