Bug 23317

Summary: Elasticsearch - IntranetCatalogSearchPulldown breaks searching indexes via query
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: Searching - ElasticsearchAssignee: Bugs List <koha-bugs>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P5 - low CC: andrewfh, katrin.fischer, rhouk
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Nick Clemens (kidclamp) 2019-07-15 15:54:30 UTC
To recreate:
1 - Enable ES
2 - On staff side search for sn:4 (or real biblionumber)
3 - You go to a bib
4 - Enable IntranetCatalogSearchPulldown
5 - Reload the page to search the dropdown
6 - Repeat search
7 - It fails
Comment 1 Ron Houk 2019-07-16 19:53:25 UTC
Being able to search indexes is a very useful feature and it would be nice to have it working with Elasticsearch.
Comment 2 Andrew Fuerste-Henry 2019-07-17 15:36:03 UTC
This jQuery in IntranetUserJS can bandaid the problem:
$(document).ready(function () {
    $("select.advsearch[name='idx'] option[value='kw,phr']").after('<option value="sn">Biblionumber</option>');
    $("select.advsearch[name='idx'] option[value='kw']").attr('value',"");
});
Comment 3 Andrew Fuerste-Henry 2019-07-17 16:11:03 UTC
Whoops, pasted a bit more than I meant to. Here's the relevant bit:

This jQuery in IntranetUserJS can bandaid the problem:
$(document).ready(function () {
    $("select.advsearch[name='idx'] option[value='kw']").attr('value',"");
});
Comment 4 Nick Clemens (kidclamp) 2019-10-22 15:56:35 UTC
So this actually works in master currently, as long as 'keyword' is selected.

If you try to select 'Title' in the dropdown and then search 'au:dickens' it fails

Do we need to support searches like that?
Comment 5 Katrin Fischer 2019-11-24 12:50:00 UTC
(In reply to Nick Clemens from comment #4)
> So this actually works in master currently, as long as 'keyword' is selected.
> 
> If you try to select 'Title' in the dropdown and then search 'au:dickens' it
> fails
> 
> Do we need to support searches like that?

I think 'expert search' is only expected to work with keyword selected - if that is the question :)