if (ctx.global) {
options.search_depth = this.org.root().ou_type().depth();
}
+ if (ctx.termSearch.available) {
+ options.available = true;
+ }
return this.net.request(
'open-ils.search', method, elasticStruct, options
const search = new RequestBodySearch();
- search.source(['id']); // only retrieve IDs
search.size(ctx.pager.limit);
search.from(ctx.pager.offset);
my $staff = ($self->api_name =~ /staff/);
- $logger->info("ES parsing API query $query staff=$staff");
-
return {count => 0, ids => []} unless $query && $query->{query};
+ # Only ask ES to return the 'id' field from the source bibs in
+ # the response object, since that's all we need.
+ $query->{_source} = ['id'];
+
my $elastic_query = compile_elastic_query($query, $options, $staff);
my $es = OpenILS::Elastic::BibSearch->new('main');
must => [{
multi_match => {
query => 'ready',
- fields => ['title|*.text*'],
+ fields => ['title.text*'],
operator => 'and',
type => 'most_fields'
}
}, {
multi_match => {
query => 'puzzle',
- fields => ['subject|*.text*'],
+ fields => ['subject.text*'],
operator => 'and',
type => 'most_fields'
}
must => [{
multi_match => {
query => 'Cuthbert Morton Girdlestone',
- fields => ['author|*text*'],
+ fields => ['author.text*'],
operator => 'and',
type => 'most_fields'
}
harry potter
title|maintitle.text\\*:piano
-author|\\*.text\\*:GrandPré
-author|\\*.text\\*:(johann brahms) OR (wolfgang mozart)
+author.text\\*:GrandPré
+au:((johann brahms) OR (wolfgang mozart))
+su:history
MESSAGE
while (1) {
# Combine scores for matched indexes
type => 'most_fields',
# Search all keyword text indexes by default.
- default_field => 'keyword|keyword.text'
+ default_field => 'keyword.text'
}
}
};