package com.caucho.lucene;

import io.baratine.core.Result;

public interface LuceneIndex
{
  /**
   * Updates lucene index for item at bfsPath
   *
   * @param path   BFS path e.g. bfs:///tmp/test.txt
   * @param result
   */
  public void indexFile(String path, Result<Boolean> result)
    throws LuceneException;

  /**
   * Updates lucene index for data specified in <code>stream</code> parameter.
   *
   * @param id     - id that will be associated with the data
   * @param text - text
   * @param result
   */
  public void indexText(String id, String text, Result<Boolean> result)
    throws LuceneException;

  /**
   * Executes lucene search
   *
   * @param query  query that is passed to lucene QueryParser
   * @param limit  specifies upper limit on the result set
   * @param result files
   */
  public void search(String query, int limit, Result<LuceneEntry[]> result)
    throws LuceneException;

  /**
   * Executes lucene search returning results after a known entry passed in
   * parameter <code>after</code>.
   *
   * @param query  query that is passed to lucene QueryParser
   * @param after  specifies last collected entry or null
   * @param limit
   * @param result
   */
  public void searchAfter(String query,
                          LuceneEntry after,
                          int limit,
                          Result<LuceneEntry[]> result) throws LuceneException;

  /**
   * Deletes document from an index
   *
   * @param id BFS path or id of a string
   * @see #indexFile
   * @see #indexText
   */
  public void delete(String id, Result<Boolean> result)
    throws LuceneException;

  /**
   * Delete all indexes
   *
   * @param result
   */
  public void clear(Result<Void> result) throws LuceneException;
}

@@ -54,16 +54,39 @@
 esult;%0A%0A
+import java.util.Map;%0A%0A
 public i
@@ -502,16 +502,18 @@
 am text 
+  
 - text%0A 
@@ -629,32 +629,415 @@
 ceneException;%0A%0A
+  /**%0A   * Updates lucene index for data specified in a %3Ccode%3Emap%3C/code%3E parameter.%0A   * Each key in the map becomes a searchable field%0A   *%0A   * @param id%0A   * @param map%0A   * @param result%0A   * @throws LuceneException%0A   */%0A  public void indexMap(String id,%0A                       Map%3CString,Object%3E map,%0A                       Result%3CBoolean%3E result)%0A    throws LuceneException;%0A%0A
   /**%0A   * Execu

add map search