net.sourceforge.pebble.index
Class SearchIndex

java.lang.Object
  extended by net.sourceforge.pebble.index.SearchIndex

public class SearchIndex
extends java.lang.Object

Wraps up the functionality to index blog entries. This is really just a convenient wrapper around Lucene.

Author:
Simon Brown

Constructor Summary
SearchIndex(Blog blog)
           
 
Method Summary
 void clear()
          Clears the index.
 void index(BlogEntry blogEntry)
          Allows a single blog entry to be (re)indexed.
 void index(StaticPage staticPage)
          Allows a single static page to be (re)indexed.
 void indexBlogEntries(java.util.List<BlogEntry> blogEntries)
          Allows a collection of blog entries to be indexed.
 void indexStaticPages(java.util.List<StaticPage> staticPages)
          Allows a collection of static pages to be indexed.
 SearchResults search(java.lang.String queryString)
           
 void unindex(BlogEntry blogEntry)
          Removes the index for a single blog entry to be removed.
 void unindex(StaticPage staticPage)
          Removes the index for a single blog entry to be removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchIndex

public SearchIndex(Blog blog)
Method Detail

clear

public void clear()
Clears the index.


indexBlogEntries

public void indexBlogEntries(java.util.List<BlogEntry> blogEntries)
Allows a collection of blog entries to be indexed.


indexStaticPages

public void indexStaticPages(java.util.List<StaticPage> staticPages)
Allows a collection of static pages to be indexed.


index

public void index(BlogEntry blogEntry)
Allows a single blog entry to be (re)indexed. If the entry is already indexed, this method deletes the previous index before adding the new one.

Parameters:
blogEntry - the BlogEntry instance to index

index

public void index(StaticPage staticPage)
Allows a single static page to be (re)indexed. If the page is already indexed, this method deletes the previous index before adding the new one.

Parameters:
staticPage - the StaticPage instance to index

unindex

public void unindex(BlogEntry blogEntry)
Removes the index for a single blog entry to be removed.

Parameters:
blogEntry - the BlogEntry instance to be removed

unindex

public void unindex(StaticPage staticPage)
Removes the index for a single blog entry to be removed.

Parameters:
staticPage - the StaticPage instance to be removed

search

public SearchResults search(java.lang.String queryString)
                     throws SearchException
Throws:
SearchException


Copyright © 2003-2006, Simon Brown. All Rights Reserved.