• Resolved inkypaper

    (@inkypaper)


    Search not working and redirects to main page. I tried this plugin for caching search and I believe it once worked before but not now. and I couldn’t integrate search services like google or algolia on my localhost. Also inside my theme I have search.php that links to another php file.
    https://wordpress.org/plugins/wp-static-search/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter inkypaper

    (@inkypaper)

    If I create a search page with shortcode of wp-static-search, everything loads in static except 3 files…. which are….worker.js which should load 2 lunr files and is supposed to load from search.js through these lines…

    function onWorkerMessage(e) {
        if (e.data.allowSearch) {
            initSearch();
        } else if (e.data.results) {
            var results = e.data.results;
            displayResults(results);
        } else if (e.data.config) {
            // min_search_length = e.data.config.min_search_length-1;
        }
    }
    
    if (!window.Worker) {
        console.log('Web Worker API not supported');
        // load index in main thread
        affixScriptToHead(appStaticSearch.siteUrl + "/wp-content/plugins/wp-static-search/js/worker.js?ver=0.0.1").done(function () {
            console.log('Loaded worker');
            init(appStaticSearch.indexVersion);
            window.postMessage = function (msg) {
                onWorkerMessage({data: msg});
            };
        }).fail(function (jqxhr, settings, exception) {
            console.error('Could not load worker.js');
        });
    } else {
        // Wrap search in a web worker
        searchWorker = new Worker(appStaticSearch.siteUrl + "/wp-content/plugins/wp-static-search/js/worker.js?ver=0.0.1");
        searchWorker.postMessage({init: {version: appStaticSearch.indexVersion}});
        searchWorker.onmessage = onWorkerMessage;
    Thread Starter inkypaper

    (@inkypaper)

    The static search worked on a host. (opening files in browser didn’t work).
    and I found fix for broken links in support of the plugin.
    https://wordpress.org/support/topic/fix-for-broken-links-in-search-results/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Search’ is closed to new replies.