Re: TermDocs

2013-07-09 Thread lukai
t; reader.maxDoc(); ++i) { > if (liveDocs != null && !liveDocs.get(i)) { > continue; > } > > to replace > >TermDocs termDocs = reader.termDocs(null); > while(termDocs.next()) >{ > > > 2013/7/8 Ian Lea

RE: TermDocs

2013-07-09 Thread Uwe Schindler
if (liveDocs != null && !liveDocs.get(i)) { > continue; > } This is what termDocs(null) did internally in Lucene 3. So this code "looks" not efficient but that is all you can do - and is not different than in earlier Lucene versions. Uwe > 2013/7/8 Ian

Re: TermDocs

2013-07-08 Thread Yonghui Zhao
)) { continue; } to replace TermDocs termDocs = reader.termDocs(null); while(termDocs.next()) { 2013/7/8 Ian Lea > There's a fair chunk of info on TermDocs and friends in the migration > guide. http://lucene.apache.org/core/4_3_1/MIGRATE.html &

Re: TermDocs

2013-07-08 Thread Ian Lea
There's a fair chunk of info on TermDocs and friends in the migration guide. http://lucene.apache.org/core/4_3_1/MIGRATE.html Does that cover your question? -- Ian. On Mon, Jul 8, 2013 at 12:32 PM, Yonghui Zhao wrote: > Hi, > > What's proper replacement of

TermDocs

2013-07-08 Thread Yonghui Zhao
Hi, What's proper replacement of "TermDocs termDocs = reader.termDocs(null);“ in lucene 4.x It seems reader.termDocsEnum(term) can't take null as a input parameter.

Re: ArrayIndexOutOfBoundsException when iterating over TermDocs

2010-09-24 Thread Simon Willnauer
Shay, >> >> would you mind open a jira issue for that? >> >> simon >> >> On Fri, Sep 24, 2010 at 2:53 AM, Shay Banon wrote: >> > Hi, >> > >> >    A user got this very strange exception, and I managed to get the >> > index >

Re: ArrayIndexOutOfBoundsException when iterating over TermDocs

2010-09-24 Thread Shay Banon
> simon > > On Fri, Sep 24, 2010 at 2:53 AM, Shay Banon wrote: > > Hi, > > > >A user got this very strange exception, and I managed to get the index > > that it happens on. Basically, iterating over the TermDocs causes an > AAOIB > > exception. I easily re

Re: ArrayIndexOutOfBoundsException when iterating over TermDocs

2010-09-23 Thread Simon Willnauer
Shay, would you mind open a jira issue for that? simon On Fri, Sep 24, 2010 at 2:53 AM, Shay Banon wrote: > Hi, > >    A user got this very strange exception, and I managed to get the index > that it happens on. Basically, iterating over the TermDocs causes an AAOIB > exce

ArrayIndexOutOfBoundsException when iterating over TermDocs

2010-09-23 Thread Shay Banon
Hi, A user got this very strange exception, and I managed to get the index that it happens on. Basically, iterating over the TermDocs causes an AAOIB exception. I easily reproduced it using the FieldCache which does exactly that (the field in question is indexed as numeric). Here is the

Re: TermDocs

2010-05-14 Thread Grant Ingersoll
p a BitSet like so: > > for ( int x = 0; x < fields.length; x++ ) { >for ( int y = 0; y < values.length; y++ ) { >TermDocs termDocs = reader.termDocs( new Term( fields[x], values[y] ) ); >try { >while ( termDocs.next() ) { >

TermDocs

2010-05-12 Thread roy-lucene-user
values.length; y++ ) { TermDocs termDocs = reader.termDocs( new Term( fields[x], values[y] ) ); try { while ( termDocs.next() ) { int doc = termDocs.doc(); bits.set( doc ); } } finally { termDocs.close(); } } } I notice that

Re: Do TermDocs and TermEnum need to be closed?

2009-05-21 Thread Jeremy Volkman
lling clone() on > the "real" IndexInputs and so for NIOFSDirectory, FSDirectory and > RAMDirectory at least, when a clone's close() is called, that's a > no-op. > > I think there are many places in Lucene where we don't close the > TermDocs/TermPositions so

Re: Do TermDocs and TermEnum need to be closed?

2009-05-21 Thread Michael McCandless
. I think there are many places in Lucene where we don't close the TermDocs/TermPositions so I think you're OK not calling them until/unless this situation changes in Lucene. Probably we should either remove close() entirely (because it sure looks like it's supposed to be called), o

Do TermDocs and TermEnum need to be closed?

2009-05-21 Thread Jeremy Volkman
Greetings all, I currently have a FieldExistsFilter which returns all documents that contain a particular field. I'm in the process of converting my custom filters to be DocIdSet based rather than BitSet based. This filter, however, requires the use of a TermDocs object to iterate over term

Re: termDocs / termEnums performance increase for 2.4.0

2009-02-17 Thread Michael McCandless
der to populate values the first time a given field is loaded. It's also what segment merging does. In 2.9, we've switched searching to proceed segment by segment, instead of using the MultiSegmentReader API to get TermEnum/TermDocs (this was LUCENE-1483). This gives a good speedu

termDocs / termEnums performance increase for 2.4.0

2009-02-05 Thread Beard, Brian
Thought I would report a performance increase noticed in migrating from 2.3.2 to 2.4.0. Performing an iterated loop using termDocs & termEnums like below is about 30% faster. The example test set I'm running has about 70K documents to go through and process (on a dual processor window

Re: TermDocs and "read"

2008-10-20 Thread Michael McCandless
It seems like you are trying to use the TermDocs iterator to load the term freq for that particular document (doc)? It doesn't work that way -- instead, it simply iterates over all documents that this term occurred in. (Ie it will replace the doc in the int[] that you passed in,

TermDocs and "read"

2008-10-20 Thread Carlos Rodríguez Fernández
Hello: I have a problem with TermDocs#read operation. the following code has an incorrect result: . int termFreq=0; . TermDocs termDocs = indexReader.termDocs(new Term(((Field)field).name(),termCons)); int[] freqs = new int[]{0

TermDocs and "read"

2008-10-20 Thread Carlos Rodríguez Fernández
Hello: I have a problem with TermDocs#read operation. the following code has an incorrect result: . int termFreq=0; . TermDocs termDocs = indexReader.termDocs(new Term(((Field)field).name(),termCons)); int[] freqs = new int[]{0

Re: Termdocs question

2008-06-24 Thread Chris Hostetter
: : > termDocs = reader.termDocs(term); : >while(termDocs.next()){ : >int index = termDocs.doc(); : >if(reader.document(index).get("id").equals(id)){ : >re

Re: uniqueWords, and termDocs

2008-06-24 Thread Otis Gospodnetic
> From: Erick Erickson <[EMAIL PROTECTED]> > To: java-user@lucene.apache.org > Sent: Tuesday, June 24, 2008 9:26:03 AM > Subject: Re: uniqueWords, and termDocs > > Isn't asking for unique words (actually tokens) equivalent to enumerating > all the terms in a fie

Re: uniqueWords, and termDocs

2008-06-24 Thread Erick Erickson
at 6:03 PM, Cam Bazz <[EMAIL PROTECTED]> wrote: > Hello, > > I need to be able to select a random word out of all the words in my index. > how can I do this tru termDocs() ? > > Also, I need to get a list of unique words as well. Is there a way to ask > this to lucene? > > Best Regards, > -C.B. >

uniqueWords, and termDocs

2008-06-23 Thread Cam Bazz
Hello, I need to be able to select a random word out of all the words in my index. how can I do this tru termDocs() ? Also, I need to get a list of unique words as well. Is there a way to ask this to lucene? Best Regards, -C.B.

Re: Termdocs question

2008-06-23 Thread Vinicius Carvalho
t; > 20 jun 2008 kl. 18.12 skrev Vinicius Carvalho: > > > Hello there! I trying to query for a specific document on a efficient way. >> > > Hi Vinicius, > >termDocs = reader.termDocs(term); >> while(termDocs.next()){ >> in

Re: Termdocs question

2008-06-21 Thread Karl Wettin
20 jun 2008 kl. 18.12 skrev Vinicius Carvalho: Hello there! I trying to query for a specific document on a efficient way. Hi Vinicius, termDocs = reader.termDocs(term); while(termDocs.next()){ int index = termDocs.doc(); if

Re: Termdocs question

2008-06-20 Thread Erick Erickson
String id){ > Term term = new Term("id",id); > IndexReader reader = readerManager.getIndexReader(); >TermDocs termDocs = null; >try { >termDocs = reader.termDocs(term); >while(termDocs.next()){ >i

Termdocs question

2008-06-20 Thread Vinicius Carvalho
st it seems that its a bit of overhead, using a reader.termDocs(term) would be faster. Here's a piece of code: private void deleteFromIndex(String id){ Term term = new Term("id",id); IndexReader reader = readerManager.getIndexReader(); TermDocs termDocs

Re: Reuse TermDocs

2007-11-05 Thread Yonik Seeley
On 11/5/07, Mike Streeton <[EMAIL PROTECTED]> wrote: > Can TermDocs be reused i.e. can you do. > > TermDocs docs = reader.termDocs(); > docs.seek(term1); > int i = 0; > while (docs.next()) { > i++; > } > docs.seek(term2); > int j = 0; > while (docs

FuzzyQuery using termDocs() for context filtering

2007-11-05 Thread Timo Nentwig
Hi! Imagine an index holding documents in different languages and country. Language+country is what I call a context and I build and hold a QueryFilter for each context. When performing a fuzzy search, FilteredTermEnum doesn't care about any contexts at all (well, how should it :). It builds a

Reuse TermDocs

2007-11-05 Thread Mike Streeton
Can TermDocs be reused i.e. can you do. TermDocs docs = reader.termDocs(); docs.seek(term1); int i = 0; while (docs.next()) { i++; } docs.seek(term2); int j = 0; while (docs.next()) { j++; } Reuse does seem to work but I get ArrayIndexOutOfBoundsExceptions from BitVector it I

Problem with TermDocs

2006-02-20 Thread Anton Potehin
Ir is IndexReader. termIdent is Term int freq = ir.docFreq(termIdent); if (freq > 1) { TermDocs termDocs = ir.termDocs(termIdent); int[] docsArr = new int[freq]; int[] freqArr = new int[freq]; int number = termDocs.read(docsArr,freqArr); System.out.println(num