org.kit.furia.index
Class FIRIndexShort<O extends org.ajmm.obsearch.ob.OBShort>
java.lang.Object
org.kit.furia.index.AbstractIRIndex<O>
org.kit.furia.index.FIRIndexShort<O>
- All Implemented Interfaces:
- IRIndex<O>, IRIndexShort<O>
public class FIRIndexShort<O extends org.ajmm.obsearch.ob.OBShort>
- extends AbstractIRIndex<O>
- implements IRIndexShort<O>
FIRIndexShort uses IR techniques to match OB objects (OBSearch objects) when
the objects extend from OBShort.
- Since:
- 0
- Author:
- Arnoldo Jose Muller Molina
Constructor Summary |
FIRIndexShort(org.ajmm.obsearch.index.IndexShort<O> index,
java.io.File dbFolder)
Creates a new IR Index that works on shorts |
Method Summary |
org.ajmm.obsearch.Index<O> |
getIndex()
Returns the underlying OBSearch index. |
int |
getWordsSize()
Returns the count different words that
are used by the documents indexed. |
java.util.List<ResultCandidate> |
search(Document<O> document,
byte k,
short r,
short n)
Searches the top n documents that are closest to document. |
Methods inherited from class org.kit.furia.index.AbstractIRIndex |
calculateSimilarity, close, createPriorityQueue, delete, freeze, getMSetScoreThreshold, getSetScoreThreshold, getSize, insert, isValidationMode, processQueryResults, setMSetScoreThreshold, setSetScoreThreshold, setValidationMode, shouldSkipDoc |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.kit.furia.IRIndex |
close, delete, freeze, getMSetScoreThreshold, getSetScoreThreshold, getSize, insert, isValidationMode, setMSetScoreThreshold, setSetScoreThreshold, setValidationMode, shouldSkipDoc |
FIRIndexShort
public FIRIndexShort(org.ajmm.obsearch.index.IndexShort<O> index,
java.io.File dbFolder)
throws java.io.IOException
- Creates a new IR Index that works on shorts
- Parameters:
dbFolder
- The folder in which Lucene's files will be stored
- Throws:
java.io.IOException
- If the given directory does not exist or if some other IO
error occurs
search
public final java.util.List<ResultCandidate> search(Document<O> document,
byte k,
short r,
short n)
throws IRException
- Description copied from interface:
IRIndexShort
- Searches the top n documents that are closest to document. For each
"word" (element) that composes document, at most k closest objects will
be returned, and all of the returned objects will be used to create the
query. The k
- Specified by:
search
in interface IRIndexShort<O extends org.ajmm.obsearch.ob.OBShort>
- Parameters:
document
- A multi-set of objects OBShort.k
- k for the nearest neighbor search. All the k-elements will be used to create the IR query.r
- range for the nearest neighbor searchn
- Maximum # of elements to return
- Returns:
- The closest elements to document. The leftmost document is the
closest document.
- Throws:
IRException
- If something goes really wrong.
getIndex
public org.ajmm.obsearch.Index<O> getIndex()
- Description copied from interface:
IRIndex
- Returns the underlying OBSearch index.
- Specified by:
getIndex
in interface IRIndex<O extends org.ajmm.obsearch.ob.OBShort>
- Returns:
- the underlying OBSearch index.
getWordsSize
public int getWordsSize()
throws com.sleepycat.je.DatabaseException
- Description copied from interface:
IRIndex
- Returns the count different words that
are used by the documents indexed.
- Specified by:
getWordsSize
in interface IRIndex<O extends org.ajmm.obsearch.ob.OBShort>
- Returns:
- the count different words that
are used by the documents indexed.
- Throws:
com.sleepycat.je.DatabaseException
Copyright © 2008 Arnoldo Jose Muller Molina. All Rights Reserved.