diff --git a/lib/SLUB/LZA/TA/Archivematica/Elasticsearch/PrepareQuery.pm b/lib/SLUB/LZA/TA/Archivematica/Elasticsearch/PrepareQuery.pm index 948ea1fd55608e0d72d0f3a9f6ab6fb5ff1aa9de..988ee7378d81c0e79aa101b90d1762a3652ecd8e 100644 --- a/lib/SLUB/LZA/TA/Archivematica/Elasticsearch/PrepareQuery.pm +++ b/lib/SLUB/LZA/TA/Archivematica/Elasticsearch/PrepareQuery.pm @@ -13,9 +13,6 @@ sub prepare_aip_query ($opt) { if (exists $opt->{maxrecords}) { $query->{size} = $opt->{maxrecords}; } - if (exists $opt->{source}) { - #push @queries, "IE.sourceMD.content=\"$opt->{source}\""; - } if (exists $opt->{aip}) { push @must, { "match_phrase" => { @@ -96,7 +93,16 @@ sub prepare_aip_query ($opt) { push @should, { "multi_match" => { "query" => "$opt->{descriptive}", - "fields" => ["transferMetadata.*"] # scan all metadata + "fields" => ["transferMetadata.*"] # scan all metadata, exact match + } + } + } + if (exists $opt->{fuzzy}) { + push @should, { + "multi_match" => { + "query" => "$opt->{fuzzy}", + "fields" => ["transferMetadata.*"], # scan all metadata, phrase match + "type" => "phrase_prefix", } } }