From: Greg P. <Gre...@us...> - 2009-09-04 02:04:26
|
Hi Eoghan, The real culprit appears to be in Results.php and the new DisMax stuff in Solr.php. 'type' is named differently in a few sections: 'type' in the search form: layout.tpl 'index' in Results.php when creating $search (gets passed into buildQuery) 'field' inside buildQuery(). Because it's not finding the data it's expecting you get: term coming back instead of field:(term) That value ultimately ends up in your getNarrowOptions call as the first parameter and should work without the changes you made... it's just not being created quite right at the moment. I tried some quick renames in a couple of places but they all cause crashes, so it just needs a careful read through for naming consistancy I think. I'll try this afternoon. Ta, Greg Pendlebury Electronic Services Officer (Systems Team) Division of Academic Information Services University of Southern Queensland Phone: +61 7 4631 1501 Fax: +61 7 4631 1841 ________________________________ From: Eoghan Ó Carragáin [mailto:eog...@gm...] Sent: Friday, 4 September 2009 11:18 AM To: vuf...@li... Subject: [VuFind-Tech] Facets ignore the search type - is this a bug? Hi, I noticed that my facets were not behaving as I expected: basically the facet values & item counts remain the same regardless of what type of search I do - i.e. are always based on an AllFields search. This is the case in an instance running check-out a few weeks ago and on an instance running the current trunk (r1355). The problem seems to be that the value of the type parameter is not passed to getNarrowOptions() in services/Search/ajax.js from Search/list.tpl. This means that, in turn, the type is not passed to GetNarrowOptions() in services/Search/Ajax.php, which means the search that is passed to solr has a null value for the type and therefore does an AllFields search. I have made the following changes which work for me (see below) and would appreciate feedback before submitting any of this to JIRA. Is this a bug or am I completely missing something? Many thanks, Eoghan -------------------------- list.tpl ------------------------------ changed: getNarrowOptions('{$query|escape:'url'}', '{$filterQuery|escape:'url'}', '{$recordCount}', '30', '{$fullPath|regex_replace:"/&page=[0-9]+/":""|escape:'url'}'); to: getNarrowOptions('{$query|escape:'url'}', '{$type|replace:"'":"\'"}', '{$filterQuery|escape:'url'}', '{$recordCount}', '30', '{$fullPath|regex_replace:"/&page=[0-9]+/":""|escape:'url'}'); --------------------------------------------------------------- -------------------------- ajax.js ------------------------------ Altered getNarrowOptions to begin like this: function getNarrowOptions(query, type, fquery, limit, optionLimit, link) { var narrowList = getElem('narrowList'); var loading = getElem('narrowLoading'); // Remove page from URL link = link.replace(/&page=[0-9]+/, ''); // Load Popup Box Content from AJAX Server var url = path + "/Search/AJAX"; var params = 'method=GetNarrowOptions' + '&type=' + type + '&filter=' + fquery + '&limit=' + limit + '&link=' + link + '&optionLimit=' + optionLimit + '&query=' + query var callback =; --------------------------------------------------------------- -------------------------- Ajax.php ------------------------------ In the GetNarrowOptions() function, changed $result = $db->search($_GET['query'], null, $filter, null, 0, to $result = $db->search($_GET['query'], $_GET['type'], $filter, null, 0, --------------------------------------------------------------- This email (including any attached files) is confidential and is for the intended recipient(s) only. If you received this email by mistake, please, as a courtesy, tell the sender, then delete this email. The views and opinions are the originator's and do not necessarily reflect those of the University of Southern Queensland. Although all reasonable precautions were taken to ensure that this email contained no viruses at the time it was sent we accept no liability for any losses arising from its receipt. The University of Southern Queensland is a registered provider of education with the Australian Government (CRICOS Institution Code No's. QLD 00244B / NSW 02225M) |