Aleksander - if you're wrapping Lucene with a web service, you'd do
well to investigate Solr - http://incubator.apache.org/solr - as it
handles all of the index management in a very elegant fashion. It
currently does not support a SOAP interface, but rather a RESTful
light-weight custom XML format, but I'm sure a SOAP interface would
be a welcome contribution if that is what you're using.
And yes, you're right it is tricky to manage and it often varies per-
project on the needs of IndexSearcher management.
Erik
On Jun 27, 2006, at 2:55 AM, Aleksander M. Stensby wrote:
Hello,
I tried sending this message yesterday, but I think i wasn't
registered until now, so i'll post again. (Sorry if this gets
doubled up).
I have recently started using Lucene and I must say i love it:)
But, i have a few questions (probably stupid ones), but still, here
goes:
I have created one project that reads information from a database,
then indexes this information in a Lucene Index. This process runs
about 4 times a day (the database has constant input flow).
In the beginning of my development i created a search engine
project to search this engine (web-based) using lucene and spring.
(i have yet to investigate Compass Framework)
I have recently found an increasing need to restructure my code-
base and make the search logic available to other projects aswell.
I therefore created a search-API and a search-luceneimpl project.
I then created another project, a web service offering the basic
search feature, with a list of information beans as a return object.
the problem is this, (and the whole confusion regarding
indexsearchers, writers and stuff:) ):
i noticed today that the webservice only access a "snapshot" of the
index, from the actual moment the webservice was loaded. If i then
reload the webservice context, the results will be "up-to-date"
again. So it seems that i have done something wrong in my logic. (doh)
In the webservice, i load my searcher-class from the spring-
context, setting it in the constructor.
The searcher-class have the following logic in its constructor:
searcher = new IndexSearcher(indexPath);
then i have specified a close-method in the spring-context, which
will call the close method containing the
searcher.close();
I have read that one should only open one searcher object and use
this for all searches, then close it when done... Well, that is a
bit tricky i think. As for now i have to projects "reading" from
the index (the old search-engine project) and this new web service.
In addition the indexer-project is the only project writing to the
index...
Any ideas or input to a mere beginner on how to organize this mess?
Sincerely yours,
Aleksander M. Stensby
--
Aleksander M. Stensby
Software Developer
Integrasco A/S
[EMAIL PROTECTED]
Tlf.: +47 41 22 82 72
---------------------------------------------------------------------
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]