Package org.springmodules.lucene.search.factory

Examples of org.springmodules.lucene.search.factory.LuceneSearcher.search()


    searcherFactoryControl.setReturnValue(searcher, 1);
   
    queryCreator.createQuery(analyzer);
    queryCreatorControl.setReturnValue(query, 1);
   
    searcher.search(query, filter, sort);
    searcherControl.setReturnValue(hits, 1);

    queryResultCreator.createResult(hits, hitExtractor);
    List ret = new ArrayList();
    ret.add(obj);
View Full Code Here


  }

  public void search(QueryCreator queryCreator, HitCollector results) {
    LuceneSearcher searcher = SearcherFactoryUtils.getSearcher(getSearcherFactory());
    try {
      searcher.search(queryCreator.createQuery(getAnalyzer()), results);
    } catch (IOException ex) {
      throw new LuceneSearchException("Error during the search", ex);
    } catch (ParseException ex) {
      throw new LuceneSearchException("Error during the parse of the query", ex);
    } finally {
View Full Code Here

    LuceneIndexReader reader = IndexReaderFactoryUtils.getIndexReader(indexFactory);
    LuceneSearcher searcher = null;
    Document updatedDocument = null;
    try {
      searcher = reader.createSearcher();
      LuceneHits hits = searcher.search(new TermQuery(identifierTerm));
      checkHitsForUpdate(hits);
      updatedDocument = documentModifier.updateDocument(hits.doc(0));
    } catch(Exception ex) {
      throw new LuceneIndexAccessException("Error during updating a document.", ex);
    } finally {
View Full Code Here

  public void updateDocuments(Term identifierTerm, DocumentsModifier documentsModifier, Analyzer analyzer) {
    LuceneIndexReader reader = IndexReaderFactoryUtils.getIndexReader(indexFactory);
    LuceneSearcher searcher = reader.createSearcher();
    List updatedDocuments = null;
    try {
      LuceneHits hits = searcher.search(new TermQuery(identifierTerm));
      updatedDocuments = documentsModifier.updateDocuments(hits);
    } catch(Exception ex) {
      throw new LuceneIndexAccessException("Error during updating a document.", ex);
    } finally {
      SearcherFactoryUtils.closeSearcher(searcher);
View Full Code Here

          QueryResultCreator queryResultCreator, Filter filter, Sort sort) {
    LuceneSearcher searcher = SearcherFactoryUtils.getSearcher(getSearcherFactory());
    try {
      LuceneHits hits = null;
      if( filter!=null && sort!=null ) {
        hits = searcher.search(query, filter, sort);
      } else if( filter!=null ) {
        hits = searcher.search(query, filter);
      } else if( sort!=null ) {
        hits = searcher.search(query, sort);
      } else {
View Full Code Here

    try {
      LuceneHits hits = null;
      if( filter!=null && sort!=null ) {
        hits = searcher.search(query, filter, sort);
      } else if( filter!=null ) {
        hits = searcher.search(query, filter);
      } else if( sort!=null ) {
        hits = searcher.search(query, sort);
      } else {
        hits = searcher.search(query);
      }
View Full Code Here

      if( filter!=null && sort!=null ) {
        hits = searcher.search(query, filter, sort);
      } else if( filter!=null ) {
        hits = searcher.search(query, filter);
      } else if( sort!=null ) {
        hits = searcher.search(query, sort);
      } else {
        hits = searcher.search(query);
      }
      //return extractHits(hits, extractor);
      return queryResultCreator.createResult(hits, hitExtractor);
View Full Code Here

      } else if( filter!=null ) {
        hits = searcher.search(query, filter);
      } else if( sort!=null ) {
        hits = searcher.search(query, sort);
      } else {
        hits = searcher.search(query);
      }
      //return extractHits(hits, extractor);
      return queryResultCreator.createResult(hits, hitExtractor);
    } catch (IOException ex) {
      throw new LuceneSearchException("Error during the search", ex);
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.