David Townsend writes:
>
> So the short question is, should the hits object be changing and what is the
> best way to delete all the results of a search (it's a range query so I can't
> use delete(Term term)?
>
The hits object caches only part of the hits (initially the first 100 (?)).
This cache is extended if further hits are accessed by repeating the search.
Since you deleted part of the hits at this point, your hits object changes.
You should be able to get around this by either scanning the hits objects
from end to start instead of start to end or deleting with a different
index reader. In the latter case the searcher should not see the deletions.
Reversing the order might be preferable, since it implies only one search
repetition.
(both suggestions untested)
The "best" way would probably be, to avoid a hit object anyway and delete
the documents at the level where the hits object is created. Have a look
at the sources for details. (also untested; I never needed more than
term based deletions)
Morus
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]