ISSearch
Interface ISPeerServerInterface

All Superinterfaces:
Remote
All Known Implementing Classes:
ISPeerServer

public interface ISPeerServerInterface
extends Remote

RMI Remote Interface for the Server part of the distributed IS Search application


Field Summary
static int port
          The port of the RMI service that is used by clients to submit queries to the server.
static String serviceName
          The name of the peer search engine that is used by clients to execute queries via RMI.
 
Method Summary
 ISPeerResultInterface[] search(String query, int numResults)
          Remotely invocable search method.
 

Field Detail

port

public static final int port
The port of the RMI service that is used by clients to submit queries to the server. The RMI service runs by default on port 1099.

See Also:
Constant Field Values

serviceName

public static final String serviceName
The name of the peer search engine that is used by clients to execute queries via RMI.

See Also:
Constant Field Values
Method Detail

search

public ISPeerResultInterface[] search(String query,
                                      int numResults)
                               throws RemoteException
Remotely invocable search method. This method is called by peers to execute queries.

Parameters:
query - The query that is submitted by the client. The query syntax is prescribed by Assignment 4 (Query Processor).
numResults - The max number of best matches that can be returned as search results for the query.
Returns:
The array of search results that contains up to numResults matches, sorted in DESCENDING ORDER of relevance. The relevance is defined as the similarity between the document and the query (we use the scalar product between two feature vectors that represent the query and the document as the similarity metric).
Throws:
RemoteException - if the remote invocation of the search fails.