![JAR search and dependency download from the Maven repository](/logo.png)
src.it.unimi.dsi.big.mg4j.index.cluster.DocumentalPartitioningStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mg4j-big Show documentation
Show all versions of mg4j-big Show documentation
MG4J (Managing Gigabytes for Java) is a free full-text search engine for large document collections written in Java. The big version is a fork of the original MG4J that can handle more than 2^31 terms and documents.
The newest version!
package it.unimi.dsi.big.mg4j.index.cluster;
/*
* MG4J: Managing Gigabytes for Java (big)
*
* Copyright (C) 2006-2011 Sebastiano Vigna
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, see .
*
*/
/** A way to associate a document with a local index out of a given set and a local document number in the local index.
*
* When partitioning documentally an index, we need a way to associate
* to each global document pointer {@linkplain #localIndex(long) a local index} (the index
* that will contain the postings of that document) and {@linkplain #localPointer(long) a local
* document pointer} (the document pointer actually represented in the local index).
*
*
Usually, a documental partitioning strategy has a matching
* {@link it.unimi.dsi.big.mg4j.index.cluster.DocumentalClusteringStrategy}
* whose methods satisfy the following equations:
*
* globalPointer(localIndex(d), localPointer(d)) = d
* <localIndex(globalPointer(i, l)), localPointer(globalPointer(i, l))> = <i, l>
*
*
* @author Alessandro Arrabito
* @author Sebastiano Vigna
*/
public interface DocumentalPartitioningStrategy extends PartitioningStrategy {
/** Returns the index to which a given global document pointer is be mapped by this strategy.
*
* @param globalPointer a global document pointer.
* @return the corresponding local index.
*/
int localIndex( final long globalPointer );
/** Returns the local document pointer corresponding to a global document pointer.
*
* @param globalPointer a global document pointer.
* @return the corresponding local document pointer.
*/
long localPointer( long globalPointer );
/** Returns the number of documents that will be assigned to the given local index.
*
* @param localIndex the local index.
* @return the number of documents that will be assigned to localIndex
.
*/
long numberOfDocuments( int localIndex );
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy