[ 
https://issues.apache.org/jira/browse/SOLR-5730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15113257#comment-15113257
 ] 

Christine Poerschke commented on SOLR-5730:
-------------------------------------------

*Any thoughts on how crucial support for the enable attribute is in the 
solrconfig.xml element?*
{noformat}
<sortMerges enable="true">popularity desc, timestamp desc</sortMerges>
{noformat}
_(In my opinion it is crucial for anyone wishing to use something like 
{{enable="$\{solr.sortMerges.enable:false\}"}} to easily transition to use a 
SortingMergePolicy.)_
\\
\\
*Any views on this alternative?*
{noformat}
<sortMerges enable="true">
  <str name="sort">popularity desc, timestamp desc</str>
</sortMerges>
{noformat}
_(In my opinion it's almost as user-friendly and if Lucene's 
SortingMergePolicy's constructor in future ever were to require an extra 
argument this could be accommodated in a straightforward way with an extra 
{{<int name="answer">42</int>}} element.)_
\\
\\
*Why the above questions?*
\\
\\
Implementation-wise it appears that primitive {{<some>string</some>}} elements 
have no support for attributes. At first glance it appears that we could in 
SolrIndexConfig.java creatively solve this with something like this:
{code}
  lockType=solrConfig.get(prefix+"/lockType", def.lockType);
  ...
  mergePolicyInfo = getPluginInfo(prefix + "/mergePolicy", solrConfig, 
def.mergePolicyInfo);
+ if (!solrConfig.readPluginInfos(prefix + "/sortMerges", false 
/*requireName*/, false /*requireClass*/).isEmpty()) {
+   sortMerges = solrConfig.get(prefix + "/sortMerges", def.sortMerges);
+ } else {
+   sortMerges = def.sortMerges;
+ }
{code}
However, on further consideration a map returned by {{SolrIndexConfig.toMap()}} 
would then not represent the complete solrconfig.xml element (any enable 
attribute in the primitive sortMerges element would be missing) i.e. 
{{<sortMerges enable="true">popularity desc, timestamp desc</sortMerges>}} 
would reduce down to {{"sortMerges" : "popularity desc, timestamp desc"}} in 
the map and {{<sortMerges enable="false">popularity desc, timestamp 
desc</sortMerges>}} would be absent from the map.

> make Lucene's SortingMergePolicy and EarlyTerminatingSortingCollector 
> configurable in Solr
> ------------------------------------------------------------------------------------------
>
>                 Key: SOLR-5730
>                 URL: https://issues.apache.org/jira/browse/SOLR-5730
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Christine Poerschke
>            Assignee: Christine Poerschke
>            Priority: Minor
>         Attachments: SOLR-5730-part1of2.patch, SOLR-5730-part2of2.patch
>
>
> *Example configuration (SortingMergePolicy):*
> solrconfig.xml
> {noformat}
> <useSortingMergePolicy>true</useSortingMergePolicy>
> {noformat}
> schema.xml
> {noformat}
> <mergeSortSpec>timestamp desc</mergeSortSpec>
> {noformat}
> *Example use (EarlyTerminatingSortingCollector):*
> {noformat}
> &sort=timestamp+desc&segmentTerminateEarly=true
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to