FAQ
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
aleksander.stensby@integrasco.no
Tlf.: +47 41 22 82 72

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

Search Discussions

  • Erik Hatcher at Jun 27, 2006 at 10:07 am
    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
    aleksander.stensby@integrasco.no
    Tlf.: +47 41 22 82 72

    ---------------------------------------------------------------------
    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
  • Aleksander M. Stensby at Jun 27, 2006 at 10:25 am
    Thank you very much Erik!
    I will definatly check into this. I'm currently using xfire in my
    implementation. I guess to big issue was/is that the indexing is done by
    one application, and the searching from several different applications.
    (obviously)

    I have been bitten by the lucene-virus;) Heh, so I tend to think, hmm,
    maybe i should use an lucene index here instead!? :)

    Trying to sort things out now, and recently moved most of my codebase to
    lucene 2.0.0. (some minor problem since i skipped the whole 1.9.0 step,
    and then in terms jumped past all the deprecation-warnings (doh!). :) But
    now it seems to be working just fine:) (well, apart from the
    searcher/writer/reader-mess :(

    On Tue, 27 Jun 2006 12:06:27 +0200, Erik Hatcher
    wrote:
    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
    aleksander.stensby@integrasco.no
    Tlf.: +47 41 22 82 72

    ---------------------------------------------------------------------
    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


    --
    Aleksander M. Stensby
    Software Developer
    Integrasco A/S
    aleksander.stensby@integrasco.no
    Tlf.: +47 41 22 82 72

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedJun 27, '06 at 6:56a
activeJun 27, '06 at 10:25a
posts3
users2
websitelucene.apache.org

People

Translate

site design / logo © 2022 Grokbase