Changeset 32110 for main/trunk


Ignore:
Timestamp:
01/24/18 20:46:30 (3 years ago)
Author:
ak19
Message:

Forgot to commit bugfix. The bug was that when searching a solr collection, if you switch on a facet containing an apostrophe (try searching solr-demo for query term farm and then selecting the facet with apostrophe), there are 0 search results displayed for that facet despite the facet listing a positive number of matching docs for it. 1. Greenstone3SearchHandler.java and facet-scripts.js contain the fix. 2. GS2SolrSearch.java and SolrQueryWrapper.java just contain further debug statements, some commented out.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/facet-scripts.js

    r30771 r32110  
    2828        for(var i = 0; i < counts.length; i++)
    2929        {
    30             countsStringBuffer += "\"" + encodeURI(counts[i]) + "\"";
     30            // escape any apostrophes in facet query terms
     31            // (ext/solr's Greenstone3SearchHandler does the other half of handling them)
     32            countsStringBuffer += "\"" + encodeURI(counts[i]).replace(/'/g, "%2527") + "\"";
    3133            if(i < counts.length - 1)
    3234            {
     
    3941   
    4042    console.log("STRING IS " + countsString)
    41    
     43   
    4244    $.ajax(gs.xsltParams.library_name + "/collection/" + gs.cgiParams.c + "/search/" + gs.cgiParams.s + "?" + searchString + countsString + "excerptid=resultsArea")
    4345        .done(function(response)
Note: See TracChangeset for help on using the changeset viewer.