Mailing List Archive

SearchBean Persistence
I'm using Peter's SearchBean code to sort search results. It works fine, but it creates the sorting field array from scratch with every invocation (which takes on the order of a second or so to complete - each search itself takes about one tenth of that or less). While I can conduct several searches in the same module, I can't figure out how to persist the sorting field array between invocations of the search module.

Any advice on how to do this would be much appreciated.

Regards,

Terry
Re: SearchBean Persistence [ In reply to ]
if the array is of a serializable sort, just store it in a sql table !?!

mvh karl øie

On Wednesday 03 July 2002 16:22, Terry Steichen wrote:
> I'm using Peter's SearchBean code to sort search results. It works fine,
> but it creates the sorting field array from scratch with every invocation
> (which takes on the order of a second or so to complete - each search
> itself takes about one tenth of that or less). While I can conduct several
> searches in the same module, I can't figure out how to persist the sorting
> field array between invocations of the search module.
>
> Any advice on how to do this would be much appreciated.
>
> Regards,
>
> Terry


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: SearchBean Persistence [ In reply to ]
Karl,

Just to clarify. I have an application that runs searches as requested by
users. The application is persistent across multiple requests, so there's
no problem creating it at startup. And, given the application's
persistence, there should be no problem storing it in memory to serve
subsequent requests. I just can't figure out how to modify the SearchBean
code to do this. I seemed like it would be simple, but try as I might,
nothing has so far worked.

Regards,

Terry


----- Original Message -----
From: "Karl Øie" <karl@gan.no>
To: "Lucene Users List" <lucene-user@jakarta.apache.org>
Sent: Wednesday, July 03, 2002 10:34 AM
Subject: Re: SearchBean Persistence


> if the array is of a serializable sort, just store it in a sql table !?!
>
> mvh karl øie
>
> On Wednesday 03 July 2002 16:22, Terry Steichen wrote:
> > I'm using Peter's SearchBean code to sort search results. It works
fine,
> > but it creates the sorting field array from scratch with every
invocation
> > (which takes on the order of a second or so to complete - each search
> > itself takes about one tenth of that or less). While I can conduct
several
> > searches in the same module, I can't figure out how to persist the
sorting
> > field array between invocations of the search module.
> >
> > Any advice on how to do this would be much appreciated.
> >
> > Regards,
> >
> > Terry
>
>
> --
> To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: SearchBean Persistence [ In reply to ]
if it is a Stateful SessionBan you will have to create an EntityBean
implementation with the same functionality. And then in the EJB's load() and
store() you will have to serialize the array. Or if it is a CMP EJB, just
declare the array as a persistent field.


mvh karl

On Wednesday 03 July 2002 16:39, Terry Steichen wrote:
> Karl,
>
> Just to clarify. I have an application that runs searches as requested by
> users. The application is persistent across multiple requests, so there's
> no problem creating it at startup. And, given the application's
> persistence, there should be no problem storing it in memory to serve
> subsequent requests. I just can't figure out how to modify the SearchBean
> code to do this. I seemed like it would be simple, but try as I might,
> nothing has so far worked.
>
> Regards,
>
> Terry
>
>
> ----- Original Message -----
> From: "Karl Øie" <karl@gan.no>
> To: "Lucene Users List" <lucene-user@jakarta.apache.org>
> Sent: Wednesday, July 03, 2002 10:34 AM
> Subject: Re: SearchBean Persistence
>
> > if the array is of a serializable sort, just store it in a sql table !?!
> >
> > mvh karl øie
> >
> > On Wednesday 03 July 2002 16:22, Terry Steichen wrote:
> > > I'm using Peter's SearchBean code to sort search results. It works
>
> fine,
>
> > > but it creates the sorting field array from scratch with every
>
> invocation
>
> > > (which takes on the order of a second or so to complete - each search
> > > itself takes about one tenth of that or less). While I can conduct
>
> several
>
> > > searches in the same module, I can't figure out how to persist the
>
> sorting
>
> > > field array between invocations of the search module.
> > >
> > > Any advice on how to do this would be much appreciated.
> > >
> > > Regards,
> > >
> > > Terry
> >
> > --
> > To unsubscribe, e-mail:
>
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
>
> > For additional commands, e-mail:
>
> <mailto:lucene-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: SearchBean Persistence [ In reply to ]
I think you guys are not understanding each other.
Terry is talking about the code in Lucene Sandbox, not about EJBs.

I don't use that code (yet?), so I don't know the answer.

Otis

--- Karl Øie <karl@gan.no> wrote:
> if it is a Stateful SessionBan you will have to create an EntityBean
> implementation with the same functionality. And then in the EJB's
> load() and
> store() you will have to serialize the array. Or if it is a CMP EJB,
> just
> declare the array as a persistent field.
>
>
> mvh karl
>
> On Wednesday 03 July 2002 16:39, Terry Steichen wrote:
> > Karl,
> >
> > Just to clarify. I have an application that runs searches as
> requested by
> > users. The application is persistent across multiple requests, so
> there's
> > no problem creating it at startup. And, given the application's
> > persistence, there should be no problem storing it in memory to
> serve
> > subsequent requests. I just can't figure out how to modify the
> SearchBean
> > code to do this. I seemed like it would be simple, but try as I
> might,
> > nothing has so far worked.
> >
> > Regards,
> >
> > Terry
> >
> >
> > ----- Original Message -----
> > From: "Karl Øie" <karl@gan.no>
> > To: "Lucene Users List" <lucene-user@jakarta.apache.org>
> > Sent: Wednesday, July 03, 2002 10:34 AM
> > Subject: Re: SearchBean Persistence
> >
> > > if the array is of a serializable sort, just store it in a sql
> table !?!
> > >
> > > mvh karl øie
> > >
> > > On Wednesday 03 July 2002 16:22, Terry Steichen wrote:
> > > > I'm using Peter's SearchBean code to sort search results. It
> works
> >
> > fine,
> >
> > > > but it creates the sorting field array from scratch with every
> >
> > invocation
> >
> > > > (which takes on the order of a second or so to complete - each
> search
> > > > itself takes about one tenth of that or less). While I can
> conduct
> >
> > several
> >
> > > > searches in the same module, I can't figure out how to persist
> the
> >
> > sorting
> >
> > > > field array between invocations of the search module.
> > > >
> > > > Any advice on how to do this would be much appreciated.
> > > >
> > > > Regards,
> > > >
> > > > Terry
> > >
> > > --
> > > To unsubscribe, e-mail:
> >
> > <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> >
> > > For additional commands, e-mail:
> >
> > <mailto:lucene-user-help@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:lucene-user-help@jakarta.apache.org>
>


__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: SearchBean Persistence [ In reply to ]
Hi Terry,

The way I was hoping it would work is to call static method

SortedField.addField([field name],[indexPath]);

In a init servlet at startup (there is a sample servlet in the servelet
directory of the SearchBean contribution).

Then we you want to sort by that field call the static method

SortedField.getSortedField([fieldName])

Which will return the precreated sorted field if it exists.

Again, I'm sorry I didn't yet have time to fully test this, but this is the
way it SHOULD work. If it doesn't work that way please let me know and I'll
look at it.

--Peter




On 7/3/02 7:22 AM, "Terry Steichen" <terry@net-frame.com> wrote:

> I'm using Peter's SearchBean code to sort search results. It works fine, but
> it creates the sorting field array from scratch with every invocation (which
> takes on the order of a second or so to complete - each search itself takes
> about one tenth of that or less). While I can conduct several searches in the
> same module, I can't figure out how to persist the sorting field array between
> invocations of the search module.
>
> Any advice on how to do this would be much appreciated.
>
> Regards,
>
> Terry
>
>


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: SearchBean Persistence [ In reply to ]
oh, i see. i was misleaded by the Bean part of the SearchBean... im sorry! :-)

Anyhow, if it is not a Statefull SessionBean you are not restricted by EJB
rules and can thus serialize everything you want to disk or db...

mvh karl øie


On Wednesday 03 July 2002 17:20, Otis Gospodnetic wrote:
> I think you guys are not understanding each other.
> Terry is talking about the code in Lucene Sandbox, not about EJBs.
>
> I don't use that code (yet?), so I don't know the answer.
>
> Otis
>
> --- Karl Øie <karl@gan.no> wrote:
> > if it is a Stateful SessionBan you will have to create an EntityBean
> > implementation with the same functionality. And then in the EJB's
> > load() and
> > store() you will have to serialize the array. Or if it is a CMP EJB,
> > just
> > declare the array as a persistent field.
> >
> >
> > mvh karl
> >
> > On Wednesday 03 July 2002 16:39, Terry Steichen wrote:
> > > Karl,
> > >
> > > Just to clarify. I have an application that runs searches as
> >
> > requested by
> >
> > > users. The application is persistent across multiple requests, so
> >
> > there's
> >
> > > no problem creating it at startup. And, given the application's
> > > persistence, there should be no problem storing it in memory to
> >
> > serve
> >
> > > subsequent requests. I just can't figure out how to modify the
> >
> > SearchBean
> >
> > > code to do this. I seemed like it would be simple, but try as I
> >
> > might,
> >
> > > nothing has so far worked.
> > >
> > > Regards,
> > >
> > > Terry
> > >
> > >
> > > ----- Original Message -----
> > > From: "Karl Øie" <karl@gan.no>
> > > To: "Lucene Users List" <lucene-user@jakarta.apache.org>
> > > Sent: Wednesday, July 03, 2002 10:34 AM
> > > Subject: Re: SearchBean Persistence
> > >
> > > > if the array is of a serializable sort, just store it in a sql
> >
> > table !?!
> >
> > > > mvh karl øie
> > > >
> > > > On Wednesday 03 July 2002 16:22, Terry Steichen wrote:
> > > > > I'm using Peter's SearchBean code to sort search results. It
> >
> > works
> >
> > > fine,
> > >
> > > > > but it creates the sorting field array from scratch with every
> > >
> > > invocation
> > >
> > > > > (which takes on the order of a second or so to complete - each
> >
> > search
> >
> > > > > itself takes about one tenth of that or less). While I can
> >
> > conduct
> >
> > > several
> > >
> > > > > searches in the same module, I can't figure out how to persist
> >
> > the
> >
> > > sorting
> > >
> > > > > field array between invocations of the search module.
> > > > >
> > > > > Any advice on how to do this would be much appreciated.
> > > > >
> > > > > Regards,
> > > > >
> > > > > Terry
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > >
> > > <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> > >
> > > > For additional commands, e-mail:
> > >
> > > <mailto:lucene-user-help@jakarta.apache.org>
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:lucene-user-help@jakarta.apache.org>
>
> __________________________________________________
> Do You Yahoo!?
> Sign up for SBC Yahoo! Dial - First Month Free
> http://sbc.yahoo.com


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
RE: SearchBean Persistence [ In reply to ]
Hi Peter,

>there is a sample servlet in the servelet directory of the SearchBean
contribution

Are you sure? This directory (servlet) is empty:
http://cvs.apache.org/viewcvs/jakarta-lucene-sandbox/contributions/searc
hbean/src/java/org/apache/lucene/servlet/

Could you please provide me with the sample servlet?

Thank you.

Regards,
Ilya


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: SearchBean Persistence [ In reply to ]
Peter,

The main problem was that I was unfamiliar with the way you used static
methods and members. Once I got my head around that, it wasn't hard to get
things working. I fixed a couple of minor bugs, got rid of some surplus
methods, and added the ability to change the sorting order. Seems to work
fine now. Thanks for the help (and the code, of course).

Regards,

Terry


----- Original Message -----
From: "Peter Carlson" <carlson@bookandhammer.com>
To: "Lucene Users List" <lucene-user@jakarta.apache.org>
Sent: Wednesday, July 03, 2002 11:29 AM
Subject: Re: SearchBean Persistence


> Hi Terry,
>
> The way I was hoping it would work is to call static method
>
> SortedField.addField([field name],[indexPath]);
>
> In a init servlet at startup (there is a sample servlet in the servelet
> directory of the SearchBean contribution).
>
> Then we you want to sort by that field call the static method
>
> SortedField.getSortedField([fieldName])
>
> Which will return the precreated sorted field if it exists.
>
> Again, I'm sorry I didn't yet have time to fully test this, but this is
the
> way it SHOULD work. If it doesn't work that way please let me know and
I'll
> look at it.
>
> --Peter
>
>
>
>
> On 7/3/02 7:22 AM, "Terry Steichen" <terry@net-frame.com> wrote:
>
> > I'm using Peter's SearchBean code to sort search results. It works
fine, but
> > it creates the sorting field array from scratch with every invocation
(which
> > takes on the order of a second or so to complete - each search itself
takes
> > about one tenth of that or less). While I can conduct several searches
in the
> > same module, I can't figure out how to persist the sorting field array
between
> > invocations of the search module.
> >
> > Any advice on how to do this would be much appreciated.
> >
> > Regards,
> >
> > Terry
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: SearchBean Persistence [ In reply to ]
Hi Terry,

Could you send along you changes so I can integrate them back in.

Thanks

--Peter

On 7/5/02 6:14 AM, "Terry Steichen" <terry@net-frame.com> wrote:

> Peter,
>
> The main problem was that I was unfamiliar with the way you used static
> methods and members. Once I got my head around that, it wasn't hard to get
> things working. I fixed a couple of minor bugs, got rid of some surplus
> methods, and added the ability to change the sorting order. Seems to work
> fine now. Thanks for the help (and the code, of course).
>
> Regards,
>
> Terry
>
>
> ----- Original Message -----
> From: "Peter Carlson" <carlson@bookandhammer.com>
> To: "Lucene Users List" <lucene-user@jakarta.apache.org>
> Sent: Wednesday, July 03, 2002 11:29 AM
> Subject: Re: SearchBean Persistence
>
>
>> Hi Terry,
>>
>> The way I was hoping it would work is to call static method
>>
>> SortedField.addField([field name],[indexPath]);
>>
>> In a init servlet at startup (there is a sample servlet in the servelet
>> directory of the SearchBean contribution).
>>
>> Then we you want to sort by that field call the static method
>>
>> SortedField.getSortedField([fieldName])
>>
>> Which will return the precreated sorted field if it exists.
>>
>> Again, I'm sorry I didn't yet have time to fully test this, but this is
> the
>> way it SHOULD work. If it doesn't work that way please let me know and
> I'll
>> look at it.
>>
>> --Peter
>>
>>
>>
>>
>> On 7/3/02 7:22 AM, "Terry Steichen" <terry@net-frame.com> wrote:
>>
>>> I'm using Peter's SearchBean code to sort search results. It works
> fine, but
>>> it creates the sorting field array from scratch with every invocation
> (which
>>> takes on the order of a second or so to complete - each search itself
> takes
>>> about one tenth of that or less). While I can conduct several searches
> in the
>>> same module, I can't figure out how to persist the sorting field array
> between
>>> invocations of the search module.
>>>
>>> Any advice on how to do this would be much appreciated.
>>>
>>> Regards,
>>>
>>> Terry
>>>
>>>
>>
>>
>> --
>> To unsubscribe, e-mail:
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail:
> <mailto:lucene-user-help@jakarta.apache.org>
>>
>>
>
>
> --
> To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: SearchBean Persistence [ In reply to ]
Hi Ilya,

I was looking at my local directory sorry about that.

I am just going to attach what I have since it has a dependency on a
property file which I haven't create yet.

This is a servlet which you will have to have your JSP/Servlet engine load
at startup.

Put the code in your web.xml class for your local app.

<servlet>
<servlet-name>Lucene Index Loader</servlet-name>
<servlet-class>org.apache.lucene.servlet.IndexLoader.java</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

I hope this helps.

--Peter

On 7/5/02 5:58 AM, "Ilya Khandamirov" <ikh@startext.de> wrote:

> Hi Peter,
>
>> there is a sample servlet in the servelet directory of the SearchBean
> contribution
>
> Are you sure? This directory (servlet) is empty:
> http://cvs.apache.org/viewcvs/jakarta-lucene-sandbox/contributions/searc
> hbean/src/java/org/apache/lucene/servlet/
>
> Could you please provide me with the sample servlet?
>
> Thank you.
>
> Regards,
> Ilya
>
>
> --
> To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
>
>
Re: SearchBean Persistence [ In reply to ]
Sorry about that,
I made a mistake on the class name, take out the .java

<servlet>
<servlet-name>Lucene Index Loader</servlet-name>
<servlet-class>org.apache.lucene.servlet.IndexLoader</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>



On 7/5/02 7:23 AM, "Peter Carlson" <carlson@bookandhammer.com> wrote:

> Hi Ilya,
>
> I was looking at my local directory sorry about that.
>
> I am just going to attach what I have since it has a dependency on a
> property file which I haven't create yet.
>
> This is a servlet which you will have to have your JSP/Servlet engine load
> at startup.
>
> Put the code in your web.xml class for your local app.
>
> <servlet>
> <servlet-name>Lucene Index Loader</servlet-name>
> <servlet-class>org.apache.lucene.servlet.IndexLoader.java</servlet-class>
> <load-on-startup>1</load-on-startup>
> </servlet>
>
> I hope this helps.
>
> --Peter
>
> On 7/5/02 5:58 AM, "Ilya Khandamirov" <ikh@startext.de> wrote:
>
>> Hi Peter,
>>
>>> there is a sample servlet in the servelet directory of the SearchBean
>> contribution
>>
>> Are you sure? This directory (servlet) is empty:
>> http://cvs.apache.org/viewcvs/jakarta-lucene-sandbox/contributions/searc
>> hbean/src/java/org/apache/lucene/servlet/
>>
>> Could you please provide me with the sample servlet?
>>
>> Thank you.
>>
>> Regards,
>> Ilya
>>
>>
>> --
>> To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
>>
>>
>
>
> --
> To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: SearchBean Persistence [ In reply to ]
Peter,

OK - but sorry it's not more organized. Hope you can make sense out of it.

Terry

Changes to CompareDocumentsByField:
Added a new constructor that includes a sort order flag (int)
Added a protected field to hold this sort order flag
modified the return from the compare() method to use sort order flag
(rather than -1)
-----------------------------------------
Changes to HitsIterator:
Added new constructor that includes a sort order flag (a=ascending,
d=decending, r=relevance)
Fixed bug - orig line: if((sortFlag != "" ) && (sortFlag != "relevance"))
new line: if((sortFlag != null) && (!sortFlag.equals("relevance"))
Add sort order parameter to sortByField() method
Added a few lines of code inside sortByField() to translate the string sort
order flag to a corresponding int
Inside sortByField(), call CompareDocumentsByField() with a sort direction
int
---------------------------------------
Changes to SearchBean:
removed queryString field (unnecessary)
removed the constructors that had a query string parameter (left only one
constructor - SearchBean(string, string))
added query string as a parameter to the search() method and modified each
overloaded version for this.
modified the call to the HitsIterator to include the sort order flag
(string)
eliminated the toString() method ('cause it had query string in it and I
was too lazy to remove it)
eliminated the set/getQueryString() method ('cause I now pass it to search)
-------------------------------------
Changes to Hits:
added int(n) method returning hitDoc(n).id
----------------------------------------
My calling module has this code fragment to set things up:
SearchBean sb = null;

if(SortedField.getSortedField(sortfield) == null) {
SortedField.addField(sortfield, indexdir);
}
FSDirectory dir = FSDirectory.getDirectory(indexdir, false);
sb = new SearchBean(dir, sortfield);

---------------------------
My calling module has this code fragment to do the actual search:

HitsIterator hi = sb.search(uquery, sortfield, direction);
hi.setPageSize(num_hits);
my_hits = hi.getTotalHits();
int next_page = start_hit / page_size;
if(start_hit % page_size != 0) {
next_page++;
}
hi.setCurrentPage(next_page);

while(hi.hasNext()) {
docs.add(hi.next());
}

-------------------------------

----- Original Message -----
From: "Peter Carlson" <carlson@bookandhammer.com>
To: "Lucene Users List" <lucene-user@jakarta.apache.org>
Sent: Friday, July 05, 2002 10:19 AM
Subject: Re: SearchBean Persistence


> Hi Terry,
>
> Could you send along you changes so I can integrate them back in.
>
> Thanks
>
> --Peter
>
> On 7/5/02 6:14 AM, "Terry Steichen" <terry@net-frame.com> wrote:
>
> > Peter,
> >
> > The main problem was that I was unfamiliar with the way you used static
> > methods and members. Once I got my head around that, it wasn't hard to
get
> > things working. I fixed a couple of minor bugs, got rid of some surplus
> > methods, and added the ability to change the sorting order. Seems to
work
> > fine now. Thanks for the help (and the code, of course).
> >
> > Regards,
> >
> > Terry
> >
> >
> > ----- Original Message -----
> > From: "Peter Carlson" <carlson@bookandhammer.com>
> > To: "Lucene Users List" <lucene-user@jakarta.apache.org>
> > Sent: Wednesday, July 03, 2002 11:29 AM
> > Subject: Re: SearchBean Persistence
> >
> >
> >> Hi Terry,
> >>
> >> The way I was hoping it would work is to call static method
> >>
> >> SortedField.addField([field name],[indexPath]);
> >>
> >> In a init servlet at startup (there is a sample servlet in the servelet
> >> directory of the SearchBean contribution).
> >>
> >> Then we you want to sort by that field call the static method
> >>
> >> SortedField.getSortedField([fieldName])
> >>
> >> Which will return the precreated sorted field if it exists.
> >>
> >> Again, I'm sorry I didn't yet have time to fully test this, but this is
> > the
> >> way it SHOULD work. If it doesn't work that way please let me know and
> > I'll
> >> look at it.
> >>
> >> --Peter
> >>
> >>
> >>
> >>
> >> On 7/3/02 7:22 AM, "Terry Steichen" <terry@net-frame.com> wrote:
> >>
> >>> I'm using Peter's SearchBean code to sort search results. It works
> > fine, but
> >>> it creates the sorting field array from scratch with every invocation
> > (which
> >>> takes on the order of a second or so to complete - each search itself
> > takes
> >>> about one tenth of that or less). While I can conduct several
searches
> > in the
> >>> same module, I can't figure out how to persist the sorting field array
> > between
> >>> invocations of the search module.
> >>>
> >>> Any advice on how to do this would be much appreciated.
> >>>
> >>> Regards,
> >>>
> >>> Terry
> >>>
> >>>
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:
> > <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> >> For additional commands, e-mail:
> > <mailto:lucene-user-help@jakarta.apache.org>
> >>
> >>
> >
> >
> > --
> > To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
RE: SearchBean Persistence [ In reply to ]
Hi Peter,

Thank you very much.
But i have one minor problem. Is everything OK with the following line
(HitIterator.java, line 87):

int id = hitsCollection.id(i);

My compiler says: "Error #: 300 : method id(int) not found in class
org.apache.lucene.search.Hits" and it looks like he is correct. Am I
missing something?


Regards,
Ilya


-----Original Message-----
From: Peter Carlson [mailto:carlson@bookandhammer.com]
Sent: Freitag, 5. Juli 2002 16:26
To: Lucene Users List
Subject: Re: SearchBean Persistence


Sorry about that,
I made a mistake on the class name, take out the .java

<servlet>
<servlet-name>Lucene Index Loader</servlet-name>
<servlet-class>org.apache.lucene.servlet.IndexLoader</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>



On 7/5/02 7:23 AM, "Peter Carlson" <carlson@bookandhammer.com> wrote:

> Hi Ilya,
>
> I was looking at my local directory sorry about that.
>
> I am just going to attach what I have since it has a dependency on a
> property file which I haven't create yet.
>
> This is a servlet which you will have to have your JSP/Servlet engine
> load at startup.
>
> Put the code in your web.xml class for your local app.
>
> <servlet>
> <servlet-name>Lucene Index Loader</servlet-name>
>
<servlet-class>org.apache.lucene.servlet.IndexLoader.java</servlet-class
>
> <load-on-startup>1</load-on-startup>
> </servlet>
>
> I hope this helps.
>
> --Peter
>
> On 7/5/02 5:58 AM, "Ilya Khandamirov" <ikh@startext.de> wrote:
>
>> Hi Peter,
>>
>>> there is a sample servlet in the servelet directory of the
>>> SearchBean
>> contribution
>>
>> Are you sure? This directory (servlet) is empty:
>> http://cvs.apache.org/viewcvs/jakarta-lucene-sandbox/contributions/se
>> arc
>> hbean/src/java/org/apache/lucene/servlet/
>>
>> Could you please provide me with the sample servlet?
>>
>> Thank you.
>>
>> Regards,
>> Ilya
>>
>>
>> --
>> To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail:
>> <mailto:lucene-user-help@jakarta.apache.org>
>>
>>
>
>
> --
> To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:lucene-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
Re: SearchBean Persistence [ In reply to ]
Version 1.2 of Lucene does not have this method.

You will have to download the nightly build (or add it yourself) to get this
to work.

--Peter

On 7/5/02 10:23 AM, "Ilya Khandamirov" <ikh@startext.de> wrote:

> Hi Peter,
>
> Thank you very much.
> But i have one minor problem. Is everything OK with the following line
> (HitIterator.java, line 87):
>
> int id = hitsCollection.id(i);
>
> My compiler says: "Error #: 300 : method id(int) not found in class
> org.apache.lucene.search.Hits" and it looks like he is correct. Am I
> missing something?
>
>
> Regards,
> Ilya
>
>
> -----Original Message-----
> From: Peter Carlson [mailto:carlson@bookandhammer.com]
> Sent: Freitag, 5. Juli 2002 16:26
> To: Lucene Users List
> Subject: Re: SearchBean Persistence
>
>
> Sorry about that,
> I made a mistake on the class name, take out the .java
>
> <servlet>
> <servlet-name>Lucene Index Loader</servlet-name>
> <servlet-class>org.apache.lucene.servlet.IndexLoader</servlet-class>
> <load-on-startup>1</load-on-startup>
> </servlet>
>
>
>
> On 7/5/02 7:23 AM, "Peter Carlson" <carlson@bookandhammer.com> wrote:
>
>> Hi Ilya,
>>
>> I was looking at my local directory sorry about that.
>>
>> I am just going to attach what I have since it has a dependency on a
>> property file which I haven't create yet.
>>
>> This is a servlet which you will have to have your JSP/Servlet engine
>> load at startup.
>>
>> Put the code in your web.xml class for your local app.
>>
>> <servlet>
>> <servlet-name>Lucene Index Loader</servlet-name>
>>
> <servlet-class>org.apache.lucene.servlet.IndexLoader.java</servlet-class
>>
>> <load-on-startup>1</load-on-startup>
>> </servlet>
>>
>> I hope this helps.
>>
>> --Peter
>>
>> On 7/5/02 5:58 AM, "Ilya Khandamirov" <ikh@startext.de> wrote:
>>
>>> Hi Peter,
>>>
>>>> there is a sample servlet in the servelet directory of the
>>>> SearchBean
>>> contribution
>>>
>>> Are you sure? This directory (servlet) is empty:
>>> http://cvs.apache.org/viewcvs/jakarta-lucene-sandbox/contributions/se
>>> arc
>>> hbean/src/java/org/apache/lucene/servlet/
>>>
>>> Could you please provide me with the sample servlet?
>>>
>>> Thank you.
>>>
>>> Regards,
>>> Ilya
>>>
>>>
>>> --
>>> To unsubscribe, e-mail:
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
>>> For additional commands, e-mail:
>>> <mailto:lucene-user-help@jakarta.apache.org>
>>>
>>>
>>
>>
>> --
>> To unsubscribe, e-mail:
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail:
>> <mailto:lucene-user-help@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:lucene-user-help@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>