lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raible, Matt" <Matt_Rai...@cable.comcast.com>
Subject RE: access denied to indexDir/segments
Date Fri, 18 Jul 2003 21:23:53 GMT
Nevermind, it was because I didn't have the parent index dir (roller-index)
created.

Thanks,

Matt

-----Original Message-----
From: Raible, Matt 
Sent: Friday, July 18, 2003 3:18 PM
To: 'Lucene Users List'
Subject: RE: access denied to indexDir/segments


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:lists@ehatchersolutions.com]
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: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message