Henning,

The reason for this is quite simple: CLucene (as does Java Lucene) doesn't
retreive all the possible results on the first lookup. It caches the first n
results (usually 100), and whenever a result which hasn't been loaded is
requested, it will go and fetch it. Without looking too deep into this, I
assume while searching the Query object is needed.

As with other suggestions which have been raised here lately, I think it is
best to first implement the basic smartpointers support, and only after that
is done and tested, to start looking for more places that can be of
andvantage to. I agree with you on this, but I'd like this intrusive change
to be done in the correct order. Veit Jahns has offerred help on this
subject, and I'm sure he could use another set of hands. I hope I will be
able to join the effort shortly.

So, for now let's keep with the current behvior, and just document this
behavior. If you'll notice, all tests in our test suite care to dispose of
the Query object only after the Hits object is disposed (or the application
does not call for any further hits).

Itamar. 

-----Original Message-----
From: Henning Meyer [mailto:tutm...@gmail.com] 
Sent: Saturday, January 16, 2010 5:38 AM
To: clucene-developers@lists.sourceforge.net
Subject: [CLucene-dev] strange behaviour due to ownership problems

Hi All again,

while bug-hunting in my project I found a very strange behaviour regarding
Hits::doc(int). If the corresponding Query is already destroyed, you'll get
the first 100 results without any problems - just right till you get a
SEGFAULT for the 101st result.
Everything is fine if the Query-Object is kept. But this is not clearly
stated in the docs.
This should change! I'd propose taking a Copy or use of std::auto_ptr in
this case, because I assume the Query is not only to be kept, but also to be
unchanged. So ownership should go over to the Hits-Object. Maybe both
methods should be offered. Internally both could initialize the same raw
pointer.

Henning

----------------------------------------------------------------------------
--
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for
Conference attendees to learn about information security's most important
issues through interactions with peers, luminaries and emerging and
established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers



------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers

Reply via email to