Created
October 27, 2013 19:53
-
-
Save everdaniel/7187184 to your computer and use it in GitHub Desktop.
Return Low Search results as JSON
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
{exp:low_search:results query="{segment_3}" limit="10"} | |
{if count == 1} | |
"search_keywords": "{low_search_keywords}", | |
"total_results": {total_results}, | |
{/if} | |
{if count == 1} | |
"results": [ | |
{/if} | |
{ | |
"title": "{title}", | |
"excerpt": "{low_search_excerpt}", | |
"url": {if low_search_collection_name == 'services'}"{path='{low_search_collection_name}/{categories}{category_url_title}{/categories}/{url_title}'}"{if:else}"{path='{low_search_collection_name}/{url_title}'}"{/if} | |
} | |
{if count != total_results},{/if} | |
{if count == total_results} | |
] | |
{/if} | |
{if no_results} | |
"results_found": false | |
{if:else} | |
"results_found": true | |
{/if} | |
{/exp:low_search:results} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment