public class DataFusion extends Object implements Serializable
| Constructor and Description |
|---|
DataFusion(URI[] locators,
String query)
Instantiates data fusion for the records in the locators and the given query
|
DataFusion(URI[] locators,
String query,
Integer count)
Instantiates data fusion for the records in the locators and the given query
and returns up to the count records
|
| Modifier and Type | Method and Description |
|---|---|
URI |
operate() |
URI |
rerank()
|
static URI |
rerankRecords(Iterator<PositionalRecordWrapper> iter,
String query,
int count,
List<String> snippetFields,
Boolean includePosition)
Takes an iterator of
PositionalRecordWrappers and puts them in a lucene index. |
public DataFusion(URI[] locators, String query) throws gr.uoa.di.madgik.grs.reader.GRS2ReaderException
locators - query - gr.uoa.di.madgik.grs.reader.GRS2ReaderExceptionpublic DataFusion(URI[] locators, String query, Integer count) throws gr.uoa.di.madgik.grs.reader.GRS2ReaderException
locators - query - count - gr.uoa.di.madgik.grs.reader.GRS2ReaderExceptionpublic URI rerank() throws Exception
rerankRecords(java.util.Iterator<org.gcube.search.datafusion.datatypes.PositionalRecordWrapper>, java.lang.String, int, java.util.List<java.lang.String>, java.lang.Boolean)Exceptionpublic static URI rerankRecords(Iterator<PositionalRecordWrapper> iter, String query, int count, List<String> snippetFields, Boolean includePosition) throws Exception
PositionalRecordWrappers and puts them in a lucene index. Then it performs the query to rerank the records and
returns the URI of the gRS of the result. The query is performed on an extra field that is either included the payload of the record field
in the list of snippetFields or the actual payload of the record (if none of the snippetFields are included in the record). The actual payload
is retrieved from the objectID field which is a URI (text extraction is used to parse the response).
After the records are reranked based on the query we can rearrange the results based on their initial position of each record by setting includePosition to true.
This rearrangement is done in RankedRecord.recalculateScores(java.util.Map<java.lang.String, java.lang.Long>, java.util.Map<java.lang.String, org.gcube.search.datafusion.datatypes.Pair>, java.lang.Boolean) and the actual calculation of the final score based on the lucene score and the initial position
is done in RankedRecord.calcScore(org.gcube.search.datafusion.datatypes.RankedRecord)iter - query - count - snippetFields - includePosition - ExceptionCopyright © 2016. All Rights Reserved.