rufuspollock-okfn / facetview Goto Github PK
View Code? Open in Web Editor NEWFacetView is a pure javascript frontend for ElasticSearch.
FacetView is a pure javascript frontend for ElasticSearch.
For example:
{"bool":{"must":[{"term":{"hefe":"he"}},{"term":{"hefe":"he"}}]}}
I tried getting everything setup using the demo page and pointed facetview at my local ES endpoint:
http://127.0.0.1:9200/yummy/data/_search?
Documents inside are using the document-attach plugin and are base64 encoded. I assume this is somehow breaking facetview's functionality?
While these do impose additional vendor dependencies they will simplify the code so greatly and improve its maintanability.
Question: which template library?
Copyright: individual authors (or for orgs: OKFN + Cottage labs)
License: Suggest MIT for this
as far as I understand the code the logic is "wrong":
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++ ) {
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.
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
Please provide documentation for using wlidcard search.
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
Current demo does not show anything ...
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.
jquery.facetview.js (commit 78eea02947
)
<p><b>Filter list size</b> can be altered by clicking on the filter size number<./p> \
value="" placeholder="search term" autofocus />';
Code is not working with Internet Explorer 8.
IndexOf and for ... in array doesn't work.
http://stackoverflow.com/questions/5659591/javascript-arrays-in-ie-8-issue
Objects should recursively display nicely. This I have done in bibserver, will copy across.
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!!
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?
Copied from: http://facetview.cottagelabs.com/roadmap/
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.
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.
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)
Move docs currently at http://facetview.cottagelabs.com/ to README.
Currently use POST which does not work cross domain (which is a pain for e.g. the demo). See http://www.elasticsearch.org/guide/reference/api/ (section on JSONP at end)
Aside: also suggest we explicitly include json2.js as atm we are writing json by hand.
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> </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&format=HTML&aged=0&language=EN&guiLanguage=en'> Bathing water quality in the EU remains high<br /></a></li></ul> <p> </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."
}
},
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...)
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.
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?
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
view doesn't update with new incoming tweets. need to refresh to obtain a latest tweet view.
http://okfnlabs.org/facetview/ -- no search results.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.