You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2012/09/10 16:46:07 UTC
[jira] [Created] (LUCENE-4372) CachingCollector.create(boolean,
boolean, double) is trappy
Robert Muir created LUCENE-4372:
-----------------------------------
Summary: CachingCollector.create(boolean, boolean, double) is trappy
Key: LUCENE-4372
URL: https://issues.apache.org/jira/browse/LUCENE-4372
Project: Lucene - Core
Issue Type: Task
Reporter: Robert Muir
Followup to LUCENE-3102.
Shai proposed a method that just caches all scores so they can be replayed:
{quote}
Do you think we can modify this Collector to not necessarily wrap another Collector? We have such Collector which stores (in-memory) all matching doc IDs + scores (if required). Those are later fed into several processes that operate on them (e.g. fetch more info from the index etc.). I am thinking, we can make CachingCollector optionally wrap another Collector and then someone can reuse it by setting RAM limit to unlimited (we should have a constant for that) in order to simply collect all matching docs + scores.
{quote}
But Mike had concerns about the RAM usage:
{quote}
I'd actually rather not have the constant – ie, I don't want to make
it easy to be unlimited? It seems too dangerous... I'd rather your
code has to spell out 10*1024 so you realize you're saying 10 GB (for
example).
{quote}
My concern here is what happens when you dont specify enough, I think those hits are just silently dropped (which is worse than using lots of RAM).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4372) CachingCollector.create(boolean,
boolean, double) is trappy
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452077#comment-13452077 ]
Yonik Seeley commented on LUCENE-4372:
--------------------------------------
bq. btw: what confuses me is what happens in the "run-out-of-ram" case, why do we even bother collecting the overflow'd docs here (other.collect)?
This was created for grouping. Originally, I always ran the query twice - once to get the top groups, then again to get the top docs per group. Caching scores was an optimization added later, but you definitely need to still call the delegate, even if you run out of cache space.
> CachingCollector.create(boolean, boolean, double) is trappy
> -----------------------------------------------------------
>
> Key: LUCENE-4372
> URL: https://issues.apache.org/jira/browse/LUCENE-4372
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Robert Muir
>
> Followup to LUCENE-3102.
> Shai proposed a method that just caches all scores so they can be replayed:
> {quote}
> Do you think we can modify this Collector to not necessarily wrap another Collector? We have such Collector which stores (in-memory) all matching doc IDs + scores (if required). Those are later fed into several processes that operate on them (e.g. fetch more info from the index etc.). I am thinking, we can make CachingCollector optionally wrap another Collector and then someone can reuse it by setting RAM limit to unlimited (we should have a constant for that) in order to simply collect all matching docs + scores.
> {quote}
> But Mike had concerns about the RAM usage:
> {quote}
> I'd actually rather not have the constant – ie, I don't want to make
> it easy to be unlimited? It seems too dangerous... I'd rather your
> code has to spell out 10*1024 so you realize you're saying 10 GB (for
> example).
> {quote}
> My concern here is what happens when you dont specify enough, I think those hits are just silently dropped (which is worse than using lots of RAM).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4372) CachingCollector.create(boolean,
boolean, double) is trappy
Posted by "Shai Erera (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452055#comment-13452055 ]
Shai Erera commented on LUCENE-4372:
------------------------------------
CachingCollector has this in its javadocs:
{code}
* Caches all docs, and optionally also scores, coming from
* a search, and is then able to replay them to another
* collector. You specify the max RAM this class may use.
* Once the collection is done, call {@link #isCached}. If
* this returns true, you can use {@link #replay(Collector)}
* against a new collector. If it returns false, this means
* too much RAM was required and you must instead re-run the
* original search.
{code}
Notice the last sentence about isCached returning false.
Should we just fix the static create() method's documentation (even though it points to the class's javadocs)?
I don't see any alternative -- if the user specified a too low RAM limit, what can you do besides discarding the docs and documenting that behavior? I'd hate to see exceptions thrown...
> CachingCollector.create(boolean, boolean, double) is trappy
> -----------------------------------------------------------
>
> Key: LUCENE-4372
> URL: https://issues.apache.org/jira/browse/LUCENE-4372
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Robert Muir
>
> Followup to LUCENE-3102.
> Shai proposed a method that just caches all scores so they can be replayed:
> {quote}
> Do you think we can modify this Collector to not necessarily wrap another Collector? We have such Collector which stores (in-memory) all matching doc IDs + scores (if required). Those are later fed into several processes that operate on them (e.g. fetch more info from the index etc.). I am thinking, we can make CachingCollector optionally wrap another Collector and then someone can reuse it by setting RAM limit to unlimited (we should have a constant for that) in order to simply collect all matching docs + scores.
> {quote}
> But Mike had concerns about the RAM usage:
> {quote}
> I'd actually rather not have the constant – ie, I don't want to make
> it easy to be unlimited? It seems too dangerous... I'd rather your
> code has to spell out 10*1024 so you realize you're saying 10 GB (for
> example).
> {quote}
> My concern here is what happens when you dont specify enough, I think those hits are just silently dropped (which is worse than using lots of RAM).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4372) CachingCollector.create(boolean,
boolean, double) is trappy
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452104#comment-13452104 ]
Yonik Seeley commented on LUCENE-4372:
--------------------------------------
bq. it seems to me we just throw away the cache completely and then start collecting,
No, collection (delegation) is always done. The cache is a transparent pass-through that *may* cache scores if there aren't too many.
> CachingCollector.create(boolean, boolean, double) is trappy
> -----------------------------------------------------------
>
> Key: LUCENE-4372
> URL: https://issues.apache.org/jira/browse/LUCENE-4372
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Robert Muir
>
> Followup to LUCENE-3102.
> Shai proposed a method that just caches all scores so they can be replayed:
> {quote}
> Do you think we can modify this Collector to not necessarily wrap another Collector? We have such Collector which stores (in-memory) all matching doc IDs + scores (if required). Those are later fed into several processes that operate on them (e.g. fetch more info from the index etc.). I am thinking, we can make CachingCollector optionally wrap another Collector and then someone can reuse it by setting RAM limit to unlimited (we should have a constant for that) in order to simply collect all matching docs + scores.
> {quote}
> But Mike had concerns about the RAM usage:
> {quote}
> I'd actually rather not have the constant – ie, I don't want to make
> it easy to be unlimited? It seems too dangerous... I'd rather your
> code has to spell out 10*1024 so you realize you're saying 10 GB (for
> example).
> {quote}
> My concern here is what happens when you dont specify enough, I think those hits are just silently dropped (which is worse than using lots of RAM).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4372) CachingCollector.create(boolean,
boolean, double) is trappy
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452103#comment-13452103 ]
Robert Muir commented on LUCENE-4372:
-------------------------------------
I see whats confusing me (it wasnt obvious until poking around this thing enough), there are 2 collectors, the one you wrap is just a passthrough always.
the one you replay to is separate.
ok it makes sense now.
> CachingCollector.create(boolean, boolean, double) is trappy
> -----------------------------------------------------------
>
> Key: LUCENE-4372
> URL: https://issues.apache.org/jira/browse/LUCENE-4372
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Robert Muir
>
> Followup to LUCENE-3102.
> Shai proposed a method that just caches all scores so they can be replayed:
> {quote}
> Do you think we can modify this Collector to not necessarily wrap another Collector? We have such Collector which stores (in-memory) all matching doc IDs + scores (if required). Those are later fed into several processes that operate on them (e.g. fetch more info from the index etc.). I am thinking, we can make CachingCollector optionally wrap another Collector and then someone can reuse it by setting RAM limit to unlimited (we should have a constant for that) in order to simply collect all matching docs + scores.
> {quote}
> But Mike had concerns about the RAM usage:
> {quote}
> I'd actually rather not have the constant – ie, I don't want to make
> it easy to be unlimited? It seems too dangerous... I'd rather your
> code has to spell out 10*1024 so you realize you're saying 10 GB (for
> example).
> {quote}
> My concern here is what happens when you dont specify enough, I think those hits are just silently dropped (which is worse than using lots of RAM).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4372) CachingCollector.create(boolean,
boolean, double) is trappy
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452078#comment-13452078 ]
Robert Muir commented on LUCENE-4372:
-------------------------------------
{quote}
But in the case where the user just wants to have the docs (+scores) cached, I agree it's useless to continue to delegate. The Collector just as well might throw an exception. To optimize it, we'll need to add an 'if' check, or create another specialized CachingCollector impl ... or continue to call the empty Collector impl, hoping the right thing will happen
{quote}
Do we? I think i'm just proposing to modify the existing 'if' check (if curDocs == null) to do nothing at all or to throw an exception earlier :)
> CachingCollector.create(boolean, boolean, double) is trappy
> -----------------------------------------------------------
>
> Key: LUCENE-4372
> URL: https://issues.apache.org/jira/browse/LUCENE-4372
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Robert Muir
>
> Followup to LUCENE-3102.
> Shai proposed a method that just caches all scores so they can be replayed:
> {quote}
> Do you think we can modify this Collector to not necessarily wrap another Collector? We have such Collector which stores (in-memory) all matching doc IDs + scores (if required). Those are later fed into several processes that operate on them (e.g. fetch more info from the index etc.). I am thinking, we can make CachingCollector optionally wrap another Collector and then someone can reuse it by setting RAM limit to unlimited (we should have a constant for that) in order to simply collect all matching docs + scores.
> {quote}
> But Mike had concerns about the RAM usage:
> {quote}
> I'd actually rather not have the constant – ie, I don't want to make
> it easy to be unlimited? It seems too dangerous... I'd rather your
> code has to spell out 10*1024 so you realize you're saying 10 GB (for
> example).
> {quote}
> My concern here is what happens when you dont specify enough, I think those hits are just silently dropped (which is worse than using lots of RAM).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4372) CachingCollector.create(boolean,
boolean, double) is trappy
Posted by "Shai Erera (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452087#comment-13452087 ]
Shai Erera commented on LUCENE-4372:
------------------------------------
bq. Do we? I think i'm just proposing to modify the existing 'if' check (if curDocs == null) to do nothing at all or to throw an exception earlier
I don't think so. That 'if' only indicates whether the RAM limit has been reached, and we don't cache anymore. But the collector doesn't know if the wrapped Collector needs to receive the documents that are still to be collected or not.
CachingCollector is an optimization. If you can spare 10 MB of cache, and you happen to execute queries that answer #documents that can be cached within that limit, then as in the case Yonik describes, you can execute the query once, collect the docs (by a real Collector) and cache them (CachingCollector) in order to replay to another Collector. If there wasn't enough RAM, you cannot use replay() (you'll hit IllegalStateEx).
The 'if' I was talking about adding is inside "if (cacheDocs == null)" to follow by an "if (collector == null)" and pass a null Collector from the create() that is not interested in wrapping a Collector.
> CachingCollector.create(boolean, boolean, double) is trappy
> -----------------------------------------------------------
>
> Key: LUCENE-4372
> URL: https://issues.apache.org/jira/browse/LUCENE-4372
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Robert Muir
>
> Followup to LUCENE-3102.
> Shai proposed a method that just caches all scores so they can be replayed:
> {quote}
> Do you think we can modify this Collector to not necessarily wrap another Collector? We have such Collector which stores (in-memory) all matching doc IDs + scores (if required). Those are later fed into several processes that operate on them (e.g. fetch more info from the index etc.). I am thinking, we can make CachingCollector optionally wrap another Collector and then someone can reuse it by setting RAM limit to unlimited (we should have a constant for that) in order to simply collect all matching docs + scores.
> {quote}
> But Mike had concerns about the RAM usage:
> {quote}
> I'd actually rather not have the constant – ie, I don't want to make
> it easy to be unlimited? It seems too dangerous... I'd rather your
> code has to spell out 10*1024 so you realize you're saying 10 GB (for
> example).
> {quote}
> My concern here is what happens when you dont specify enough, I think those hits are just silently dropped (which is worse than using lots of RAM).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4372) CachingCollector.create(boolean,
boolean, double) is trappy
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452057#comment-13452057 ]
Robert Muir commented on LUCENE-4372:
-------------------------------------
Thanks Shai, i missed this exception in replay() !
We can cancel the issue: I don't have any concerns if you are gonna get an exception.
> CachingCollector.create(boolean, boolean, double) is trappy
> -----------------------------------------------------------
>
> Key: LUCENE-4372
> URL: https://issues.apache.org/jira/browse/LUCENE-4372
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Robert Muir
>
> Followup to LUCENE-3102.
> Shai proposed a method that just caches all scores so they can be replayed:
> {quote}
> Do you think we can modify this Collector to not necessarily wrap another Collector? We have such Collector which stores (in-memory) all matching doc IDs + scores (if required). Those are later fed into several processes that operate on them (e.g. fetch more info from the index etc.). I am thinking, we can make CachingCollector optionally wrap another Collector and then someone can reuse it by setting RAM limit to unlimited (we should have a constant for that) in order to simply collect all matching docs + scores.
> {quote}
> But Mike had concerns about the RAM usage:
> {quote}
> I'd actually rather not have the constant – ie, I don't want to make
> it easy to be unlimited? It seems too dangerous... I'd rather your
> code has to spell out 10*1024 so you realize you're saying 10 GB (for
> example).
> {quote}
> My concern here is what happens when you dont specify enough, I think those hits are just silently dropped (which is worse than using lots of RAM).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4372) CachingCollector.create(boolean,
boolean, double) is trappy
Posted by "Shai Erera (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452075#comment-13452075 ]
Shai Erera commented on LUCENE-4372:
------------------------------------
bq. Thanks Shai, i missed this exception in replay() !
Hmm, I didn't even noticed it. I was referring plainly to the class javadocs. That exception is even better ! :)
(In my response, I was against throwing an exception during collect(), but during replay() it's fair)
{quote}
btw: what confuses me is what happens in the "run-out-of-ram" case,
why do we even bother collecting the overflow'd docs here (other.collect)?
{quote}
You mean in the flow where the user called CachingCollector.create(boolean, boolean, double), right? Because this class can just wrap another Collector (see other create()), in which case you'd want to delegate the calls to (you don't know what the Collector is).
But in the case where the user just wants to have the docs (+scores) cached, I agree it's useless to continue to delegate. The Collector just as well might throw an exception. To optimize it, we'll need to add an 'if' check, or create another specialized CachingCollector impl ... or continue to call the empty Collector impl, hoping the right thing will happen :).
> CachingCollector.create(boolean, boolean, double) is trappy
> -----------------------------------------------------------
>
> Key: LUCENE-4372
> URL: https://issues.apache.org/jira/browse/LUCENE-4372
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Robert Muir
>
> Followup to LUCENE-3102.
> Shai proposed a method that just caches all scores so they can be replayed:
> {quote}
> Do you think we can modify this Collector to not necessarily wrap another Collector? We have such Collector which stores (in-memory) all matching doc IDs + scores (if required). Those are later fed into several processes that operate on them (e.g. fetch more info from the index etc.). I am thinking, we can make CachingCollector optionally wrap another Collector and then someone can reuse it by setting RAM limit to unlimited (we should have a constant for that) in order to simply collect all matching docs + scores.
> {quote}
> But Mike had concerns about the RAM usage:
> {quote}
> I'd actually rather not have the constant – ie, I don't want to make
> it easy to be unlimited? It seems too dangerous... I'd rather your
> code has to spell out 10*1024 so you realize you're saying 10 GB (for
> example).
> {quote}
> My concern here is what happens when you dont specify enough, I think those hits are just silently dropped (which is worse than using lots of RAM).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4372) CachingCollector.create(boolean,
boolean, double) is trappy
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452060#comment-13452060 ]
Robert Muir commented on LUCENE-4372:
-------------------------------------
btw: what confuses me is what happens in the "run-out-of-ram" case,
why do we even bother collecting the overflow'd docs here (other.collect)?
{code}
if (curDocs == null) {
// Cache was too large
cachedScorer.score = scorer.score();
cachedScorer.doc = doc;
other.collect(doc);
return;
}
{code}
> CachingCollector.create(boolean, boolean, double) is trappy
> -----------------------------------------------------------
>
> Key: LUCENE-4372
> URL: https://issues.apache.org/jira/browse/LUCENE-4372
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Robert Muir
>
> Followup to LUCENE-3102.
> Shai proposed a method that just caches all scores so they can be replayed:
> {quote}
> Do you think we can modify this Collector to not necessarily wrap another Collector? We have such Collector which stores (in-memory) all matching doc IDs + scores (if required). Those are later fed into several processes that operate on them (e.g. fetch more info from the index etc.). I am thinking, we can make CachingCollector optionally wrap another Collector and then someone can reuse it by setting RAM limit to unlimited (we should have a constant for that) in order to simply collect all matching docs + scores.
> {quote}
> But Mike had concerns about the RAM usage:
> {quote}
> I'd actually rather not have the constant – ie, I don't want to make
> it easy to be unlimited? It seems too dangerous... I'd rather your
> code has to spell out 10*1024 so you realize you're saying 10 GB (for
> example).
> {quote}
> My concern here is what happens when you dont specify enough, I think those hits are just silently dropped (which is worse than using lots of RAM).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (LUCENE-4372) CachingCollector.create(boolean,
boolean, double) is trappy
Posted by "Robert Muir (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-4372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452095#comment-13452095 ]
Robert Muir commented on LUCENE-4372:
-------------------------------------
{quote}
CachingCollector is an optimization. If you can spare 10 MB of cache, and you happen to execute queries that answer #documents that can be cached within that limit, then as in the case Yonik describes, you can execute the query once, collect the docs (by a real Collector) and cache them (CachingCollector) in order to replay to another Collector. If there wasn't enough RAM, you cannot use replay() (you'll hit IllegalStateEx).
{quote}
Right but then when we run out of cache, shouldnt we dumping the existing cache to the underlying collector first? What am I missing?
it seems to me we just throw away the cache completely and then start collecting, thats why it doesnt make a lot of sense to me:
{noformat}
if (nextLength <= 0) {
// Too many docs to collect -- clear cache
curDocs = null;
cachedSegs.clear();
cachedDocs.clear();
other.collect(doc);
return;
}
{noformat}
> CachingCollector.create(boolean, boolean, double) is trappy
> -----------------------------------------------------------
>
> Key: LUCENE-4372
> URL: https://issues.apache.org/jira/browse/LUCENE-4372
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Robert Muir
>
> Followup to LUCENE-3102.
> Shai proposed a method that just caches all scores so they can be replayed:
> {quote}
> Do you think we can modify this Collector to not necessarily wrap another Collector? We have such Collector which stores (in-memory) all matching doc IDs + scores (if required). Those are later fed into several processes that operate on them (e.g. fetch more info from the index etc.). I am thinking, we can make CachingCollector optionally wrap another Collector and then someone can reuse it by setting RAM limit to unlimited (we should have a constant for that) in order to simply collect all matching docs + scores.
> {quote}
> But Mike had concerns about the RAM usage:
> {quote}
> I'd actually rather not have the constant – ie, I don't want to make
> it easy to be unlimited? It seems too dangerous... I'd rather your
> code has to spell out 10*1024 so you realize you're saying 10 GB (for
> example).
> {quote}
> My concern here is what happens when you dont specify enough, I think those hits are just silently dropped (which is worse than using lots of RAM).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org