FileDocCategorySizeDatePackage
RemoteSearchable.javaAPI DocApache Lucene 1.4.32714Tue Mar 30 00:48:04 BST 2004org.apache.lucene.search

RemoteSearchable

public class RemoteSearchable extends UnicastRemoteObject implements Searchable
A remote searchable implementation.

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

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

    local.close();
  
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 org.apache.lucene.search.Explanationexplain(org.apache.lucene.search.Query query, int doc)

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

    // create and install a security manager
    if (System.getSecurityManager() == null) {
      System.setSecurityManager(new RMISecurityManager());
    }
    
    Searchable local = new IndexSearcher(args[0]);
    RemoteSearchable impl = new RemoteSearchable(local);
      
    // bind the implementation to "Searchable"
    Naming.rebind("//localhost/Searchable", impl);
  
public intmaxDoc()

    return local.maxDoc();
  
public org.apache.lucene.search.Queryrewrite(org.apache.lucene.search.Query original)

    return local.rewrite(original);
  
public voidsearch(org.apache.lucene.search.Query query, org.apache.lucene.search.Filter filter, org.apache.lucene.search.HitCollector results)

    local.search(query, filter, results);
  
public org.apache.lucene.search.TopDocssearch(org.apache.lucene.search.Query query, org.apache.lucene.search.Filter filter, int n)

    return local.search(query, filter, n);
  
public org.apache.lucene.search.TopFieldDocssearch(org.apache.lucene.search.Query query, org.apache.lucene.search.Filter filter, int n, org.apache.lucene.search.Sort sort)

    return local.search (query, filter, n, sort);