You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by krg9263 <kg...@protech.newsouth.net> on 2005/11/22 19:49:55 UTC
Lucene and Web Context
I am very new to Lucene.
Does anyone have an example of a Lucene IndexWriter whose path is relative
to a context path? All of the examples I have seen place it outside the web
container and relative to the system path. I need something within a web
container because I do not have access outside of it. I tried:
IndexWriter indexWriter = new IndexWriter( m_request.getContextPath()+
"/data/LUCENE", new StandardAnalyzer(), true);
but this resulted in the app looking in: c:/CONTEXT_PATH/data/LUCENE
Any advice is greatly appreciated.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Lucene and Web Context
Posted by John Powers <jp...@configureone.com>.
session.getServletContext().getRealPath("/") + "data/lucene"
On 11/22/05 12:49 PM, "krg9263" <kg...@protech.newsouth.net> wrote:
> I am very new to Lucene.
> Does anyone have an example of a Lucene IndexWriter whose path is relative
> to a context path? All of the examples I have seen place it outside the web
> container and relative to the system path. I need something within a web
> container because I do not have access outside of it. I tried:
>
> IndexWriter indexWriter = new IndexWriter( m_request.getContextPath()+
> "/data/LUCENE", new StandardAnalyzer(), true);
>
>
> but this resulted in the app looking in: c:/CONTEXT_PATH/data/LUCENE
>
> Any advice is greatly 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