Lines 1371-1387
sub buildQuery {
Link Here
|
1371 |
my $index = $indexes[$i]; |
1371 |
my $index = $indexes[$i]; |
1372 |
|
1372 |
|
1373 |
# Add index-specific attributes |
1373 |
# Add index-specific attributes |
|
|
1374 |
|
1375 |
#Afaik, this 'yr' condition will only ever be met in the staff client advanced search |
1376 |
#for "Publication date", since typing 'yr:YYYY' into the search box produces a CCL query, |
1377 |
#which is processed higher up in this sub. Other than that, year searches are typically |
1378 |
#handled as limits which are not processed her either. |
1379 |
|
1374 |
# Date of Publication |
1380 |
# Date of Publication |
1375 |
if ( $index eq 'yr' ) { |
1381 |
if ( $index =~ /yr/ ) { |
1376 |
$index .= ",st-numeric"; |
1382 |
#weight_fields/relevance search causes errors with date ranges |
1377 |
$indexes_set++; |
1383 |
#In the case of YYYY-, it will only return records with a 'yr' of YYYY (not the range) |
|
|
1384 |
#In the case of YYYY-YYYY, it will return no results |
1378 |
$stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0; |
1385 |
$stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0; |
1379 |
} |
1386 |
} |
1380 |
|
1387 |
|
1381 |
# Date of Acquisition |
1388 |
# Date of Acquisition |
1382 |
elsif ( $index eq 'acqdate' ) { |
1389 |
elsif ( $index =~ /acqdate/ ) { |
1383 |
$index .= ",st-date-normalized"; |
1390 |
#stemming and auto_truncation would have zero impact since it already is YYYY-MM-DD format |
1384 |
$indexes_set++; |
1391 |
#Weight_fields probably SHOULD be turned OFF, otherwise you'll get records floating to the |
|
|
1392 |
#top of the results just because they have lots of item records matching that date. |
1393 |
#Fuzzy actually only applies during _build_weighted_query, and is reset there anyway, so |
1394 |
#irrelevant here |
1395 |
#remove_stopwords doesn't function anymore so is irrelevant |
1385 |
$stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0; |
1396 |
$stemming = $auto_truncation = $weight_fields = $fuzzy_enabled = $remove_stopwords = 0; |
1386 |
} |
1397 |
} |
1387 |
# ISBN,ISSN,Standard Number, don't need special treatment |
1398 |
# ISBN,ISSN,Standard Number, don't need special treatment |
Lines 1592-1600
sub buildQuery {
Link Here
|
1592 |
# This is flawed , means we can't search anything with : in it |
1603 |
# This is flawed , means we can't search anything with : in it |
1593 |
# if user wants to do ccl or cql, start the query with that |
1604 |
# if user wants to do ccl or cql, start the query with that |
1594 |
# $query =~ s/:/=/g; |
1605 |
# $query =~ s/:/=/g; |
|
|
1606 |
#NOTE: We use several several different regexps here as you can't have variable length lookback assertions |
1595 |
$query =~ s/(?<=(ti|au|pb|su|an|kw|mc|nb|ns)):/=/g; |
1607 |
$query =~ s/(?<=(ti|au|pb|su|an|kw|mc|nb|ns)):/=/g; |
1596 |
$query =~ s/(?<=(wrdl)):/=/g; |
1608 |
$query =~ s/(?<=(wrdl)):/=/g; |
1597 |
$query =~ s/(?<=(trn|phr)):/=/g; |
1609 |
$query =~ s/(?<=(trn|phr)):/=/g; |
|
|
1610 |
$query =~ s/(?<=(st-numeric)):/=/g; |
1611 |
$query =~ s/(?<=(st-year)):/=/g; |
1612 |
$query =~ s/(?<=(st-date-normalized)):/=/g; |
1598 |
$limit =~ s/:/=/g; |
1613 |
$limit =~ s/:/=/g; |
1599 |
for ( $query, $query_desc, $limit, $limit_desc ) { |
1614 |
for ( $query, $query_desc, $limit, $limit_desc ) { |
1600 |
s/ +/ /g; # remove extra spaces |
1615 |
s/ +/ /g; # remove extra spaces |