Changes for page Solr Search Macros
Last modified by Administrator on 2025/09/06 09:59
From version
2.1


edited by Administrator
on 2019/11/04 23:53
on 2019/11/04 23:53
Change comment:
Install extension [org.xwiki.platform:xwiki-platform-search-solr-ui/10.11.9]
To version 1.1

edited by Administrator
on 2018/07/24 00:25
on 2018/07/24 00:25
Change comment:
Install extension [org.xwiki.platform:xwiki-platform-search-solr-ui/9.11.7]
Summary
Details
- Page properties
-
- Content
-
... ... @@ -576,10 +576,7 @@ 576 576 #set ($discard = $query.setLimit($rows)) 577 577 #set ($discard = $query.setOffset($start)) 578 578 #set ($discard = $query.bindValue('sort', "${sort} ${sortOrder}")) 579 - #set ($discard = $query.bindValue('tie', $solrConfig.tieBreaker)) 580 - #set ($discard = $query.bindValue('mm', $solrConfig.minShouldMatch)) 581 581 #setQueryFields($query) 582 - #setPhraseFields($query) 583 583 #setFacetFields($query) 584 584 #setFilterQuery($query) 585 585 #setHighlightQuery($query) ... ... @@ -607,55 +607,6 @@ 607 607 #set ($discard = $query.bindValue('qf', $boost)) 608 608 #end 609 609 #end 610 - 611 -#macro (setPhraseFields $query) 612 - ## Set the main phrase field parameter boosts so that queries with all search terms 613 - ## in close proximity have high relevance 614 - #if ($solrConfig.phraseFields.substring(0, 0) == '') 615 - ## If the value of the 'phraseFields' parameter is a string then it means that the 616 - ## same query fields are used for all result types. 617 - #set ($phraseFieldsBoost = $solrConfig.phraseFields) 618 - #else 619 - ## There are different phrase fields for each result type. 620 - ## Including type = null, which will result from all facets being deselected 621 - #set ($phraseFieldsBoost = $solrConfig.phraseFields.get("$!type")) 622 - #end 623 - #if ("$!phraseFieldsBoost" != '') 624 - #set ($discard = $query.bindValue('pf', $phraseFieldsBoost)) 625 - #set ($discard = $query.bindValue('ps', $solrConfig.phraseFieldSlop)) 626 - #end 627 - ## Set the bigram phrase field parameter boosts so that queries with groups of two 628 - ## search terms in close proximity have high relevance 629 - #if ($solrConfig.bigramPhraseFields.substring(0, 0) == '') 630 - ## If the value of the 'bigramPhraseFields' parameter is a string then it means that the 631 - ## same query fields are used for all result types. 632 - #set ($bigramPhraseFieldsBoost = $solrConfig.bigramPhraseFields) 633 - #else 634 - ## There are different phrase fields for each result type. 635 - ## Including type = null, which will result from all facets being deselected 636 - #set ($bigramPhraseFieldsBoost = $solrConfig.bigramPhraseFields.get("$!type")) 637 - #end 638 - #if ("$!bigramPhraseFieldsBoost" != '') 639 - #set ($discard = $query.bindValue('pf2', $bigramPhraseFieldsBoost)) 640 - #set ($discard = $query.bindValue('ps2', $solrConfig.bigramPhraseFieldSlop)) 641 - #end 642 - ## Set the trigram phrase field parameter boosts so that queries with groups of three 643 - ## search terms in close proximity have high relevance. 644 - ## Generally (pf boost) > (pf3 boost) > (pf2 boost) 645 - #if ($solrConfig.trigramPhraseFields.substring(0, 0) == '') 646 - ## If the value of the 'trigramPhraseFields' parameter is a string then it means that the 647 - ## same query fields are used for all result types. 648 - #set ($trigramPhraseFieldsBoost = $solrConfig.trigramPhraseFields) 649 - #else 650 - ## There are different phrase fields for each result type. 651 - ## including type = null, which will result from all facets being deselected 652 - #set ($trigramPhraseFieldsBoost = $solrConfig.trigramPhraseFields.get("$!type")) 653 - #end 654 - #if ("$!trigramPhraseFieldsBoost" != '') 655 - #set ($discard = $query.bindValue('pf3', $trigramPhraseFieldsBoost)) 656 - #set ($discard = $query.bindValue('ps3', $solrConfig.trigramPhraseFieldSlop)) 657 - #end 658 -#end 659 659 660 660 #macro (setFacetFields $query) 661 661 #set ($discard = $query.bindValue('facet', $facetEnabled)) ... ... @@ -779,11 +779,11 @@ 779 779 #end 780 780 ## 781 781 ## Pagination 782 - #set ($rows = $m athtool.toInteger($request.rows))730 + #set ($rows = $numbertool.integer($request.rows)) 783 783 #if ("$!rows" == '') 784 784 #set ($rows = 10) 785 785 #end 786 - #set ($start = $m athtool.toInteger($request.firstIndex))734 + #set ($start = $numbertool.integer($request.firstIndex)) 787 787 #if ("$!start" == '') 788 788 #set ($start = 0) 789 789 #end