Advanced Search Extension This extension contains functions for adding advanced search functionality. http://developer.mindtouch.com/App_Catalog/Advanced_Search advancedSearch form Embeds an advanced search form. Instance of the __request.args map (default: nil) Search query field name. (default: "search") Sets the value of the "located under" field. (default: nil) Publish on channel or a URI. (default: "") If set to "false" then no styles are inlined allowing custom styles. (default: "true")
Find results that have...
all these words:
any of these words: OR OR
been tagged with:
But also...
don't have these words:
is located under:
was authored by:
are only:
results Displays search results from the wiki.getSearch function. More functionality is enabled if inlined on a page. Search result map object returned from wiki.getSearch /* initialize searchResults with backward compat */ let searchResults = false; /* check if this is inlined in a page */ let isExtension = __env.__request ? false : true; /* sets the maximum number of search results to display when inlining code */ let numResults = 20; /* sets the length of the content preview when inlining code */ let previewLength = 255; if (isExtension) { let searchResults = args.results ?? false; } else { if (__request.args.prefix ?? false) { /* args.results should be generated by the following when invoking this code as a function */ let searchResults = wiki.getSearch(uri.decode(__request.args.prefix ?? ''), numResults, _, uri.decode(__request.args.suffix ?? '')); } } let html = ''; let html ..= '<h3>Search Results</h3>'; let html ..= '<div id="searchResults">'; if (searchResults) { if (#searchResults > 0) { let html ..= '<ul>'; foreach (var object in searchResults) { let html ..= '<li>'; if (object.path) { let html ..= '<div class="title">'; let html ..= '<a href="' .. object.uri .. '">' .. object.title .. '</a>'; if (!isExtension && object.parent) { let html ..= ' in <a href="' .. object.parent.uri .. '">' .. object.parent.title .. '</a>'; } let html ..= '</div>'; let html ..= '<div class="itemmatch">' .. object.date .. ' (' .. object.editsummary .. ')</div>'; if (!isExtension && object.text) { let html ..= '<div class="searchpreview">' .. string.substr(object.text, 0, previewLength) .. '</div>'; } } else { let html ..= '<div class="title"><a href="' .. object.uri .. '">' .. object.name .. '</a></div>'; let html ..= '<div class="itemmatch">' .. object.date .. ' (' .. object.description .. ')</div>'; } let html ..= '</li>'; } let html ..= '</ul>'; } else { let html ..= '<p>No Results found for your search.</p>'; } } else { let html ..= '<p>Please enter a search above.</p>'; } let html ..= '</div>'; web.html(html);