Giter Site home page Giter Site logo

facetview's People

Contributors

emanuil-tolev avatar martyn-w avatar mihneasim avatar omarkhan avatar rufuspollock avatar sra avatar tomoinn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

facetview's Issues

Switch to use template library and JSON2

While these do impose additional vendor dependencies they will simplify the code so greatly and improve its maintanability.

Question: which template library?

  • Ans: would have said jquery.tmpl but that is no longer blessed and is in fact deprecated. My best suggestion at this point is underscore template as that library is a standard utility library that is useful in its own right. Next best alternative would be mustache (?).

Copyright and License

Copyright: individual authors (or for orgs: OKFN + Cottage labs)

License: Suggest MIT for this

Using 'each' as a variable name

Line 848 is currently:
for ( var each = 0; each < options.facets.length; each++ ) {

I've changed mine locally to:
for ( var filter = 0; filter < options.facets.length; filter++ ) {

Custom Formatting on Facet Value

thanks for this awesome library.

I notice that if I pulled datetime data type from ES, it will be formatted in UNIX timestamp.
Would be ideal if we could have the ability to customize the value for display.

FacetView Not working

Hi,

I am not able to get it to work.
When i connect facetview to ElasticSearch i am getting this error:
SyntaxError: invalid label

This same issue seems to be coming in the demo site.

Please help
Thanks alot
Jaskaran

Unexpected result format

Hi,

i have some issues to display the result of my queries.
i may be doing things in the wrong way but i can't find a solution.

the resultdisplay var is simply defined like this :

    var resdisplay = [
            [
                {
                    "field": "personlastname"
                }
            ]
        ];

as a result i get the following string (actually the complete JSON object corresponding the query), instead of the only personlastname field :

{ "Ventes": { "Vente": { "orderid": "78698772", "timestamporder": "20121207130619310000", "orderstatus": "PV", "Client": { "personrole": "C", "persongender": "MME", "personlastname": "GAUTHIER", "personfirstname": "FRANCOISE", "personisoptinoutemail": "N", "personisoptinoutphone": "N", "personisoptinoutpost": "N", "personhomephonenumber": [], "Adresse": { "addrsiebeladdressid": "26652221", "addrisprimary": "1", "addraddress": "", "addraddresscomp1": [], "addrbuildingid": [], "addrstairid": [], "addrfloorid": [], "addrdoorid": [], "addrcountry": "FRANCE", "addrzipcode": "", "addrcity": "" } }, "Lignes": { "itemcodetype": "CO", "itemcode": "3650901", "itemlegacysalesclerkid": "017587", "itemlegacydeliverymode": "EMR", "itemquantity": "1", "itembaseprice": "8990", "itemlegacyvatcode": "1", "itemvatratee": "1960", "itemnetprice": "7516", "itemvatamount": "1474" } } } }

instead of :
GAUTHIER

do you have any idea ?

thanks a lot

Facetview sends invalid queries if called on an element not currently attached to the dom

I'm creating a BackBone view and calling $('#myelement',this.el).facetView() in the render() method. This is then called before adding the view's element to the DOM, the effect of which appears to be to cause facetview to send an invalid query :

{ query: { query_string: {} },
facets:
{ 'year.exact': { terms: [Object] },
'publisher.exact': { terms: [Object] } },
filter: { type: { value: 'structure' } } }

(the filter is being inserted by my code, but removing doesn't change the response). This fails to parse as there's no query in the query_string property, and the failure then causes facetview to fail on initialisation and not show the rest of the UI. It does show the search box, and subsequent searches from the part of the UI it has put up are well formed, it's just the initial one that fails.

HTML syntax errors.

jquery.facetview.js (commit 78eea02947)

  • line 1127: the dot symbol inside closing p tag <p><b>Filter list size</b> can be altered by clicking on the filter size number<./p> \
  • line 1182: missed value for attribute autofocus value="" placeholder="search term" autofocus />';

Paging breaks on new search

I have 1,000 results, and am on page 10 of said results. The pager says "page 91-100 of 1000".

If I then type in "cat", the paging says "page 91 - 5 of 5", displaying no results obviously.

I've quickly hacked this...:

    // update the options with the latest q value
    if ( options.searchbox_class.length == 0 ) {
        options.q = $('.facetview_freetext', obj).val();

... so the paging gets set to 0 before the new search is run

    // update the options with the latest q value
    if ( options.searchbox_class.length == 0 ) {
        options.paging.from = (options.q != $('.facetview_freetext', obj).val()) ? 0 : options.paging.from;
        options.q = $('.facetview_freetext', obj).val();

I'm sure you have a much more elegant solution though!!

Support for range queries

You have done great work here. FacetView provides great experience right out of the box.
It would be great to have support (both UI and backend) for range queries as well. Do you have any plans for adding it back?

More than 3 levels of nesting in results display

Just echoing a TODO in the code to remind myself (or somebody else) to fix it since one of my indices has fields like "bibjson.journal.title" and it wouldn't take much to tip that over to 4 parts.

var thekey = display[lineitem][object]['field'];
parts = thekey.split('.');
// TODO: this should perhaps recurse..
if (parts.length == 1) {
    var res = record;
} else if (parts.length == 2) {
    var res = record[parts[0]];
} else if (parts.length == 3) {
    var res = record[parts[0]][parts[1]];
}

in the buildrecord function.

Length of querystring in IE

Simple one this; we've found that some IE users, who are behind a proxy, find that FacetView sometimes breaks, as if FV can't talk to the ES server.

We seem to have fixed this by changing the search request from a GET to a POST.

http://stackoverflow.com/a/417184/1947031

Update: Ignore the above, we also removed a load of stats stuff from the query, and it's this that seems to have fixed it. Too many cooks... sorry to bother you basically.

Refactor to use HTML + templating

ATM html is built up with mixture of strings and code. This is very difficult to read and maintain. suggest we switch to using blocks of HTML with variables of form {{varname}} and then doing:

template.replace(/{{...}}/g, variable)

URI as result field

result_display formatting doesn't work and filters don't show when URIs are used as field names, for example, in the result below, "http://purl.org/dc/terms/creator" is used instead of "author", since currently the code assumes . is used to get data from an object, the split turns http://purl.org/dc/terms/creator into ["http://purl", "org/dc/terms/creator"] and breakes the functionality.

I forked the code and did a quick fix but my fix will not allow things like http://purl.org/dc/terms/creator.first_name to work, since it skips the split.

In the fix some jQuery selectors have been replaced with [id=""] syntax, as selectors like jQuery('#facetview_http_//purl_org/dc/terms/creator') don't seem to work using the standard syntax.

      {
        "_index": "rdfdata",
        "_type": "resource",
        "_id": "http://www.eea.europa.eu/highlights/check-last-year2019s-water-quality-in-your-favourite-bathing-spot",
        "_score": 1.0,
        "_source": {
          "http://www.eea.europa.eu/portal_types/Highlight#media": "http://www.eea.europa.eu/highlights/check-last-year2019s-water-quality-in-your-favourite-bathing-spot/image_xlarge",
          "http://rdfdata.eionet.europa.eu/amp/ontology/managementPlan": "2011",
          "http://www.eea.europa.eu/portal_types/Highlight#publishDate": "2008-06-02T08:00:00.0",
          "http://www.w3.org/2000/01/rdf-schema#label": "Check last year's water quality in your favourite bathing spot",
          "http://www.eea.europa.eu/portal_types/Highlight#text": "<p>With WISE, users can check the water quality on an interactive map. They can also select a country or a region, download the data for their selection and make comparisons with previous years. The downloaded data can also be visualised in geospatial mapping programmes such as Google Earth and Microsoft Live maps.</p> <p>WISE is a partnership between the European Commission (DG Environment, Joint Research Centre and Eurostat) and the European Environment Agency, closely collaborating with EU Member States. An annual assessment of the bathing water quality in the EU will be presented today by the European Commission.</p> <h3>State of bathing water<br /></h3> <ul><li><a href='http://www.eea.europa.eu/themes/water/status-and-monitoring/state-of-bathing-water/state/state-of-bathing-water' class='external-link'>Visit EEA's thematic site on 'state of bathing water'</a></li></ul> <p>&nbsp;</p> <h3>See also</h3> <ul><li>European Commission's press release: <a class='external-link' href='http://europa.eu/rapid/pressReleasesAction.do?reference=IP/08/834&amp;format=HTML&amp;aged=0&amp;language=EN&amp;guiLanguage=en'>&nbsp;Bathing water quality in the EU remains high<br /></a></li></ul> <p>&nbsp;</p>",
          "http://purl.org/dc/terms/title": "Check last year's water quality in your favourite bathing spot",
          "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [
            "http://rdfdata.eionet.europa.eu/amp/ontology/Output",
            "http://purl.org/ontology/bibo/Webpage",
            "http://www.eea.europa.eu/portal_types/Highlight#Highlight"
          ],
          "http://www.eea.europa.eu/portal_types/Highlight#themes": [
            "coast_sea",
            "water"
          ],
          "http://purl.org/dc/terms/modified": "2011-04-13T17:17:40.0",
          "http://www.eea.europa.eu/portal_types/Highlight#id": "check-last-year2019s-water-quality-in-your-favourite-bathing-spot",
          "http://purl.org/dc/terms/created": "2008-05-30T11:55:18.0",
          "http://purl.org/dc/terms/creator": "karadgu",
          "http://www.eea.europa.eu/portal_types/Highlight#management_plan": "2011",
          "http://www.eea.europa.eu/portal_types/Highlight#visibilityLevel": "middle",
          "http://purl.org/dc/terms/issued": "2008-06-02T08:00:00.0",
          "http://purl.org/dc/terms/isPartOf": "http://www.eea.europa.eu/highlights",
          "http://cr.eionet.europa.eu/ontologies/contreg.rdf#tag": [
            "coast_sea",
            "water"
          ],
          "http://purl.org/dc/terms/description": "The 'Water Information System for Europe' (WISE) now allows users to view the quality of the bathing water in more than 21 000 coastal beaches and freshwater bathing sites across Europe during the 2007 bathing season. WISE also includes new information on urban wastewater treatment and water quality in European lakes and rivers."
        }
      },

FacetsView Custom

Your FacetsView is really great!

But I try to do it, in my own website, but I can't make any request, because my URL is like "http://extremesearch.cloudapp.net:9200/turbomanga/manga".
And I wanna know how to make request in a adresse like that, cause in FacetsView you have "http://bibsoup.net/query?"

So I wanna know how I can make request in my website! I was thinking about change default_url_params, but I failed!

Thx for your job, and to listen me! x) (Sorry if my english is bad...)

Aggregations instead of facets

With elasticsearch 1.0 aggregations are introduced. Best thing about them is, that you can nest them. Would be fine, if facetview would support that kind of facets with subfacets.

Compatibility with ElasticSearch 1.3.4

I tried FacetView with ElaticSearch 1.3.4 but it doesn't work. I can't even get the list of documents displayed from the index. Is there any guideline to make it compatible with latest ElasticSearch?

dataobj.response is undefined on return results

Hi folks
Thanks for this, looks really good. I 'almost' have it going but stuck on a simple thing that concerns results returned. My generated elasticsearch query is:
http://localhost:9200/master/master_record/_search?from=0&size=10&facet.field=mxfs_filename&facet.field=title&q=_snow_%20\*
which generates a great deal of nice-looking json and OK in firebug.

However I don't get any textual record display or submenus in the facets? I get the dataobj.request message on return. I have jsonp specified in the config but I'm not sure what [if anything] I need to do with the templating etc. and this is not very clear in the commentary?

Thanks in advance Hugh Barnard

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.