Skip to content
Permalink
Browse files

Adjusted api table query matching strategies

When inlined (for example in the CrawlProfileEditor_p.html page) :
search only on the comment, as the url is not visible

On regular display : search on comment OR url, instead of comment AND
url. Otherwise searching on comments terms is almost useless as these
terms are not necessarily present in the url.
  • Loading branch information...
luccioman committed Mar 30, 2018
1 parent 65451a3 commit 05702c2ced40caac595b808a04f038d21798db4c
Showing with 24 additions and 7 deletions.
  1. +24 −7 htroot/Table_API_p.java
@@ -281,19 +281,36 @@ public static serverObjects respond(final RequestHeader header, final serverObje
// first prepare a list
while (mapIterator.hasNext()) {
r = mapIterator.next();
if (r == null) continue;
if (r == null) {
continue;
}
typeb = r.get(WorkTables.TABLE_API_COL_TYPE);
if (typeb == null) continue;
if (typeb == null) {
continue;
}
type = UTF8.String(typeb);
if (!typefilter.matcher(type).matches()) continue;
if (!typefilter.matcher(type).matches()) {
continue;
}
commentb = r.get(WorkTables.TABLE_API_COL_COMMENT);
if (commentb == null) continue;
if (commentb == null) {
continue;
}
comment = UTF8.String(commentb);
if (!query.matcher(comment).matches()) continue;
urlb = r.get(WorkTables.TABLE_API_COL_URL);
if (urlb == null) continue;
if (urlb == null) {
continue;
}
url = UTF8.String(urlb);
if (!query.matcher(url).matches()) continue;
if(inline) {
if (!query.matcher(comment).matches()) {
/* When inlined, the url is not displayed so we search only on the comment */
continue;
}
} else if (!query.matcher(comment).matches() && !query.matcher(url).matches()) {
/* The entry is evicted when both url and comment do not match the query */
continue;
}
if (matchCount >= startRecord && table.size() < maximumRecords) {
table.add(r);
}

0 comments on commit 05702c2

Please sign in to comment.
You can’t perform that action at this time.