Examples of SQLRequest


Examples of org.springmodules.lucene.index.document.handler.database.SqlRequest

  public void index(DataSource dataSource, boolean optimizeIndex) {
    LuceneIndexWriter writer = IndexWriterFactoryUtils.getIndexWriter(getIndexFactory());
    try {
      Set requests = requestDocumentHandlers.keySet();
      for(Iterator i=requests.iterator(); i.hasNext();) {
        SqlRequest request = (SqlRequest)i.next();
        SqlDocumentHandler handler = (SqlDocumentHandler)requestDocumentHandlers.get(request);
        doHandleRequest(writer, dataSource, request, handler);
      }
      //Optimize the index
      if( optimizeIndex ) {
View Full Code Here

Examples of org.springmodules.lucene.index.document.handler.database.SqlRequest

    this.indexer = new DefaultDatabaseIndexer(indexFactory);
  }

  public void prepareDatabaseHandlers() {
    //Register the request handler for book_page table without parameters
    this.indexer.registerDocumentHandler(new SqlRequest("select book_page_text from book_page"),
    new SqlDocumentHandler() {
      public Document getDocument(SqlRequest request, ResultSet rs) throws SQLException {
        Document document = new Document();
        document.add(new Field("contents", rs.getString("book_page_text"), Field.Store.YES, Field.Index.TOKENIZED));
        document.add(new Field("request", request.getSql(), Field.Store.YES, Field.Index.UN_TOKENIZED));
View Full Code Here

Examples of org.springmodules.lucene.index.support.database.SqlRequest

  public void index(DataSource dataSource,boolean optimizeIndex) {
    IndexWriter writer = IndexWriterFactoryUtils.getIndexWriter(getIndexFactory());
    try {
      Set requests=requestDocumentHandlers.keySet();
      for(Iterator i=requests.iterator();i.hasNext();) {
        SqlRequest request=(SqlRequest)i.next();
        SqlDocumentHandler handler=(SqlDocumentHandler)requestDocumentHandlers.get(request);
        doHandleRequest(writer,dataSource,request,handler);
      }
      //Optimize the index
      if( optimizeIndex ) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.