Giter VIP home page Giter VIP logo

drupal-usasearch's Introduction

Contents of this file

  • Overview
  • Installation
  • Requirements
  • Setup Tips
  • Features

Overview

DigitalGov search (formerly USASearch) is an embeddable search engine that can be used to search a site. An Affiliate profile and associated Affiliate ID are required. Read more at http://search.digitalgov.gov/developer/

DigitalGov Search offers several services:

  1. A hosted search platform.
  2. i14y (beta) real-time indexing API

Hosted Search

Provides a custom search block, separate from Drupal’s system search block. When content is searched, the user will be redirected to the hosted search solution. When they click on a result, they will be sent back to your site. The search block has the optional “autocomplete” functionality, using DigitalGov’s “Type-ahead” API

i14y

This module uses the i14y API to send content directly from your Drupal installation to DigitalGov Search for real-time indexing.

For indexing you will need the i14y drawer handle. Login at https://search.usa.gov/affiliates and select Content > i14y Drawers in the left side menu. Add an i14y Drawer and enter an i14y drawer handle or select Show to display the i14y secret token of an existing drawer.

Installation

  1. Place the usasearch directory in your modules directory.
  2. Enable the DigitalGov Search module at admin/modules.
  3. Configure it at admin/config/search/usasearch by entering DigitalGov Search’s unique affiliate name for your affiliate.

Requirements

  • A valid Affiliate profile from DigitalGov Search.
  • Core Search module must be enabled.

Setup Tips

After enabling the module go to /admin/structure/block to place the "USA Search Form" block in the desired region.

Customization

Developers may use an alter hook to alter the document before being sent to i14y API. For example (in {mymodule}.module file):

function mymodule_usasearch_document_alter(&$data) { // Append a string to the document title $data['title'] = $data['title'] . ', So it goes.'; return $data; }

In addition, an event 'usasearch.request' has been created and can be used by adding an event subscriber. An example module creating an event subscriber: https://github.com/ericpugh/drupal-example-event-subscriber

Features

The module was designed to allow exporting of all the admin configuration options via Drupal 8 Configuration Management.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.