Re: Searching for instances within a document

2008-07-11 Thread Karl Wettin
11 jul 2008 kl. 15.28 skrev jnance: The TermFrequencyVector works perfectly for normal query strings. But if I add a wild card (*) onto words to search for different forms of the word I get an ArrayIndexOutOfBoundsException because the index is -1. Why does this happen? And is there anyw

Re: Searching for instances within a document

2008-07-11 Thread jnance
The TermFrequencyVector works perfectly for normal query strings. But if I add a wild card (*) onto words to search for different forms of the word I get an ArrayIndexOutOfBoundsException because the index is -1. Why does this happen? And is there anyway to avoid it? Thanks, James jnance wrot

Re: Searching for instances within a document

2008-07-10 Thread jnance
Yes, the term frequency vector is exactly what I needed. Thanks! -James Ajay Lakhani wrote: > > Hi James, > > Try this: > > Searcher searcher = new IndexSearcher(dir); > QueryParser parser = new QueryParser("content", new > StandardAnalyzer()); > Query query = parser.parse(queryS

Re: Searching for instances within a document

2008-07-10 Thread Ajay Lakhani
Hi James, Try this: Searcher searcher = new IndexSearcher(dir); QueryParser parser = new QueryParser("content", new StandardAnalyzer()); Query query = parser.parse(queryString); HashSet queryTerms = new HashSet(); query.extractTerms(queryTerms); Hits hits = searcher.sear

Re: Searching for instances within a document

2008-07-09 Thread Karl Wettin
Maybe you are looking for the document TermFreqVector? karl 9 jul 2008 kl. 15.49 skrev jnance: Hi, I am indexing lots of text files and need to see how many times a certain word comes up in each text file. Right now I have this constructor for "search": static void search(Searche

Re: Searching for instances within a document

2008-07-09 Thread jnance
Ok, I'll see if I can find anything. Thanks, James -- View this message in context: http://www.nabble.com/Searching-for-instances-within-a-document-tp18362075p18362432.html Sent from the Lucene - Java Users mailing list archive at Nabble.com.

Re: Searching for instances within a document

2008-07-09 Thread Erick Erickson
I know this has been discussed before, so if you search the archive you might find an answer more quickly. I don't remember what the resolution was, so I can't help there. Best Erick On Wed, Jul 9, 2008 at 9:49 AM, jnance <[EMAIL PROTECTED]> wrote: > > Hi, > > I am indexing lots of text files an