How is the term frequency calculated if I have to add a user-generated document.

2013-04-18 Thread Gaurav Ranjan
I am a student and studying the functionality of Lucene for my project work. If I have to add a new user-generated document in lucene with a term having a particular frequency just like any text file, how do I do it? For eg, say I have to add the following documents analyzed from an image doc1 =

Re: Complete re-indexing using lucene

2013-04-18 Thread Michael McCandless
Just pass IndexWriterConfig.OpenMode.CREATE when you open the index on the same location ... this will make IndexWriter remove the existing index. Mike McCandless http://blog.mikemccandless.com On Thu, Apr 18, 2013 at 3:33 PM, Sandeep Jangra wrote: > Hi, > > I am using lucene in my project bu

Complete re-indexing using lucene

2013-04-18 Thread Sandeep Jangra
Hi, I am using lucene in my project built in java. I am writing the index to a file using FSDirectory.open("c:\\temp"). Every hour boundary I need to re-index the complete system. But if I use the same directory "c:\\temp" for re-indexing, the directory size will grow eventually because o

Re: Taking backup of a Lucene index

2013-04-18 Thread Michael McCandless
On Thu, Apr 18, 2013 at 12:32 AM, Hien Luu wrote: > It is difficult to associate a class named SnapshotDeletionPolicy with taking > backup of Lucene index. Naming is the hardest part :) It's a snapshot in the same sense as the ZFS file system, or a Network Appliance file server. What's hard he

Re: Taking backup of a Lucene index

2013-04-18 Thread Michael McCandless
On Wed, Apr 17, 2013 at 8:10 AM, Ashish Sarna wrote: > The external backup utility would be used by some other person and it would > simply copy the index directory to take its backup. I have no control over > this utility. OK. > I have ensured that nothing would be written to index before the b

Please explain the example

2013-04-18 Thread Gaurav Ranjan
I am a student and studying the functionality of Lucene for my project work. The DocDelta example on this link is not clear http://lucene.apache.org/core/4_2_0/core/org/apache/lucene/codecs/lucene40/Lucene40PostingsFormat.html?is-external=true , Please explain the first part how we are getting 15,

Why doesn't this code run - Adding synonyms from Wordnet to Lucene Index

2013-04-18 Thread Abhishek Shivkumar
I am writing this code as part of my CustomAnalyzer: public class CustomAnalyzer extends Analyzer { SynonymMap mySynonymMap = null; CustomAnalyzer() throws IOException { SynonymMap.Builder builder = new SynonymMap.Builder(true); FileReader fr = new FileReader("/h

Re: WildCardQuery: TooManyClauses Exception

2013-04-18 Thread Arun Kumar K
Thanks Uwe for clarification ! On Thu, Apr 18, 2013 at 4:37 PM, Uwe Schindler wrote: > Lucene 2.9+ has a different Wildcard Expansion using BooleanQuery only for > few terms, otherwise it uses a filter-based approach. Same applies for > range queries and prefix queries. > > - > Uwe Schindle

RE: WildCardQuery: TooManyClauses Exception

2013-04-18 Thread Uwe Schindler
Lucene 2.9+ has a different Wildcard Expansion using BooleanQuery only for few terms, otherwise it uses a filter-based approach. Same applies for range queries and prefix queries. - Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: u...@thetaphi.de > -Ori

WildCardQuery: TooManyClauses Exception

2013-04-18 Thread Arun Kumar K
Hi Guys, I am using following queries: 1>WildCardQuery 2>BooleanQuery having a WildCardQuery and TermQuery. WildCardQuery is field:* or say field:ab* >From Lucene FAQs and earlier discussions about TooManyClausesException i see that WildCardQuery gets expanded before doing search. For that i was