Re: Closing indexsearcher , making sur eit is in use

2011-01-13 Thread Umesh Prasad
You can use ReadWriteLock as low level technique to manage access. A ReadWriteLock maintains a pair of associated locks

Re: lucene-based log searcher?

2011-01-13 Thread Benzion G
If you can define one searchable word for the whole log message and index this word only maybe you can use DB instead. I apply Analyzer to every and whole log message text - and then I can quickly find all messages, that have e.g. "NullPointerException" or "user not found" text or anything else.

Re: lucene-based log searcher?

2011-01-13 Thread chensheng
Hi, I have a similar case. If I only index some fixed fields with single-word/number, instead of full-text search, is Lucene any better than a relational database? -- Original -- From: "Benzion G"; Date: Fri, Jan 14, 2011 01:15 AM To: "java-user"; Subject:

Re: "or" as a search term : SOLVED

2011-01-13 Thread Benoit Mercier
Thank you Robert and Hongyinjie for your support. I managed to solved my problem. It was simply a wrong application configuration. I am using PerFieldAnalyzerWrapper, with analysers injected via Spring. A stupid line inversion in a Spring application context file that didn't hurd during sev

Re: Closing indexsearcher , making sur eit is in use

2011-01-13 Thread Ian Lea
Use something with reference counting - Lucene in action second edition has a searcher manager class which I think might be available standalone. Or a couple of low-tech alternatives: instead of closing the old searcher, move it out of the way and keep a reference to it and close it after n secon

Closing indexsearcher , making sur eit is in use

2011-01-13 Thread Paul Taylor
As recommended, I use just one Index Searcher on my multithreaded GUI app using a singleton pattern If data is modified in the index I then close the reader and searcher, and they will be recreate on next call to getInstance() but Ive hit a problem whereby one thread was closing a searcher, anot

lucene across many clients

2011-01-13 Thread Sean Joyce
Hi Lucene Users, I work on a product with several thousand clients. We use Lucene to index various client data and make the functionality available as part of our product. Currently, each client has its own index for security reasons, but I am wondering if this is the best way to handle the indexi

Re: lucene-based log searcher?

2011-01-13 Thread Benzion G
Hi, I almost finished these days to write such a tool. It reads via FTPClient the log files and adds to Lucene index. Via small Web application you can see/filter/sort the log messages. -- View this message in context: http://lucene.472066.n3.nabble.com/lucene-based-log-searcher-tp2247969p22

RE: Newbie: "Life span" of IndexWriter / IndexSearcher?

2011-01-13 Thread Uwe Schindler
Hi, > We're writing a web application, which naturally needs > - "IndexSearcher" when users use our search screen > - "IndexWriter" in a background process that periodically updates and > optimizes our index. > Note our writer is exclusive - no other applications/threads ever write to our > index

Newbie: "Life span" of IndexWriter / IndexSearcher?

2011-01-13 Thread sol myr
Hi, We're writing a web application, which naturally needs - "IndexSearcher" when users use our search screen - "IndexWriter" in a background process that periodically updates and optimizes our index. Note our writer is exclusive - no other applications/threads ever write to our index files. Wh

Re: Maintaining index for "flattened" database tables

2011-01-13 Thread sol myr
Sounds good, thanks :) --- On Thu, 1/13/11, mark harwood wrote: From: mark harwood Subject: Re: Maintaining index for "flattened" database tables To: java-user@lucene.apache.org Date: Thursday, January 13, 2011, 6:20 AM Probably off-topic for a Lucene list but the typical database options are:

Re: Maintaining index for "flattened" database tables

2011-01-13 Thread mark harwood
Probably off-topic for a Lucene list but the typical database options are: 1) an auto-updated "last changed" timestamp column on related tables that can be queried 2) a database trigger automatically feeding a "to-be-indexed" table Option 1 would also need a "marked as deleted" column adding to

Re: lucene-based log searcher?

2011-01-13 Thread Umesh Prasad
Checkout http://code.google.com/p/lucene-log4j/ On Thu, Jan 13, 2011 at 7:09 PM, Steven A Rowe wrote: > Hi Paul, > > I saw this yesterday, but haven't tried it myself: > > http://karussell.wordpress.com/2010/10/27/feeding-solr-with-its-own-logs/ > > The author has a project called "Sogger" - So

RE: lucene-based log searcher?

2011-01-13 Thread Steven A Rowe
Hi Paul, I saw this yesterday, but haven't tried it myself: http://karussell.wordpress.com/2010/10/27/feeding-solr-with-its-own-logs/ The author has a project called "Sogger" - Solr + Logger? - that can read various forms of logs. Steve > -Original Message- > From: Paul Libbrecht [mai

lucene-based log searcher?

2011-01-13 Thread Paul Libbrecht
Hello list, has anyone built a log-analyzer based on Lucene? Our logs are so big that grep takes more hours to do what I want it to do. I'm sure Lucene would solve it. Thanks in advance paul - To unsubscribe, e-mail: java-user-

Maintaining index for "flattened" database tables

2011-01-13 Thread sol myr
Hi, Our main data storage is MySql tables. We index it on Lucene in order to improve the search (boosting, proximate spelling, etc). We naturally maintain it - for example, to insert a new "Contract" entity, we have: addContract(Contract cont){ // INSERT into MySQL: hibernateSession.sa

Re: Can not delete index file after close the IndexSearcher

2011-01-13 Thread Ian Lea
In fact it's probably as simple as if (searcher == null) { searcher = new IndexSearcher(dir); } at the top of the loop. -- Ian. 2011/1/13 Ian Lea : > As I said, there is probably a better solution. At the moment you are > opening searchers at the top and bottom of the loop and on

Re: Can not delete index file after close the IndexSearcher

2011-01-13 Thread 张志田
Ian, thank you very much. I will try to change my switch solution. Thanks again Garry 在 2011年1月13日 下午6:41,Ian Lea 写道: > As I said, there is probably a better solution. At the moment you are > opening searchers at the top and bottom of the loop and on second and > subsequent passes you are not

Re: Can not delete index file after close the IndexSearcher

2011-01-13 Thread Ian Lea
As I said, there is probably a better solution. At the moment you are opening searchers at the top and bottom of the loop and on second and subsequent passes you are not closing the bottom one, that you've only just opened, before opening a new one using the same instance variable. The resources

Re: Can not delete index file after close the IndexSearcher

2011-01-13 Thread 张志田
Ian, thanks for your response. Your suggestion worked for me. What does oldSearcher.close() do in my code? why I have to close the searcher and oldSearcher together? In my opinion, oldSearcher held index1 while searcher held index2, they are using different resources, the resources held by them sh

Re: Can not delete index file after close the IndexSearcher

2011-01-13 Thread Ian Lea
Try adding try { searcher.close(); } catch (Exception e) { } before searcher = new IndexSearcher(dir); at the top of the loop. At the end of a loop searcher is open, and is not closed before being reassigned. There is probably a better solution along the lines of only opening new