From: Demian K. <dem...@vi...> - 2010-07-15 14:04:30
|
Great - glad to hear it's working! As you say, the display in the sidebar is a bit annoying; another detail we need to address when finding a more generic solution to this problem. - Demian From: Oliver Marahrens [mailto:o.m...@tu...] Sent: Thursday, July 15, 2010 10:03 AM To: Demian Katz Cc: vuf...@li... Subject: RE: [VuFind-Tech] OR-based filtering Thank you Demian, this is working. I implemented option 2, which I also preferred. The only bothering side effect: in facet side bar, where the filters are listed, now stands 'Quelle: Catalog" OR collection:"Website', which I guess can be irritating. But that's finetuning ;-) Thank you again! Oliver Zitat von Demian Katz <dem...@vi...>: > This sort of capability would be good to have natively in VuFind -- > it falls under the "more flexible facet behavior" issue that's > currently up for discussion in JIRA: > > http://vufind.org/jira/browse/VUFIND-177 > > Since it will probably be a while before we work out all the details > and add improved generic facet capabilities to VuFind, I can think of > two possible approaches if you want to solve this problem yourself: > > 1.) As you say, you could use Javascript -- prior to form submission, > you could read all the selected checkboxes in a particular group and > then inject a new hidden field into the search form containing the > combined (OR'ed) facet query. > > 2.) The other option would be to do it client-side -- just give your > set of checkboxes a separate name (say, "orFilter[]" instead of > "filter[]") and then add something like this to the > SearchObject_Solr::initFilters() function: > > if (isset($_REQUEST['orFilter']) && is_array($_REQUEST['orFilter']) > && count($_REQUEST['orFilter']) > 0) { > $this->addFilter(implode(' OR ', $_REQUEST['orFilter'])); > } > > Personally, I prefer option #2 -- a bit simpler than dealing with > Javascript, and more broadly compatible. > > - Demian > >> -----Original Message----- >> From: Oliver Marahrens [mailto:o.m...@tu...] >> Sent: Thursday, July 15, 2010 7:33 AM >> To: vuf...@li... >> Subject: [VuFind-Tech] OR-based filtering >> >> Hi, >> >> we are currently working on extending the index of our vufind and >> putting some other sources into it (like our Website and the Weblog). I >> finally have indexed the contents, but now I'm wondering how we can >> offer the different sources in the searchbox. >> In the vufind installation of Colorado State University they have put >> some checkboxes under the search slice. With these checkboxes one can >> select which sources should be included in the query. I would like to >> do >> it also that way, so I implemented it by setting a filter on the query: >> filter[]=collection:"Catalog". >> >> This works, but only for one selection. If I select multiple sources, >> query returns 0 results. How can I select multiple sources? In CSU they >> build filters like silo:("Website" OR "Instutional Repository"). I >> guess >> CSU works with JavaScript, but I do not understand how that works >> exactly. Can anybody give me a hint? >> >> Thanks in advance, regards >> Oliver >> >> -- >> Oliver Marahrens >> TU Hamburg-Harburg / Universitätsbibliothek / Digitale Dienste >> Denickestr. 22 >> 21071 Hamburg - Harburg >> Tel. +49 (0)40 / 428 78 - 32 91 >> eMail o.m...@tu... >> -- >> GPG/PGP-Schlüssel: >> http://www.tub.tu-harburg.de/keys/Oliver_Marahrens_pub.asc >> -- >> Projekt DISCUS http://discus.tu-harburg.de >> Projekt TUBdok http://doku.b.tu-harburg.de >> >> >> ----------------------------------------------------------------------- >> ------- >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> Vufind-tech mailing list >> Vuf...@li... >> https://lists.sourceforge.net/lists/listinfo/vufind-tech > |