Code Monkey home page Code Monkey logo

facetview2's Introduction

FacetView2

a pure javascript frontend for ElasticSearch search indices.

It has been developed as a jQuery plugin and lets you easily embed a faceted browse front end into any web page.

FacetView2 is a major re-write of the original FacetView application. See https://github.com/okfn/facetview for the previous version.

Using FacetView2

Add the following code to your web page:

<script type="text/javascript" src="vendor/jquery/1.7.1/jquery-1.7.1.min.js"></script>
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.min.css">
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.min.js"></script>  
<link rel="stylesheet" href="vendor/jquery-ui-1.8.18.custom/jquery-ui-1.8.18.custom.css">
<script type="text/javascript" src="vendor/jquery-ui-1.8.18.custom/jquery-ui-1.8.18.custom.min.js"></script>

<script type="text/javascript" src="es.js"></script>
<script type="text/javascript" src="bootstrap2.facetview.theme.js"></script>
<script type="text/javascript" src="jquery.facetview2.js"></script>
<link rel="stylesheet" href="css/facetview.css">

Then add a script somewhere to your page that actually calls and sets up the facetview on a particular page element:

<script type="text/javascript">
jQuery(document).ready(function($) {
  $('.facet-view-simple').facetview({
    search_url: 'http://localhost:9200/myindex/type/_search',
    facets: [
        {'field': 'publisher.exact', 'size': 100, 'order':'term', 'display': 'Publisher'},
        {'field': 'author.name.exact', 'display': 'author'},
        {'field': 'year.exact', 'display': 'year'}
    ],
  });
});
</script>

Customisation

FacetView2 has been written to allow extensive customisation within a flexible but constrained page framework.

There will be more documentation here on how to do that, but in the mean time, take a look at the source of jquery.facetview.js for the config options and templates that can be replaced for custom display.

Copyright and License

Copyright 2014 Cottage Labs.

Licensed under the MIT Licence

twitter bootstrap: http://twitter.github.com/bootstrap/ MIT License: http://www.opensource.org/licenses/mit-license.php

facetview2's People

Contributors

aeksco avatar bryant1410 avatar emanuil-tolev avatar richard-jones avatar steven-eardley avatar

Watchers

 avatar  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.