You can store the index in WEB_INF directory, just use something:
ServletContext.getRealPath("/WEB-INF/data/myIndexName");----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: [email protected] > -----Original Message----- > From: Ian Lea [mailto:[email protected]] > Sent: Monday, November 28, 2011 6:11 PM > To: [email protected] > Subject: Re: Lucene index inside of a web app? > > Using a static string is fine - it just wasn't clear from your original post what it > was. > > I usually use a full path read from a properties file so that I can change it > without a recompile, have different settings on test/live/whatever systems, etc. > Works for me, but isn't the only way to do it. > > If you know where your app lives, you could use a full path pointing to > somewhere within that tree, or you could use a partial path that the app server > will interpret relative to something. Which is fine too - take your pick of > whatever works for you. > > > -- > Ian. > > > On Mon, Nov 28, 2011 at 4:40 PM, okayndc <[email protected]> wrote: > > Hi, > > > > Thanks for your response. Yes, LUCENE_INDEX_DIRECTORY is a static > > string which contains the file system path of the index (for example, > c:\\index). > > Is this good practice? If not, what should the full path to an > > index look like? > > > > Thanks > > > > On Mon, Nov 28, 2011 at 4:54 AM, Ian Lea <[email protected]> wrote: > > > >> What is LUCENE_INDEX_DIRECTORY? Some static string in your app? > >> > >> Lucene knows nothing about your app, JSP, or what app server you are > >> using. It requires a file system path and it is up to you to provide > >> that. I always use a full path since I prefer to store indexes > >> outside the app and it avoids complications with what the app server > >> considers the default directory. But if you want to store it inside, > >> without specifying full path, look at the docs for your app server. > >> > >> > >> -- > >> Ian. > >> > >> > >> On Sun, Nov 27, 2011 at 2:10 AM, okayndc <[email protected]> wrote: > >> > Hello, > >> > > >> > I want to store the generated Lucene index inside of my Java > >> > application, preferably within a folder where my JSP files are > >> > located. I also want > >> to > >> > be able to search from the index within the web app. I've been > >> > using the LUCENE_INDEX_DIRECTORY but, this is on a file system > >> > (currently my hard drive). Should I continue to use > >> > LUCENE_INDEX_DIRECTORY if I want the Lucene index inside the app or > >> > use something else. I was a bit confused about this. Btw, the Lucene index > content comes from a database. > >> > > >> > Any help is appreciated > >> > > >> > >> --------------------------------------------------------------------- > >> 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
