FacetView2

一个纯 javascript 的 ElasticSearch 搜索索引前端。「a pure javascript frontend for ElasticSearch search indices.」

  • 所有者: CottageLabs/facetview2
  • 平台: Web browsers
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

FacetView2

一个纯 javascript 的 ElasticSearch 搜索索引前端。

它是作为一个 jQuery 插件开发的,可以让你轻松地将一个分面浏览前端嵌入到任何网页中。

FacetView2 是对原 FacetView 应用的重大重写。参见 https://github.com/okfn/facetview 了解以前的版本。

使用 FacetView2

在您的网页上添加以下代码:

<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">

然后在页面的某个地方添加一个脚本,在特定的页面元素上实际调用并设置 facetview:

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

定制化

FacetView2 已经被编写成允许在一个灵活但受限的页面框架内进行广泛的定制。

这里会有更多的文档来介绍如何做到这一点,但在这段时间里,可以看看 jquery.facetview.js 的源码,看看配置选项和模板,可以替换为自定义显示。

版权和许可

Copyright 2014 Cottage Labs.

根据 MIT 许可证授权

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


主要指標

概覽
名稱與所有者CottageLabs/facetview2
主編程語言JavaScript
編程語言CSS (語言數: 3)
平台Web browsers
許可證MIT License
所有者活动
創建於2014-06-17 22:15:52
推送於2018-03-08 06:39:06
最后一次提交2017-04-18 08:22:25
發布數0
用户参与
星數80
關注者數15
派生數31
提交數75
已啟用問題?
問題數15
打開的問題數9
拉請求數4
打開的拉請求數0
關閉的拉請求數3
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

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