Here is my search method, maybe it's something wrong with it:

public Vector buscar(String busqueda) throws Exception, Error
  {
    Vector results = new Vector();
    ResultadoBusqueda rb = null;
    IndexSearcher searcher = new IndexSearcher("/index");    
    Analyzer analyzer = new StandardAnalyzer();
    Hits hits = null;
    Document doc = null;
    String path = "";
    String nombreArchivo = "";
  
    String line = busqueda;
  
    QueryParser qp = new QueryParser("contents", analyzer);
    qp.setOperator(QueryParser.DEFAULT_OPERATOR_AND);
    Query query = qp.parse(line);
    System.out.println("Searching for: " + query.toString("contents"));
    hits = searcher.search(query);
    
    for(int i = 0; i < hits.length(); i++)
    {
      doc = hits.doc(i);


      path = doc.get("path").replaceAll("R:",
"http://informatica.suranet.com/SDI";);
      path = path.replace('\\', '/');
      nombreArchivo = path.substring(path.lastIndexOf("/")+1);

      rb = new ResultadoBusqueda(nombreArchivo, path);
      results.add(rb);
    }
    searcher.close();
    return results;

  }
--
View this message in context: 
http://www.nabble.com/java.lang.OutOfMemoryError-in-lucene-t1324911.html#a3579744
Sent from the Lucene - Java Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to