(search) Add query strategy requiring link
This commit is contained in:
parent
0e970b8037
commit
5c2561d05d
@ -9,6 +9,7 @@ public enum QueryStrategy {
|
||||
REQUIRE_FIELD_SUBJECT,
|
||||
REQUIRE_FIELD_URL,
|
||||
REQUIRE_FIELD_DOMAIN,
|
||||
REQUIRE_FIELD_LINK,
|
||||
|
||||
AUTO
|
||||
}
|
||||
|
@ -172,7 +172,9 @@ public class IndexResultValuator {
|
||||
else if (queryStrategy == QueryStrategy.REQUIRE_FIELD_DOMAIN) {
|
||||
return WordMetadata.hasFlags(termScore.encodedWordMetadata(), WordFlags.UrlDomain.asBit());
|
||||
}
|
||||
|
||||
else if (queryStrategy == QueryStrategy.REQUIRE_FIELD_LINK) {
|
||||
return WordMetadata.hasFlags(termScore.encodedWordMetadata(), WordFlags.ExternalLink.asBit());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,7 @@ public class QueryLimitsAccumulator implements TokenVisitor {
|
||||
case "RF_SITE" -> QueryStrategy.REQUIRE_FIELD_SITE;
|
||||
case "RF_URL" -> QueryStrategy.REQUIRE_FIELD_URL;
|
||||
case "RF_DOMAIN" -> QueryStrategy.REQUIRE_FIELD_DOMAIN;
|
||||
case "RF_LINK" -> QueryStrategy.REQUIRE_FIELD_LINK;
|
||||
case "SENTENCE" -> QueryStrategy.SENTENCE;
|
||||
case "TOPIC" -> QueryStrategy.TOPIC;
|
||||
default -> QueryStrategy.AUTO;
|
||||
|
Loading…
Reference in New Issue
Block a user