|
Project Information
Members
Links
|
OverviewGAELucene is a lucene component that can help you to run search applications on Google AppEngine. Developer's GuideThe main clazz of GAELucene include:
The following code snippet demonstrates the use of GAELucene do searching: Query queryObject = parserQuery(request); GAEIndexReaderPool readerPool = GAEIndexReaderPool.getInstance(); GAEIndexReader indexReader = readerPool.borrowReader(INDEX_CATEGORY_DEMO); IndexSearcher searcher = new IndexSearcher(indexReader); Hits hits = searcher.search(queryObject); readerPool.returnReader(indexReader); NoticeThe GAEDirectory is read only, that is, you can not use the Directory to build index! You should do indexing on another machine, then push the indices onto google appengine datastore with LuceneIndexPushUtil. Because of the quota limitation of google appengine, GAELucene is not fit to run with huge indices, it does better for small indices, around 100Mb. For large changing indices, you need to find other solutions. Quick StartRun GAELucene in eclipseSuppose that you have integrated the google appengine sdk and svn client within your eclipse IDE. 1. Checkout GAELucene from the svn repository http://gaelucene.googlecode.com/svn/trunk/ 2. Define reserved user in '${GAELUCENE_HOME}/war/WEB-INF/classes/gaelucene-users.txt' Notice: A google account's email each line, line starts with '#' will be omitted. The reserved user will act as 'System Administrator'. 3. Download and untar the prepackaged indices tar file(10 pices from lucen mail list) into '${GAELUCENE_HOME}/war/WEB-INF/classes/' Notice: Ensure the untared index files were under '${GAELUCENE_HOME}/war/WEB-INF/classes/indices/demo/index/' 4. Compile and run your google web application Visit the dashboard http://localhost:8080/gaelucenedashboard/index. You may be request to log in with your reserved user account. 5. Import the packaged indices onto google datastore From the dashboard index page, visit 'Import Indices' http://localhost:8080/gaelucenedashboard/importpackagedindex?dir=indices/demo/index&cat=demo 6. Test the Demo page Visit http://localhost:8080/demo.jsp Deploy GAELucene onto google appenginePush fresh index onto google datastoreUse LuceneIndexPushUtil to interact with your deploied GAELucene webapp. CaseHere, 3gmatrix-search.appspot.com, is a site based on GAELucene. Learned frommvnForum - The Permission/Authentication framework |