[
https://issues.apache.org/jira/browse/SOLR-1680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12874524#action_12874524
]
Jan Kurella edited comment on SOLR-1680 at 6/2/10 6:23 AM:
-----------------------------------------------------------
the "streamlining" could be done in simple approach?
It seems to be quite simple according to the linked ticket.
The codephrase
{code:java}
if( timeAllowed > 0 ) {
collector = new TimeLimitingCollector(collector, timeAllowed);
}
try {
super.search(query, luceneFilter, collector);
}
catch( TimeLimitingCollector.TimeExceededException x ) {
log.warn( "Query: " + query + "; " + x.getMessage() );
qr.setPartialResults(true);
}
{code}
is spread several times over the SolrIndexSearcher.
It should be enough to put this in a separate function and wrap the collector
with any custom collector here (in one place):
{code:java}
private Collector doSearch(neededParams)
if( timeAllowed > 0 ) {
collector = new TimeLimitingCollector(collector, timeAllowed);
}
if( customCollector != null) {
customCollector.setInnerCollector(collector);
collector = customCollector
}
try {
super.search(query, luceneFilter, collector);
}
catch( TimeLimitingCollector.TimeExceededException x ) {
log.warn( "Query: " + query + "; " + x.getMessage() );
qr.setPartialResults(true);
}
}
{code}
And custom collector needs to be retrieved by the whatever plugin concept.
??
was (Author: kurellajunior):
the "streamlining" could be done in simple approach?
It seems to be quite simple according to the linked ticket.
The codephrase
<code>
if( timeAllowed > 0 ) {
collector = new TimeLimitingCollector(collector, timeAllowed);
}
try {
super.search(query, luceneFilter, collector);
}
catch( TimeLimitingCollector.TimeExceededException x ) {
log.warn( "Query: " + query + "; " + x.getMessage() );
qr.setPartialResults(true);
}
</code>
is spread several times over the SolrIndexSearcher.
It should be enough to put this in a separate function and wrap the collector
with any custom collector here (in one place):
<code>
private Collector doSearch(neededParams)
if( timeAllowed > 0 ) {
collector = new TimeLimitingCollector(collector, timeAllowed);
}
if( customCollector != null) {
customCollector.setInnerCollector(collector);
collector = customCollector
}
try {
super.search(query, luceneFilter, collector);
}
catch( TimeLimitingCollector.TimeExceededException x ) {
log.warn( "Query: " + query + "; " + x.getMessage() );
qr.setPartialResults(true);
}
}
</code>
And custom collector needs to be retrieved by the whatever plugin concept.
??
> Provide an API to specify custom Collectors
> -------------------------------------------
>
> Key: SOLR-1680
> URL: https://issues.apache.org/jira/browse/SOLR-1680
> Project: Solr
> Issue Type: Sub-task
> Components: search
> Affects Versions: 1.3
> Reporter: Martijn van Groningen
> Fix For: Next
>
> Attachments: field-collapse-core.patch, SOLR-1680.patch
>
>
> The issue is dedicated to incorporate fieldcollapse's changes to the Solr's
> core code.
> We want to make it possible for components to specify custom Collectors in
> SolrIndexSearcher methods.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]