com.atlassian.confluence.search.didyoumean.lucene
Class DidYouMeanLuceneConnection

java.lang.Object
  extended by com.atlassian.bonnie.LuceneConnection
      extended by com.atlassian.confluence.search.didyoumean.lucene.DidYouMeanLuceneConnection
All Implemented Interfaces:
com.atlassian.bonnie.ILuceneConnection

public class DidYouMeanLuceneConnection
extends com.atlassian.bonnie.LuceneConnection

A subclass of LuceneConnection that allows us to set the index directory off the location of the Confluence index and allows us to use a DelayCloseIndexSearcher in place of the normal IndexSearcher returned by LuceneConnection.getSearcher().

The index searcher managed by this connection also uses a customized Similarity class. The purpose of which is to negate the idf for n-gram matches (as we consider all n-gram matches to be equal).


Nested Class Summary
 
Nested classes/interfaces inherited from class com.atlassian.bonnie.LuceneConnection
com.atlassian.bonnie.LuceneConnection.TempIndexWriterData
 
Nested classes/interfaces inherited from interface com.atlassian.bonnie.ILuceneConnection
com.atlassian.bonnie.ILuceneConnection.BatchUpdateAction, com.atlassian.bonnie.ILuceneConnection.Configuration, com.atlassian.bonnie.ILuceneConnection.ReaderAction, com.atlassian.bonnie.ILuceneConnection.SearcherAction, com.atlassian.bonnie.ILuceneConnection.WriterAction
 
Field Summary
 
Fields inherited from class com.atlassian.bonnie.LuceneConnection
analyzerForIndexing, LOG, REINDEXING_FILENAME, searcherOpensNewReader, WRITER_BATCH, WRITER_DEFAULT, WRITER_INTERACTIVE
 
Fields inherited from interface com.atlassian.bonnie.ILuceneConnection
DEFAULT_CONFIGURATION
 
Constructor Summary
DidYouMeanLuceneConnection(BootstrapManager bootstrapManager, org.apache.lucene.analysis.Analyzer didYouMeanAnalyzer)
           
 
Method Summary
 java.io.File getIndexDir()
           
protected  org.apache.lucene.search.IndexSearcher getSearcher()
           
 
Methods inherited from class com.atlassian.bonnie.LuceneConnection
close, flushWriter, getDirectory, getNumDocs, getReader, getWriter, getWriter, isIndexCreated, isReIndexing, leakSearcher, optimize, recreateIndexDirectory, setAlwaysUnlock, setIndexDir, setReIndexing, setSearcherOpensNewReader, shouldCreateIndexDirectory, truncateIndex, unlockIfNeeded, withBatchUpdate, withDeleteAndWrites, withReader, withReaderAndDeletes, withSearch, withWriter, withWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DidYouMeanLuceneConnection

public DidYouMeanLuceneConnection(BootstrapManager bootstrapManager,
                                  org.apache.lucene.analysis.Analyzer didYouMeanAnalyzer)
                           throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getIndexDir

public java.io.File getIndexDir()
Overrides:
getIndexDir in class com.atlassian.bonnie.LuceneConnection

getSearcher

protected org.apache.lucene.search.IndexSearcher getSearcher()
                                                      throws java.io.IOException
Overrides:
getSearcher in class com.atlassian.bonnie.LuceneConnection
Throws:
java.io.IOException


Copyright © 2003-2008 Atlassian Pty Ltd. All Rights Reserved.