Bug 22413

Summary: Elasticsearch - Search settings are lost after sorting, faceting or paging
Product: Koha Reporter: Marjorie Barry-Vila <marjorie.barry-vila>
Component: Searching - ElasticsearchAssignee: Ere Maijala <ere.maijala>
Status: CLOSED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: normal    
Priority: P5 - low CC: ere.maijala, glasklas, josef.moravec, katrin.fischer, margaret, martin.renvoize, mkstephens, nick, patrick.robitaille, sandboxes, stefan.berndtsson
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22295
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22524
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.05
Bug Depends on:    
Bug Blocks: 22412, 22592    
Attachments: Bug 22413: Improve query string and desc creation for Elasticsearch
Bug 22413: Improve query string and desc creation for Elasticsearch
Bug 22413: Improve query string and desc creation for Elasticsearch
Bug 22413: Improve query string and desc creation for Elasticsearch
Bug 22413: Improve query string and desc creation for Elasticsearch

Description Marjorie Barry-Vila 2019-02-25 19:22:32 UTC
Hi,
There is a problem when sorting a list of results, a new search is done and index title for example is lost.

Test plan:
- Do a search with index title (koha/opac-search.pl?idx=ti&q=quebec)
- Sort by title A-Z
- a new search is done and index "ti" is lost (opac-search.pl?q=quebec&sort_by=title_az)



Regards
Marjorie
Comment 1 Katrin Fischer 2019-02-25 19:29:43 UTC
Hi Marjorie, thx for reporting! By default new bugs get 'enhancement' - please feel free to change that setting for bugs!
Comment 2 Marjorie Barry-Vila 2019-02-27 16:44:59 UTC
(In reply to Katrin Fischer from comment #1)
> Hi Marjorie, thx for reporting! By default new bugs get 'enhancement' -
> please feel free to change that setting for bugs!

Ok thanks!
Marjorie
Comment 3 Ere Maijala 2019-03-05 09:06:43 UTC
Created attachment 86049 [details] [review]
Bug 22413: Improve query string and desc creation for Elasticsearch

Test plan:

After each of the following steps, verify that the results and query description looks ok.

1. Do a simple keyword query
2. Change sort order
3. Click a facet
4. Do an advanced search with title and author
5. Change sort order
6. Click a facet
Comment 4 Josef Moravec 2019-03-05 11:59:32 UTC
Created attachment 86059 [details] [review]
Bug 22413: Improve query string and desc creation for Elasticsearch

Test plan:

After each of the following steps, verify that the results and query description looks ok.

1. Do a simple keyword query
2. Change sort order
3. Click a facet
4. Do an advanced search with title and author
5. Change sort order
6. Click a facet

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 5 Ere Maijala 2019-03-08 11:05:16 UTC
*** Bug 18319 has been marked as a duplicate of this bug. ***
Comment 6 Biblibre Sandboxes 2019-03-26 15:40:11 UTC
Patch tested with a sandbox, by Marjorie <marjorie.barry-vila@collecto.ca>
Comment 7 Biblibre Sandboxes 2019-03-26 15:40:34 UTC
Created attachment 87026 [details] [review]
Bug 22413: Improve query string and desc creation for Elasticsearch

Test plan:

After each of the following steps, verify that the results and query description looks ok.

1. Do a simple keyword query
2. Change sort order
3. Click a facet
4. Do an advanced search with title and author
5. Change sort order
6. Click a facet

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marjorie <marjorie.barry-vila@collecto.ca>
Comment 8 Martin Renvoize 2019-04-25 08:10:06 UTC
Sorry Ere, I had a quick go at re-basing this but I wasn't entirely confident I was getting it right. Setting to Does Not Apply, once rebased please set back to SO and I'll get back to QAing it.
Comment 9 Ere Maijala 2019-04-25 08:47:09 UTC
Created attachment 88716 [details] [review]
Bug 22413: Improve query string and desc creation for Elasticsearch

Test plan:

After each of the following steps, verify that the results and query description looks ok.

1. Do a simple keyword query
2. Change sort order
3. Click a facet
4. Do an advanced search with title and author
5. Change sort order
6. Click a facet

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marjorie <marjorie.barry-vila@collecto.ca>
Comment 10 Ere Maijala 2019-04-25 08:48:39 UTC
Rebased. I also sneaked in a tweak to exclude any limits from the displayed query since they're displayed separately.
Comment 11 Martin Renvoize 2019-04-25 09:22:03 UTC
Created attachment 88733 [details] [review]
Bug 22413: Improve query string and desc creation for Elasticsearch

Test plan:

After each of the following steps, verify that the results and query description looks ok.

1. Do a simple keyword query
2. Change sort order
3. Click a facet
4. Do an advanced search with title and author
5. Change sort order
6. Click a facet

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marjorie <marjorie.barry-vila@collecto.ca>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2019-04-25 09:22:42 UTC
Awesome, works well and no regressions found.

Passing QA
Comment 13 Nick Clemens 2019-04-25 11:56:19 UTC
Awesome work all!

Pushed to master for 19.05
Comment 14 Martin Renvoize 2019-04-26 15:24:37 UTC
Pushed to 18.11.x for 18.11.05
Comment 15 Nick Clemens 2019-06-10 14:52:38 UTC
*** Bug 20114 has been marked as a duplicate of this bug. ***
Comment 16 Nick Clemens 2019-10-01 14:52:26 UTC
*** Bug 22412 has been marked as a duplicate of this bug. ***