Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing Visualsearch.js in a backbone.js framework
    primarykey
    data
    text
    <p>First of all, thanks to the guys of <a href="http://www.documentcloud.org/home" rel="nofollow">DocumentCloud</a> for releasing those two super-useful tools.</p> <p>Here goes my question(s):</p> <p>I'm trying to use visulasearch.js in a backbone.js app.</p> <p>In my app I have a basic index.html and a myapp.js javascript file wich contains the main application done with backbone.js<br></p> <p>I use CouchDB as data storage, and I successfully can retrieve in a restful way all the data to be put in the collection.<br> I must retrieve the search query given by visualsearch.js and use it to filter a collection.<br> I surely need a view for the searchbox, to trigger an event when enter is hit, but..</p> <ol> <li><p>Should I initialze the searchbox externally to myapp.js, within an additional js file or my index.html page (as suggested in the <a href="http://documentcloud.github.com/visualsearch/" rel="nofollow">visualsearch mini.tutorial</a>)? Or I should initialize it within the searchbox view (myapp.js)? This latter solution seems to be too tricky (it was what I was trying to do, but even when I succeed, it's too complicated and I lost the simplicity of bacbone mvc).</p></li> <li><p>Let's say I succeed in retrieving the search string as a JSON object like <code>{name:'Fat DAvid', address:'24, slim st', phone:'0098876534287'}</code>. Once done that, which function can I use to retrieve, in the collection, only the models whose fields match with the given string. I understand that I should do a map or a filter, but those function seems to serve natively for slightly different tasks.</p> <p>a. is it really the best way to filter results? It charges the client (which must filter the results), while making a new query (a view or a filter) to CouchDB would be quite simple and, considered the small amount of data and the low access rate to the site, not so expensive. However, making all the filtering action client-side, it's much simpler than making new view(or list or filters) in CouchDB and linking it the the backbone.js view</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload