Bug 22997: Searching gives no results in auth_finder.pl
authorFridolin Somers <fridolin.somers@biblibre.com>
Tue, 28 May 2019 13:48:54 +0000 (15:48 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 9 Oct 2019 13:29:06 +0000 (14:29 +0100)
commita94e863c3ed17c177c9ce5d284616791fd5cd380
treec56568c5be39a82460d8f7041e9647135d94c35b
parent13de5a93200bd6621d1fa2eab5279d51264dce8a
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>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/SearchEngine/Elasticsearch/QueryBuilder.pm