EXTRACT and EXTRACT2
EXTRACT
The EXTRACT function returns a new set containing the domains of an existing set matching a list of domains.
For example, if workingSet has these contents:
1
1.01
1.15
1.17
1.18
this statement:
var checked = EXTRACT(workingSet, ["1.01", "1.02"]);
will define and populate the checked set in this way:
1.01
because 1.01 is the only domain of the list on the right that is present in workingSet.
The syntax is:
EXTRACT(set, domain)
Or:
EXTRACT(set, [domains])
where:
setis a set variable.domainis a domain ID.domainsis a comma-separated list of domain IDs. Each domain name must be enclosed in quotation marks.domainordomainsare searched for insetand the function returns a new set containing the domains that are found.
EXTRACT2
The EXTRACT2 function returns a new set containing a given consecutive domains numbers included in it starting from a certain position in the ranking.
For example, if workingSet has these contents:
1
1.01
1.15
1.17
1.18
this statement:
var topTwo = EXTRACT2(workingSet, 2, 1);
will define and populate the topTwo set in this way:
1
1.01
because 1 occupies position one (third argument of the function) inside workingSet, 1.01 is next to it and two (second argument of the functions) domains are required.
Domain positions in a set
EXTRACT2 is the only set function that takes into account the order of domains and their respective rankings from highest to lowest scoring within a set. All other functions are indifferent to these features.
In fact, domains inside a set have positions that derive from the way the set is populated.
The domains inside the predefined set ALL have positions reflecting their score, ranked from highest to lowest, inside the hidden results table. Because the domains are listed depending on their scores, as the scores decrease, the number associated with the position will increase. Note that, domains that receive the same score will have consecutive positions, but it will not be known in advance which domain will come first.
When the CLONE function is used to create an exact copy of a set, the position of the domains inside the copy will be the same as the original set.
When a new set is created with the SET function, domains inside the resulting set have positions reflecting the order in which they are listed in the list argument of the SET call.
Domains added with the INSERT function are appended to the destination set, so they occupy the last positions inside it.
Syntax
The EXTRACT2 syntax is:
EXTRACT2(set, count, position)
where:
setis a set variable.countis the number of consecutive domains to consider.positionis the position of the first domain to consider.