Skip to content

Commit

Permalink
Item14707: improve relevancy sorting
Browse files Browse the repository at this point in the history
Item14693: depend on new TopicTitlePlugin
  • Loading branch information
MichaelDaum committed Jun 7, 2018
1 parent 8d7a508 commit faf51fe
Show file tree
Hide file tree
Showing 48 changed files with 2,479 additions and 1,876 deletions.
121 changes: 64 additions & 57 deletions data/System/SolrPlugin.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1515499594" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1528368504" format="1.1" version="1"}%
---+ Solr Plugin
%FORMFIELD{"Description"}%

Expand Down Expand Up @@ -692,8 +692,8 @@ useful for spatial search.
| *Name* | *Type* | *Multivalued* | *Stored* | *Description* |
| access_granted | string | multivalued | | this field controls access of users to this topic or attachment in the search index; every query is augmented with an ACL check against this field; only users listed in this field are allowed view rights; special value is "all" when there are no view restrictions |
| attachment | string | multivalued | stored | list of all attachment names of this topic |
| author | string | | stored | the name of the user that changed the document most recently |
| author_url | string | | stored | the url of the user that changed the document most recently |
| author | string | | stored | the name of the person that changed the document most recently |
| author_title | string | | stored | title name of the person that changed the document most recently |
| catchall | text_generic | multivalued | stored | copy-field that gathers content from (allmost) all fields; this is the default search field for the "standard" query parser; note that fields to be queried can be configured per request using the "dismax" handler |
| category | string | multivalued | stored | list of categories this document is in; note: this field will only be used if Foswiki:Extensions/ClassificationPlugin is installed; it will populate it with the list of all categories up to !TopCategory; content of this field is copied to =category_search= as well (see generic fields below) |
| comment | text_generic | | stored | comment field of an attachment |
Expand All @@ -705,6 +705,7 @@ useful for spatial search.
| container_web | string | | stored | web of containing document |
| contributor | string | multivalued | stored | list of users that contributed to this topic at some point in time |
| createauthor | string | | stored | author of the initial version of this document |
| createauthor_title | string | | stored | title name of the initial author of this document |
| createdate | tdate | | stored | date when the initial version of this document was created |
| date | tdate | | stored | time the the document was changed last |
| form | string | | stored | name of the form attached to the current topic |
Expand Down Expand Up @@ -792,72 +793,70 @@ to be indexed is created by the crawler and indexer explicitly, some more are cr
specific search applications. The destination fields are then analysed using the dynamic field definitions as given above.

| *Source* | *Destination* |
| web | web_sort |
| topic | topic_sort |
| title | title_sort |
| category | category_search |
| tag | tag_search |
| title | title_search |
| topic | topic_search |
| web | web_search |
| webtopic | webtopic_search |
| attachment | catchall |
| attachment | charnorm |
| attachment | phonetic |
| attachment | spell |
| category | catchall |
| category | category_search |
| category | charnorm |
| category | phonetic |
| comment | catchall |
| comment | charnorm |
| comment | phonetic |
| comment | spell |
| concept | catchall |
| concept | charnorm |
| concept | phonetic |
| concept | spell |
| field_* | catchall |
| field_* | charnorm |
| field_* | phonetic |
| field_* | spell |
| form | catchall |
| form | charnorm |
| form | phonetic |
| form | spell |
| name | catchall |
| name | charnorm |
| name | phonetic |
| name | spell |
| tag | catchall |
| tag | charnorm |
| tag | phonetic |
| tag | tag_search |
| text | catchall |
| title | catchall |
| topic | catchall |
| type | catchall |
| state | catchall |
| attachment | text_prefix |
| category | text_prefix |
| comment | text_prefix |
| contributor | text_prefix |
| field_* | text_prefix |
| form | text_prefix |
| name | text_prefix |
| tag | text_prefix |
| text | charnorm |
| text | phonetic |
| text | spell |
| text | text_prefix |
| title | text_prefix |
| topic | text_prefix |
| type | text_prefix |
| attachment | text_suffix |
| category | text_suffix |
| comment | text_suffix |
| contributor | text_suffix |
| field_* | text_suffix |
| form | text_suffix |
| name | text_suffix |
| tag | text_suffix |
| text | text_std |
| text | text_suffix |
| title | text_suffix |
| topic | text_suffix |
| type | text_suffix |
| attachment | phonetic |
| category | phonetic |
| comment | phonetic |
| contributor | phonetic |
| field_* | phonetic |
| form | phonetic |
| name | phonetic |
| tag | phonetic |
| text | phonetic |
| title | catchall |
| title | charnorm |
| title | phonetic |
| topic | phonetic |
| type | phonetic |
| attachment | spell |
| comment | spell |
| field_* | spell |
| form | spell |
| name | spell |
| text | spell |
| title | spell |
| title | title_first_letter |
| title | title_prefix |
| title | title_search |
| title | title_sort |
| title | title_std |
| title | title_suffix |
| topic | catchall |
| topic | charnorm |
| topic | phonetic |
| topic | spell |
| topic | topic_search |
| topic | topic_sort |
| topic | topic_std |
| type | catchall |
| type | charnorm |
| type | phonetic |
| web | spell |
| webtopic | webtopic_search |
| web | web_search |
| web | web_sort |
| web | web_std |

<verbatim class="foswikiHidden">
---++ Templates
Expand All @@ -874,6 +873,14 @@ specific search applications. The destination fields are then analysed using the

---++ Change History
%TABLE{columnwidths="7em" tablewidth="100%"}%
| 07 Jun 2018: | new index fields =author_title=, =createauthor_title=, =title_first_letter=; \
added support indexing arbitrary [[Foswiki:Extensions/MetaDataPlugin][meta data]]; \
added support for [[Foswiki:Extensions/ListyPlugin][ListyPlugin]]; \
added toggle "exact search" to search interface; \
depending on new [[Foswiki:Extensions/TopicTitlePlugin][TopicTitlePlugin]] now; \
fixed keyboard interaction of autosuggest box; \
fixed sorting facet values by title; \
much improved relavancy sorting |
| 09 Jan 2018: | added support for jquery.i18n; improved solr schema for better findability; fixed solr sidebar in subwebs |
| 18 Sep 2017: | replacing =text_substring= with =text_prefix= and =text_suffix= to improve substring matching; \
truncate document values larger than 32k to prevent solr from crashing; \
Expand Down Expand Up @@ -1001,5 +1008,5 @@ specific search applications. The destination fields are then analysed using the
%META:FIELD{name="License" title="License" value="GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]])"}%
%META:FIELD{name="Home" title="Home" value="Foswiki:Extensions/SolrPlugin"}%
%META:FIELD{name="Support" title="Support" value="Foswiki:Support/SolrPlugin"}%
%META:FILEATTACHMENT{name="SolrPluginSnap1.png" attr="" comment="" date="1515499594" size="93552" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="SolrPluginSnap2.png" attr="" comment="" date="1515499594" size="158013" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="SolrPluginSnap1.png" attr="" comment="" date="1528368504" size="93552" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="SolrPluginSnap2.png" attr="" comment="" date="1528368504" size="158013" user="ProjectContributor" version="1"}%
65 changes: 49 additions & 16 deletions data/System/SolrSearchBaseTemplate.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1505725909" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1528368504" format="1.1" version="1"}%
%META:TOPICPARENT{name="SolrPlugin"}%
%{<verbatim class="tml">}%
%{ ###########################################################################
Expand Down Expand Up @@ -127,6 +127,7 @@
%TMPL:P{"solr::templates::facetfield"}%
%TMPL:P{"solr::templates::currentselection"}%
%TMPL:P{"solr::templates::togglefacet"}%
%TMPL:P{"solr::templates::toggle"}%
%TMPL:P{"solr::templates::tagcloud"}%
%TMPL:P{"solr::templates::hierarchy"}%
%TMPL:P{"solr::templates::resultsperpage"}%
Expand All @@ -144,6 +145,7 @@
%TMPL:P{"solr::templates::hits::topic"}%<!-- -->
%TMPL:P{"solr::templates::hits::image"}%<!-- -->
%TMPL:P{"solr::templates::hits::comment"}%<!-- -->
%TMPL:P{"solr::templates::hits::listy"}%<!-- -->
%TMPL:P{"solr::templates::hits::misc"}%<!-- -->
%TMPL:P{"solr::templates::hits::ClassifiedTopic"}%<!-- -->
<script id="solrHitTemplate" type="text/x-jsrender">
Expand Down Expand Up @@ -174,7 +176,7 @@
</span>
</h3>
<div class='solrRevision'>
{{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author}}
{{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author_title}}
</div>
%TMPL:P{"solr::thumbnail"}%
<div class='solrHilite'>
Expand All @@ -200,7 +202,7 @@
</span>
</h3>
<div class='solrRevision'>
{{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author}}
{{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author_title}}
</div>
%TMPL:P{"solr::thumbnail"}%
<div class='solrHilite'>
Expand All @@ -226,15 +228,15 @@
</span>
</h3>
<div class='solrRevision'>
{{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author}}
{{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author_title}}
</div>
</div>
</script>%TMPL:END%
%{</verbatim>}%

%{<verbatim class="tml">}%
%TMPL:DEF{"solr::templates::hits::comment"}%<script id="solrHitTemplate_comment" type="text/x-jsrender">
<div class='solrSearchHit solrCommentHit'>
<div class='solrSearchHit solrCommentHit clearfix'>
<h3>
<i class='solrHitIcon foswikiIcon jqIcon fa {{if icon}}{{:icon}}{{else}}fa-file-o{{/if}}'></i>
<a href='{{:url}}'>{{:title}}</a>
Expand All @@ -243,7 +245,7 @@
</span>
</h3>
<div class='solrRevision'>
{{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author}}
{{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author_title}}
</div>
<div class='solrHilite'>
{{:~getHilite(id)}}
Expand All @@ -252,18 +254,39 @@
</script>%TMPL:END%
%{</verbatim>}%

%{<verbatim class="tml">}%
%TMPL:DEF{"solr::templates::hits::listy"}%<script id="solrHitTemplate_listy" type="text/x-jsrender">
<div class='solrSearchHit solrListyHit clearfix'>
<h3>
<i class='solrHitIcon foswikiIcon jqIcon fa {{if icon}}{{:icon}}{{else}}fa-file-o{{/if}}'></i>
<a href='{{:url}}'>{{:title}}</a>
<span class='foswikiGrayText foswikiNormal solrContainerLink'>
%MAKETEXT{"in [_1]" args="<a href='{{:container_url}}'>{{:container_title}}</a>"}%
</span>
</h3>
<div class='solrRevision'>
{{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author_title}}
</div>
<div class='solrHilite'>
{{:~getHilite(id)}}
</div>
</div>
</script>%TMPL:END%
%{</verbatim>}%


%{<verbatim class="tml">}%
%TMPL:DEF{"solr::templates::hits::misc"}%<script id="solrHitTemplate_misc" type="text/x-jsrender">
<div class='solrSearchHit solrAttachmentHit'>
<div class='solrSearchHit solrMiscHit clearfix'>
<h3>
<i class='solrHitIcon foswikiIcon jqIcon fa {{if icon}}{{:icon}}{{else}}fa-file-o{{/if}}'></i>
<a href='{{:url}}'>{{:name}}</a>
<a href='{{:url}}'>{{:title}}</a>
<span class='foswikiGrayText foswikiNormal solrContainerLink' >
%MAKETEXT{"in [_1]" args="<a href='{{:container_url}}'>{{:container_title}}</a>"}%
</span>
</h3>
<div class='solrRevision'>
{{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author}}
{{:~formatDate(date,'%TMPL:P{"solr::dateformat"}%')}}, {{:author_title}}
</div>
<div class='solrHilite'>
{{:~getHilite(id)}}
Expand Down Expand Up @@ -319,6 +342,13 @@
</script>%TMPL:END%
%{</verbatim>}%

%{<verbatim class="tml">}%
%TMPL:DEF{"solr::templates::toggle"}%<script id="solrToggleTemplate" type="text/x-jsrender">
<input type='checkbox' class='foswikiCheckbox' id='{{:id}}' />
<label class='foswikiLabel' for='{{:id}}'>{{:title}}</label>
</script>%TMPL:END%
%{</verbatim>}%

%{<verbatim class="tml">}%
%TMPL:DEF{"solr::templates::tagcloud"}%<script id="solrTagCloudTemplate" type="text/x-jsrender">
{{:group}}<span style='font-size:{{:weight}}px'><a href='#' title='{{:count}}' style='color:{{:color}};' class='solrFacetValue {{:current}} tag_{{:facet}}'>{{:facet}}</a> </span>
Expand Down Expand Up @@ -518,12 +548,6 @@
title="%MAKETEXT{"Language"}%"
hidefilter="true"
}%
%TMPL:P{"solr::facet"
id="author"
exclude="UnknownUser|AdminUser|RegistrationAgent|AdminGroup|WikiGuest|FoswikiContributor|ProjectContributor|TestUser"
title="%MAKETEXT{"Author"}%"
hidefilter="true"
}%
<!-- -->%TMPL:END%
%{</verbatim>}%

Expand Down Expand Up @@ -754,7 +778,7 @@
else="$percntTMPL:P{\"solr::input::checkboxes::inallwebs\"}$percnt"
}%<!-- -->
%TMPL:P{"solr::input::checkboxes::inweb"}%<!-- -->
%TMPL:P{"solr::input::checkboxes::inmycontribs"}%<!-- -->
%TMPL:P{"solr::input::checkboxes::exactsearch"}%<!-- -->
</div>%TMPL:END%
%{</verbatim>}%

Expand Down Expand Up @@ -785,6 +809,15 @@
<!-- -->%TMPL:END%
%{</verbatim>}%

%{<verbatim class="tml">}%
%{ ###########################################################################
solr::input::checkboxes::exactsearch - display a "Exact Search" checkbox
}%
%TMPL:DEF{"solr::input::checkboxes::exactsearch"}%<!-- -->
<span class='solrToggle' data-field='qf' data-value='title_std^7 catchall' data-title='%MAKETEXT{"Exact search"}%'></span>
<!-- -->%TMPL:END%
%{</verbatim>}%

%{<verbatim class="tml">}%
%{ ###########################################################################
solr::tagcloudstep - part of the solr::searchform. this contains the tagcloud facet
Expand Down
6 changes: 4 additions & 2 deletions data/System/SolrWikiUsersViewTemplate.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1505725909" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1528368504" format="1.1" version="1"}%
%META:TOPICPARENT{name="WebHome"}%
%{<verbatim class="tml">}%
%TMPL:INCLUDE{"SolrSearchView"}%
Expand All @@ -10,10 +10,12 @@
%{</verbatim>}%

%{<verbatim class="tml">}%
%TMPL:DEF{"solr::defaultrows"}%18%TMPL:END%
%TMPL:DEF{"solr::defaultrows"}%9%TMPL:END%
%TMPL:DEF{"solr::defaultsort"}%title_sort asc%TMPL:END%
%TMPL:DEF{"solr::extrafilter"}%form:%QUERY{"{SolrPlugin}{PersonDataForm}"}% web:%USERSWEB%%TMPL:END%
%TMPL:DEF{"solr::fields"}%field_Location_s, field_Profession_s, field_Email_s, field_LoginName_s, field_Telephone_s, web, topic, title, thumbnail%TMPL:END%
%TMPL:DEF{"DISsolr::pager"}%<div class='solrAlphaPager' data-field="title_first_letter" data-title="%MAKETEXT{"alphabetical"}%" data-all-text="%MAKETEXT{"All"}%" ></div>%TMPL:END%
%TMPL:DEF{"DISsolr::footer"}%<div class='solrFooter'></div>%TMPL:END%
%{</verbatim>}%

%{<verbatim class="tml">}%
Expand Down
6 changes: 3 additions & 3 deletions lib/Foswiki/Plugins/SolrPlugin.pm
Expand Up @@ -30,9 +30,9 @@ BEGIN {
}
}

our $VERSION = '6.10';
our $RELEASE = '09 Jan 2018';
our $SHORTDESCRIPTION = 'Enterprise Search Engine for Foswiki based on [[http://lucene.apache.org/solr/][Solr]]';
our $VERSION = '7.00';
our $RELEASE = '07 Jun 2018';
our $SHORTDESCRIPTION = 'Enterprise Search Engine for Foswiki based on Solr';
our $NO_PREFS_IN_TOPIC = 1;
our %searcher;
our %indexer;
Expand Down

0 comments on commit faf51fe

Please sign in to comment.