Thanks Erik. Now I'm having issues creating the index directory. Good ol'
Windows. I even tried replacing "\" with "/" and/or "\\", but no luck:
DEBUG [Thread-9] [org.roller.presentation.RollerRequest]
RollerRequest.getIndexDirectory(995) | inde
x dir: C:/Documents and Settings/mattra/roller-index/adminUser
ERROR [Thread-9] [org.roller.presentation.weblog.search.SearchIndexer]
SearchIndexer.index(117) | Ca
nnot create directory: C:\Documents and
Settings\mattra\roller-index\adminUser
java.io.IOException: Cannot create directory: C:\Documents and
Settings\mattra\roller-index\adminUse
r
at org.apache.lucene.store.FSDirectory.create(FSDirectory.java:148)
at org.apache.lucene.store.FSDirectory.<init>(FSDirectory.java:139)
at
org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:120)
at
org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:101)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:122)
at
org.roller.presentation.weblog.search.SearchIndexer.createIndex(SearchIndexe
r.java:54)
at
org.roller.presentation.weblog.search.SearchIndexer.index(SearchIndexer.java
:104)
at
org.roller.presentation.weblog.actions.WeblogEntryFormAction.update(WeblogEn
tryFormAction
Any ideas?
DEBUG [Thread-9] [org.roller.presentation.RollerRequest]
RollerRequest.getIndexDirectory(996) | inde
x dir: C:\\Documents and Settings\\mattra\\roller-index\\adminUser
ERROR [Thread-9] [org.roller.presentation.weblog.search.SearchIndexer]
SearchIndexer.index(117) | Ca
nnot create directory: C:\Documents and
Settings\mattra\roller-index\adminUser
java.io.IOException: Cannot create directory: C:\Documents and
Settings\mattra\roller-index\adminUse
r
Thanks,
Matt
-----Original Message-----
From: Erik Hatcher [mailto:[EMAIL PROTECTED]
Sent: Friday, July 18, 2003 12:06 PM
To: Lucene Users List
Subject: Re: access denied to indexDir/segments
On Friday, July 18, 2003, at 01:35 PM, Raible, Matt wrote:
> I'm planning on having different index directories for each user, in
> the
> format indexDir/username. This will allow a single site to be
> indexed, or I
> can loop through all the users and index them all. We're going to
> leave up
> the "indexing" to the site admin, and there will be buttons (on a JSP)
> that
> allow indexing of individual sites, or all sites. Does this sound
> reasonable?
Yup, seems fine.
> // throw an error if no index exists
> if (!IndexReader.indexExists(mIndexDir)) {
> throw new IndexNotCreatedException("No index directory
> exists at: "
> +
> mIndexDir);
> }
Well, the implementation is this:
public static boolean indexExists(File directory) {
return (new File(directory, "segments")).exists();
}
> Is this the proper way to test for an index, or should I just use:
>
> File dirPath = new File(indexDir);
> if (!dirPath.exists()) {
> throw new IndexNotCreatedException("No index directory
> exists at: "
> +
> mIndexDir);
> }
Which is about the same as above. I'd stick with the
IndexReader.indexExists method just to let Lucene hide the details.
> Also, when create an index, do I need to create the directory
> index/username, or will "new IndexWriter(indexPath, null, true)" do
> this for
> me?
It will create it for you.
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]