Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8240892E7 for ; Mon, 28 Nov 2011 18:55:47 +0000 (UTC) Received: (qmail 24732 invoked by uid 500); 28 Nov 2011 18:55:45 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 24688 invoked by uid 500); 28 Nov 2011 18:55:45 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 24680 invoked by uid 99); 28 Nov 2011 18:55:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Nov 2011 18:55:45 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bodymoves@gmail.com designates 74.125.83.48 as permitted sender) Received: from [74.125.83.48] (HELO mail-ee0-f48.google.com) (74.125.83.48) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Nov 2011 18:55:40 +0000 Received: by eeav2 with SMTP id v2so915056eea.35 for ; Mon, 28 Nov 2011 10:55:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=24CGClWM7EA94H3C847jmZt0/eYKj2vUFoByhC+CSC0=; b=xTkZbemSVfxF8/C1IGsJ3Pa309bpZVnaCcD8r+1QPEGSW2lrvJOvwQUkvqtFsDWvVC rQ1zgH5cC8CLnPMF53d/YR3gt+wxzt5Yb++sXr5vxDbBIpAWTteYiEQAsrY4HKWSh/uW 21iSsrPwj0Ltc0/Z1DCdl6widyX1IphXkcaok= MIME-Version: 1.0 Received: by 10.180.90.195 with SMTP id by3mr37632659wib.30.1322506518442; Mon, 28 Nov 2011 10:55:18 -0800 (PST) Received: by 10.216.121.212 with HTTP; Mon, 28 Nov 2011 10:55:18 -0800 (PST) In-Reply-To: <006801ccadf1$ede2a940$c9a7fbc0$@thetaphi.de> References: <006801ccadf1$ede2a940$c9a7fbc0$@thetaphi.de> Date: Mon, 28 Nov 2011 13:55:18 -0500 Message-ID: Subject: Re: Lucene index inside of a web app? From: okayndc To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=f46d0438eb593eb85d04b2d00b25 --f46d0438eb593eb85d04b2d00b25 Content-Type: text/plain; charset=ISO-8859-1 Awesome. Thanks guys! On Mon, Nov 28, 2011 at 12:19 PM, Uwe Schindler wrote: > 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: uwe@thetaphi.de > > > > -----Original Message----- > > From: Ian Lea [mailto:ian.lea@gmail.com] > > Sent: Monday, November 28, 2011 6:11 PM > > To: java-user@lucene.apache.org > > 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 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 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 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: java-user-unsubscribe@lucene.apache.org > > >> For additional commands, e-mail: java-user-help@lucene.apache.org > > >> > > >> > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > > For additional commands, e-mail: java-user-help@lucene.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > --f46d0438eb593eb85d04b2d00b25--