Bug 22997 - Searching gives no results in auth_finder.pl
Summary: Searching gives no results in auth_finder.pl
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: master
Hardware: All All
: P5 - low critical with 10 votes (vote)
Assignee: Fridolin SOMERS
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on: 21084
Blocks:
  Show dependency treegraph
 
Reported: 2019-05-28 13:46 UTC by Fridolin SOMERS
Modified: 2019-07-01 15:54 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 22997: Searching gives no results in auth_finder.pl (2.24 KB, patch)
2019-05-28 14:09 UTC, Fridolin SOMERS
Details | Diff | Splinter Review
Bug 22997: Searching gives no results in auth_finder.pl (2.31 KB, patch)
2019-06-28 14:57 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin SOMERS 2019-05-28 13:46:01 UTC
During cataloguing of an existing biblio, on an heading field,
the use of tag editor fills authorities finder with existing value :
  Search main heading ($a only)
  Search main heading
Default operator beeing 'contains'.

Actually with Elasticsearch those search give no results.
Comment 1 Fridolin SOMERS 2019-05-28 13:48:09 UTC
Looks like with a 'query_string' the wildcards are by default not detected.

See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html

analyze_wildcard
	
By default, wildcards terms in a query string are not analyzed. By setting this value to true, a best effort will be made to analyze those as well.
Comment 2 Fridolin SOMERS 2019-05-28 14:09:11 UTC
Created attachment 90154 [details] [review]
Bug 22997: Searching gives no results in auth_finder.pl

During cataloguing of an existing biblio, on an heading field,
the use of tag editor fills authorities finder with existing value :
  Search main heading ($a only)
  Search main heading
Default operator beeing 'contains'.

Actually with Elasticsearch those search give no results.

Example with heading :
200
  $a Casaubon
  $b Isaac
  $f 1559-1614

Call to Elasticsearch :
    "query" : {
        "bool" : {
           "must" : [
              {
             "query_string" : {
                  "query" : "Casaubon*",
                  "default_field" : "heading-main",
                   }
              },
              {
             "query_string" : {
                  "query" : "(Isaac*) AND (1559-1614*)",
                  "default_field" : "heading"
                   }
              }
            ]
         }
      },
    "sort" : [
       {
      "heading__sort.phrase" : "asc"
       }
     ]
  }

Patch adds to "query_string" :
  analyze_wildcard : true.

Test plan :
1) Use Elasticsearch
2) Edit an existing biblio record
3) Use tag editor on a heading
4) Click search => You get correct results
5) Check also search in authorities-home.pl
Comment 3 Kyle M Hall 2019-06-28 14:57:52 UTC
Created attachment 91095 [details] [review]
Bug 22997: Searching gives no results in auth_finder.pl

During cataloguing of an existing biblio, on an heading field,
the use of tag editor fills authorities finder with existing value :
  Search main heading ($a only)
  Search main heading
Default operator beeing 'contains'.

Actually with Elasticsearch those search give no results.

Example with heading :
200
  $a Casaubon
  $b Isaac
  $f 1559-1614

Call to Elasticsearch :
    "query" : {
        "bool" : {
           "must" : [
              {
             "query_string" : {
                  "query" : "Casaubon*",
                  "default_field" : "heading-main",
                   }
              },
              {
             "query_string" : {
                  "query" : "(Isaac*) AND (1559-1614*)",
                  "default_field" : "heading"
                   }
              }
            ]
         }
      },
    "sort" : [
       {
      "heading__sort.phrase" : "asc"
       }
     ]
  }

Patch adds to "query_string" :
  analyze_wildcard : true.

Test plan :
1) Use Elasticsearch
2) Edit an existing biblio record
3) Use tag editor on a heading
4) Click search => You get correct results
5) Check also search in authorities-home.pl

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Martin Renvoize 2019-07-01 15:54:01 UTC
Failing QA.. we need tests adding to Koha/SearchEngine/Elasticsearch/QueryBuilder.t for this.