I have a really simple servlet example already created that appears to work.
I adopted most of the code from the .jsp example posted earlier from
Douglass Cutting. However, I have two questions:
First, (this is related more to the servlet aspect) in the .jsp file there
are a couple of lines of code that deal with the 'application' variable:
i.e. indexPath = application.getRealPath( "/" + index );
apparently I need this code in order to create the index sercher by giving
it the physical path to the index that I'm going to use. I need to
reproduce the application variable inside the servlet. I'm using a (really
bad!) work around currently that uses a hidden field in the query form page
to store the index path (using the application variable). I have found that
the application variable is related to the servletContext property of the
HTTPServlet class. Does anyone have an idea of how to instantiate this
inside a servlet? Any information related to struts would be of assistance
as well as the perform method only gives you access to the request and
response objects.
Second, is there anyway to exclude directories from being indexed?
For example, I need an index of everything in the /doc directory but not
items in /doc/restricted directory.
I'm thinking that you should be able to do this at creation time, or
removing them after, but perhaps I could settle with creating the query and
removing items that are located in that directory. Does anyone have any
suggestions on how to accomplish this?
Once I get my app running correctly, I'll post the code that I used in my
servlet example.
Thanks.
--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
I adopted most of the code from the .jsp example posted earlier from
Douglass Cutting. However, I have two questions:
First, (this is related more to the servlet aspect) in the .jsp file there
are a couple of lines of code that deal with the 'application' variable:
i.e. indexPath = application.getRealPath( "/" + index );
apparently I need this code in order to create the index sercher by giving
it the physical path to the index that I'm going to use. I need to
reproduce the application variable inside the servlet. I'm using a (really
bad!) work around currently that uses a hidden field in the query form page
to store the index path (using the application variable). I have found that
the application variable is related to the servletContext property of the
HTTPServlet class. Does anyone have an idea of how to instantiate this
inside a servlet? Any information related to struts would be of assistance
as well as the perform method only gives you access to the request and
response objects.
Second, is there anyway to exclude directories from being indexed?
For example, I need an index of everything in the /doc directory but not
items in /doc/restricted directory.
I'm thinking that you should be able to do this at creation time, or
removing them after, but perhaps I could settle with creating the query and
removing items that are located in that directory. Does anyone have any
suggestions on how to accomplish this?
Once I get my app running correctly, I'll post the code that I used in my
servlet example.
Thanks.
--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>