: Does this case arise when i do a search when there is no index?? - If yes, : then i guess the Exception can be made more meaningful.
in normal operation, i believe this shouldn't happen -- Solr will create the index for you on startup if there isn't one. You're attampting a fairly advanced / non trivial approach where you aren't letting Solr manage the index for you. you haven't given us any idea what the code you are using to build the index looks like -- but if i had to guess, i would bet that somewhere in there you are directly manupulating the file system directory -- not just the Lucene FSDirectory. that's the only situation i can think of where that index directory would ever exist but be completely empty -- the low level Lucene APIs should create a segments file as soon as you start adding docs, even if you haven't lcosed the writer yet. -Hoss