Recreating index lucene without stopping client applications

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Recreating index lucene without stopping client applications

Eduardo Costa Lopes
Hello,

I have a Jboss application querying a lucene index to get some customer info. Sometimes the index are recreated while the application is running. Basically, the old index is erased and a new one is created. In the application side we have a scheduler calling org.apache.lucene.search.SearcherManager..maybeRefresh(), in order to get a new connection to the index. The issue is: today we have updated the index and looking for a certain name our command-line returns 4955 hits, but in the web app we got 4058 hits (three more). The correct hit number only is show if restart the jboss. I'd like to know how can we recreate the lucene index without need to restart the applications.

Thanks in advance,

Eduardo Lopes.




-


"Esta mensagem do SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO), empresa pública federal regida pelo disposto na Lei Federal nº 5.615, é enviada exclusivamente a seu destinatário e pode conter informações confidenciais, protegidas por sigilo profissional. Sua utilização desautorizada é ilegal e sujeita o infrator às penas da lei. Se você a recebeu indevidamente, queira, por gentileza, reenviá-la ao emitente, esclarecendo o equívoco."

"This message from SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO) -- a government company established under Brazilian law (5.615/70) -- is directed exclusively to its addressee and may contain confidential data, protected under professional secrecy rules. Its unauthorized use is illegal and may subject the transgressor to the law's penalties. If you're not the addressee, please send it back, elucidating the failure."
Reply | Threaded
Open this post in threaded view
|

Re: Recreating index lucene without stopping client applications

Marco Reis-2
Hi Eduardo,

It's not clear the index recreation process, but I think you have two
different SearcherManagers, one for the app and a different one for the
command line. At some point, one of them could see the document exclusion,
and the JBoss doen't. Maybe reopen the index directory could help.




On Wed, Jul 11, 2018 at 11:46 AM Eduardo Costa Lopes <
[hidden email]> wrote:

> Hello,
>
> I have a Jboss application querying a lucene index to get some customer
> info. Sometimes the index are recreated while the application is running.
> Basically, the old index is erased and a new one is created. In the
> application side we have a scheduler calling
> org.apache.lucene.search.SearcherManager..maybeRefresh(), in order to get a
> new connection to the index. The issue is: today we have updated the index
> and looking for a certain name our command-line returns 4955 hits, but in
> the web app we got 4058 hits (three more). The correct hit number only is
> show if restart the jboss. I'd like to know how can we recreate the lucene
> index without need to restart the applications.
>
> Thanks in advance,
>
> Eduardo Lopes.
>
>
>
>
> -
>
>
> "Esta mensagem do SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO),
> empresa pública federal regida pelo disposto na Lei Federal nº 5.615, é
> enviada exclusivamente a seu destinatário e pode conter informações
> confidenciais, protegidas por sigilo profissional. Sua utilização
> desautorizada é ilegal e sujeita o infrator às penas da lei. Se você a
> recebeu indevidamente, queira, por gentileza, reenviá-la ao emitente,
> esclarecendo o equívoco."
>
> "This message from SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO) -- a
> government company established under Brazilian law (5.615/70) -- is
> directed exclusively to its addressee and may contain confidential data,
> protected under professional secrecy rules. Its unauthorized use is illegal
> and may subject the transgressor to the law's penalties. If you're not the
> addressee, please send it back, elucidating the failure."
>
--
Marco Reis
Software Engineer
http://marcoreis.net
https://github.com/masreis
+55 61 9 81194620
Reply | Threaded
Open this post in threaded view
|

Re: Recreating index lucene without stopping client applications

Eduardo Costa Lopes
Hi Marco,

Basically, the content of lucene index directory is deleted and after, the index is recreated (under the same directory). Months ago, I've researched how to "refresh" the lucene access to get the newest data withou restarting the wep applications and, in the 6.1.0 version, it is available the class SearchManager, which according to the documentation, should be called its method maybeRefresh() periodically to reopen the index. Our "reopen scheduler" runs hourly and even being executed with success it seems the data wasn't the newest.    

Thanks.


==================================
Eduardo Costa Lopes
SERPRO - SUPDE/DEPAE/DE009

e-mail: [hidden email]
telefone: (51) 2129 - 1180

----- Mensagem original -----
De: "Marco Reis" <[hidden email]>
Para: "java-user" <[hidden email]>
Enviadas: Quarta-feira, 11 de julho de 2018 12:06:18
Assunto: Re: Recreating index lucene without stopping client applications

Hi Eduardo,

It's not clear the index recreation process, but I think you have two
different SearcherManagers, one for the app and a different one for the
command line. At some point, one of them could see the document exclusion,
and the JBoss doen't. Maybe reopen the index directory could help.




On Wed, Jul 11, 2018 at 11:46 AM Eduardo Costa Lopes <
[hidden email]> wrote:

> Hello,
>
> I have a Jboss application querying a lucene index to get some customer
> info. Sometimes the index are recreated while the application is running.
> Basically, the old index is erased and a new one is created. In the
> application side we have a scheduler calling
> org.apache.lucene.search.SearcherManager..maybeRefresh(), in order to get a
> new connection to the index. The issue is: today we have updated the index
> and looking for a certain name our command-line returns 4955 hits, but in
> the web app we got 4058 hits (three more). The correct hit number only is
> show if restart the jboss. I'd like to know how can we recreate the lucene
> index without need to restart the applications.
>
> Thanks in advance,
>
> Eduardo Lopes.
>
>
>
>
> -
>
>
> "Esta mensagem do SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO),
> empresa pública federal regida pelo disposto na Lei Federal nº 5.615, é
> enviada exclusivamente a seu destinatário e pode conter informações
> confidenciais, protegidas por sigilo profissional. Sua utilização
> desautorizada é ilegal e sujeita o infrator às penas da lei. Se você a
> recebeu indevidamente, queira, por gentileza, reenviá-la ao emitente,
> esclarecendo o equívoco."
>
> "This message from SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO) -- a
> government company established under Brazilian law (5.615/70) -- is
> directed exclusively to its addressee and may contain confidential data,
> protected under professional secrecy rules. Its unauthorized use is illegal
> and may subject the transgressor to the law's penalties. If you're not the
> addressee, please send it back, elucidating the failure."
>
--
Marco Reis
Software Engineer
http://marcoreis.net
https://github.com/masreis
+55 61 9 81194620

-


"Esta mensagem do SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO), empresa pública federal regida pelo disposto na Lei Federal nº 5.615, é enviada exclusivamente a seu destinatário e pode conter informações confidenciais, protegidas por sigilo profissional. Sua utilização desautorizada é ilegal e sujeita o infrator às penas da lei. Se você a recebeu indevidamente, queira, por gentileza, reenviá-la ao emitente, esclarecendo o equívoco."

"This message from SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO) -- a government company established under Brazilian law (5.615/70) -- is directed exclusively to its addressee and may contain confidential data, protected under professional secrecy rules. Its unauthorized use is illegal and may subject the transgressor to the law's penalties. If you're not the addressee, please send it back, elucidating the failure."

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]