# Enable search field autocomplete/suggest
# Ajaxify the suggest/results
tx_meilisearch_suggest = PAGE
tx_meilisearch_suggest {
    typeNum = 7384
    config {
        disableAllHeaderCode = 1
        xhtml_cleaning = 0
        admPanel = 0
        additionalHeaders.10.header = Content-type: application/javascript
        no_cache = 0
        debug = 0
    }

    10 = USER
    10 {
        userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
        extensionName = Solr
        pluginName = pi_suggest
        vendorName = ApacheSolrForTypo3
        controller = Suggest
        action = suggest
    }
}

[globalString = GP:tx_meilisearch|callback = ]
    tx_meilisearch_suggest.config.additionalHeaders.10.header = Content-type: application/json
[global]

# Enable suggest
plugin.tx_meilisearch {
    suggest = 1
    suggest {
        numberOfSuggestions = 10
        suggestField = spell
    }
}

# Load js files
page.includeJSFooterlibs {
    solr-jquery = EXT:meilisearch/Resources/Public/JavaScript/JQuery/jquery.min.js
    solr-autocomplete = EXT:meilisearch/Resources/Public/JavaScript/JQuery/jquery.autocomplete.min.js
    solr-suggest = EXT:meilisearch/Resources/Public/JavaScript/suggest_controller.js
}

page.includeCSS {
    solr-suggest = EXT:meilisearch/Resources/Public/StyleSheets/Frontend/suggest.css
}
