RemoteSearchable.javaAPI DocApache Lucene 1.94167Mon Feb 20 09:20:04 GMT


public class RemoteSearchable extends UnicastRemoteObject implements Searchable
A remote searchable implementation.
$Id: 351472 2005-12-01 21:15:53Z bmesser $

Fields Summary
private Searchable
Constructors Summary
public RemoteSearchable(Searchable local)
Constructs and exports a remote searcher.

    this.local = local;
Methods Summary
public voidclose()

public org.apache.lucene.document.Documentdoc(int i)

    return local.doc(i);
public intdocFreq(org.apache.lucene.index.Term term)

    return local.docFreq(term);
public int[]docFreqs(org.apache.lucene.index.Term[] terms)

    return local.docFreqs(terms);
public query, int doc)

    return local.explain(query, doc);
public weight, int doc)

    return local.explain(weight, doc);
public static voidmain(java.lang.String[] args)
Exports a searcher for the index in args[0] named "//localhost/Searchable".

    String indexName = null;
    if (args != null && args.length == 1)
      indexName = args[0];
    if (indexName == null) {
      System.out.println("Usage: <index>");
    // create and install a security manager
    if (System.getSecurityManager() == null) {
      System.setSecurityManager(new RMISecurityManager());
    Searchable local = new IndexSearcher(indexName);
    RemoteSearchable impl = new RemoteSearchable(local);
    // bind the implementation to "Searchable"
    Naming.rebind("//localhost/Searchable", impl);
public intmaxDoc()

    return local.maxDoc();
public original)

    return local.rewrite(original);
public query, filter, int n, sort)

    return (query, filter, n, sort);
public weight, filter, int n, sort)

    return (weight, filter, n, sort);
public voidsearch( query, filter, results), filter, results);
public voidsearch( weight, filter, results), filter, results);
public query, filter, int n)

    return, filter, n);
public weight, filter, int n)

    return, filter, n);