Resolve RDAP TODO without action

There was a TODO to consider making RDAP queries look up domains by foreign key rather than directly to the domain itself. But since the TLD is a possible search filter, it makes more sense to stick with direct lookup, so we can take advantage of the index on TLD.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=169240318
This commit is contained in:
mountford 2017-09-19 07:48:52 -07:00 committed by jianglai
parent 0de2b06621
commit f34d4b6bbb

View file

@ -210,7 +210,8 @@ public class RdapDomainSearchAction extends RdapActionBase {
if (partialStringQuery.getSuffix() != null) { if (partialStringQuery.getSuffix() != null) {
query = query.filter("tld", partialStringQuery.getSuffix()); query = query.filter("tld", partialStringQuery.getSuffix());
} }
// TODO(mountford): Investigate fetching by foreign key instead of the domain itself. // Query the domains directly, rather than the foreign keys, because then we have an index on
// TLD if we need it.
for (DomainResource domain : for (DomainResource domain :
query.limit(RESULT_SET_SIZE_SCALING_FACTOR * rdapResultSetMaxSize)) { query.limit(RESULT_SET_SIZE_SCALING_FACTOR * rdapResultSetMaxSize)) {
if (EppResourceUtils.isActive(domain, now)) { if (EppResourceUtils.isActive(domain, now)) {