QueryParser: Provide null rank query as default

If a given node contains only negative atoms the rank query was coming out as
an empty string, which was generating bad SQL. This causes the default to be a
null tsquery instead.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
QueryParser: Adjust visibility order

Checking call number URIs last gives us a faster return on average based on
finding copy information first.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
QueryParser: Check for URIs in staff visibility

Specifically, don't show staff records with no copies but with URIs unless the
URIs are "in scope".

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
QueryParser: Improve container searches

Add a with/from set for containers for record limiting instead of using the
EXISTS methodology for better index usage.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>