Re: Problem : Searching with Lucene 2.0

2006-07-05 Thread yueyu lin
I didn't see the demo codes. You should look into the indexDocs(IndexWriter,File) function to see if it stores these kinds of contents. On 7/6/06, Sarvadnya Mutalik <[EMAIL PROTECTED]> wrote: I'm using the indexing technique as illustrated in the example provided by Lucene 2.0. (as in demo ==>

RE: IndexSearcher memory leak?

2006-07-05 Thread Rob Staveley (Tom)
My two bits... If you consider (say) the 2nd pass of the loop... Searcher searcher = null; for(int i = 0; i < 5; ++i){ RAMDirectory ramdir = new RAMDirectory( db ); // <- Consider this moment searcher = n

RE: Problem : Searching with Lucene 2.0

2006-07-05 Thread Sarvadnya Mutalik
I'm using the indexing technique as illustrated in the example provided by Lucene 2.0. (as in demo ==> IndexFiles.java) The Indexing the method is as bellow static void indexDocs(IndexWriter writer, File file) throws IOException { // do not try to index files that cannot be read i

Re: Problem : Searching with Lucene 2.0

2006-07-05 Thread yueyu lin
How you index "doctitle" and "summary". The Store parameter must be "COMPRESS" or "YES" On 7/6/06, Sarvadnya Mutalik <[EMAIL PROTECTED]> wrote: Hi, I'm using Lucene 2.0, latest ver of Apache Lucene search engine. After successfully indexing, when I tried to search, I'm not able to get the compl

Problem : Searching with Lucene 2.0

2006-07-05 Thread Sarvadnya Mutalik
Hi, I'm using Lucene 2.0, latest ver of Apache Lucene search engine. After successfully indexing, when I tried to search, I'm not able to get the complete information. In the following code snippet, I'm getting the values for "doctitle" and "summary" as null. While it says there are two results.

Re: IndexSearcher memory leak?

2006-07-05 Thread Heng Mei
import org.apache.lucene.search.Searcher; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.*; import org.apache.lucene.index.*; import org.apache.lucene.store.RAMDirectory; /** * Index is ~100mb. * Run with -Xmx256m on Windows XP * * OutOfMemoryException encounter

Re: IndexSearcher memory leak?

2006-07-05 Thread Chris Hostetter
The mailing list server doesn't allow most attachments (i think the magic incantation is to make sure your mail client indicates that the attachments are plain text -- not some fancy type like text/x-java-source or application/x-java) try including it inline in your email. : Date: Wed, 5 Jul 2

Re: IndexSearcher memory leak?

2006-07-05 Thread Heng Mei
Thanks for the fast response -- you're right, I had a typo in the code snippet. I've attached the test code that reproduces the OutOfMemoryException. The code is a simple main method that repeatedly opens/searches/closes an index using RAMDirectory. Maybe there's something I'm overlooking, but i

Re: IndexSearcher memory leak?

2006-07-05 Thread Chris Hostetter
: I get an OutOfMemoryException after a few iterations of the following loop: : LOOP: : ramdir = new RAMDirectory( "path/to/my/directory" ); : searcher = new IndexSearcher( reader ); : searcher.search(new TermQuery( new Term( "field", "keyword"))); : searcher.close(); :

Re: BitSet in a HitCollector

2006-07-05 Thread Chris Hostetter
: I'm using a HitCollector and would like to know the : total number of results that matched a given query. : Based on the JavaDoc, I this will do the trick: you don't need a BitSet in that case, you could find that out just using an int... public CountingCollector extends HitCollector {

Re: Best way to Add items to Index in Real Time

2006-07-05 Thread Chris Hostetter
: I'm a novice with this, so I'll appreciate your patience. : I'm using a batch program for doing the additions and deletions while a : separate web app for searching. How can I ensure that these two different : apps (one making the changes to index and the other just searching) don't : run into e

Inserting a document into an index at a specified position

2006-07-05 Thread Jason Calabrese
All, For performance reasons we keep our index of over a million documents ordered alphabeticaly. This way for an alpha sort we can just use the index order. This works very good, but I'm now looking for a way to insert a single document to the index in the correct position. Is there any s

IndexSearcher memory leak?

2006-07-05 Thread Heng Mei
Hi experts, There seems to be a strange memory leak with the IndexSearcher. I get an OutOfMemoryException after a few iterations of the following loop: LOOP: ramdir = new RAMDirectory( "path/to/my/directory" ); searcher = new IndexSearcher( reader ); searcher.search(new Term

Re: Best way to Add items to Index in Real Time

2006-07-05 Thread gloria_white
thanks for the response Otis! I'm a novice with this, so I'll appreciate your patience. I'm using a batch program for doing the additions and deletions while a separate web app for searching. How can I ensure that these two different apps (one making the changes to index and the other just search

Re: Best way to Add items to Index in Real Time

2006-07-05 Thread Michael Busch
Otis Gospodnetic wrote: If you are getting errors while searching and at the same either adding or deleting documents, chances are you are not using the API correctly and following the concurrency rules (described many times on this list). Yo ucan search and modify your index at the same time

code in question for tomcat 5 can't find static method FSDirectory.getDirectory( String s, boolean b)?

2006-07-05 Thread maffittd
I don't think the attached code made it through on the first post. Here is a second try. (See attached file: SetDirectory.java)(See attached file: query.jsp)(See attached file: QueryEngine.java) --- David Maffitt, Senior Programmer-Analyst Washington University School of Medicine [EMAIL PR

Fw: tomcat 5 can't find static method FSDirectory.getDirectory( String s, boolean b)?

2006-07-05 Thread maffittd
--- David Maffitt, Senior Programmer-Analyst Washington University School of Medicine [EMAIL PROTECTED] Electronic Radiology Laboratory voice 314.362.6965 Mallinckrodt Institute of Radiology fax314.362.6971 510 S. Kingshighway, St. Louis, MO

Re: Best way to Add items to Index in Real Time

2006-07-05 Thread Otis Gospodnetic
If you are getting errors while searching and at the same either adding or deleting documents, chances are you are not using the API correctly and following the concurrency rules (described many times on this list). Yo ucan search and modify your index at the same time. Adding and deleting doc

Best way to Add items to Index in Real Time

2006-07-05 Thread gloria_white
We have a Lucene index of a small size(about 150k items) that requires additions/deletions several times in a day. We could add or delete 3 to 4k documents everytime we perform these operations. While we perform this operation, we still need to be 'online' and available for searching. And if we p

RE: Null field values

2006-07-05 Thread Seeta Somagani
I figured that out. I was opening up a different, but similar, index. That was made evident when I printed out the document. Thanks so much, Seeta -Original Message- From: Erick Erickson [mailto:[EMAIL PROTECTED] Sent: Saturday, July 01, 2006 8:56 AM To: java-user@lucene.apache.org Subjec

BitSet in a HitCollector

2006-07-05 Thread James Pine
Hey Everyone, I'm using a HitCollector and would like to know the total number of results that matched a given query. Based on the JavaDoc, I this will do the trick: Searcher searcher = new IndexSearcher(indexReader); final BitSet bits = new BitSet(indexReader.maxDoc()); searcher.search(que

Re: Re: Lucene and database

2006-07-05 Thread Erick Erickson
Alexander: You might also look through the mail archive for "database". There have been several dicsussions on that topic with input from people far more knowledgable than me that you might find relevant . Erick

Re: Function writing using lucene

2006-07-05 Thread Erick Erickson
Amit: You can make arbitrarily complex boolean clauses, see BooleanQuery. For that, you don't need a filter. You can add boolean clauses with MUST, SHOULD and MUST NOT (AND, OR, NOT). Filters are for restricting queries that create (under the covers) a large BooleanQuery. You shouldn't think abo