Git Product home page Git Product logo

solr-javascript-search-client's Introduction

Solr-JavaScript-Search-Client

Example HTML, CSS, and JavaScript for searching for items in a Solr repository

Live demo

Motivation

On my Long Term Ecological Research (LTER) project's static HTML website, I needed a search interface into my datasets archived at the Arctic Data Center, whose search API uses Solr. LTER websites must support searching by term as well as browsing by LTER core area. I needed pagination since thousands of results could be returned.

Usage

Open the HTML file in your browser and enter a search term like water. When you click Search, the application searches for datasets at the Arctic Data Center from anothe LTER site (mine doesn't have any data archived at the time that I created this) called Bonanza Creek. Results are summarized on the page with external links to more details at the original data archive.

You can click Search with no terms specified to show the entire catalog, which is the default behavior when you load the page.

To try filtering by core area, remove the search term and select the Disturbance core area.

Customization

To change parameters such as how many search results to show at a time, see the SOLR_CONFIG variable in solr.js. There you can also change the Solr server being queried and a filter for the group or user whose datasets you want to search. You can use an empty string for the filter parameter to search all datasets.

If you prefer to always require a search term, you can check that the query parameter has been set before performing a search with something like:

if (query != "" && query != null) {
    // Do the search, etc.
}

solr-javascript-search-client's People

Contributors

twhiteaker avatar

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.