Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Locate the values object in the integration, it will be under javascript code to configure the behaviour of the search interface. It looks something like this:

    Code Block
    <!--
          Javascript to configure the behaviour of the search interface.
          Make sure this at the bottom of the <body>.
        -->
        <script>
          var getUrlParam = function(e){var t = new RegExp("[?&]" + e.replace(/[\[\]]/g, "\\$&") + "(=([^&#]*)|&|#|$)"),a = t.exec(window.location.href);return a && a[2] ? decodeURIComponent(a[2].replace(/\+/g, " ")) : ""};
          var searchInterface = sajari.init({
              ...
              <other configurations>
              ...
              values: {"q.override": true, "resultsPerPage": "10","q": getUrlParam("q")}, // Set default values.
              tabFilters: null, // User selectable filters
              styling: { theme: { colors: { brand: { primary: "#333" }}}}
          });
        </script>
  2. Add the fields param “fields“:”title,url,published_time” in the values object and add the fields that you want to render on your search interface. The fields should be separated by commas and shouldn't have any spaces between them. It should look like this:

    Code Block
    values: {"q.override": true, "resultsPerPage": "10","q": getUrlParam("q"), "fields":"title,url,published_time"},
  3. Update the modified integration code on your website. You can modify the styles by using component styling. Read more on how to modify styles here.

  4. That’s it! The title, url, and published_time fields will be returned in response.

...

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@957
showSpacefalse
sorttitle
typepage
reversetrue
labelscrawler
cqllabel = "integration" and type = "page" and space = "KB"labelscrawler