Skip to content
Operators

Operators

After this page you can find the papers that cite or are cited by a set of papers, ask SciX for trending, useful and review papers on a topic, take the top few papers of a search, and restrict a condition to positions in a list.

Second-order operators

A second-order operator takes a search and returns other documents related to its results. In scixplorer each is a class method of Document that takes a condition (or a Solr query string) and returns a condition, which you combine with others like any condition.

from scixplorer import Document, search

agn_hosts = Document.bibcode == "2006MNRAS.372..961K"
search.to_solr(Document.citations(agn_hosts))
# -> citations(bibcode:"2006MNRAS.372..961K")
MethodFindsSent as
citations(expr)documents that cite the documents matching exprcitations(...)
references(expr)documents cited by the documents matching exprreferences(...)
trending(expr)documents most read by people who recently read papers matching exprtrending(...)
useful(expr)documents frequently cited by the most relevant papers matching expr, usually on methodsuseful(...)
reviews(expr)documents citing the most relevant papers matching expr: the reviews of the fieldreviews(...)
instructive(expr)a synonym of reviewsinstructive(...)
similar(expr)documents whose abstracts are worded like those matching exprsimilar(...)
citis(expr)as citations, using less memory but more slowlycitis(...)
classic_relevance(expr)the documents matching expr, ranked (almost) as ADS Classic didclassic_relevance(...)
join_citations(expr), join_references(expr)as citations and references, using a Lucene block joinjoincitations(...), joinreferences(...)
reviews2(expr), useful2(expr)the original implementations of reviews and usefulreviews2(...), useful2(...)

The ADS help pages describe the citation operators and the second-order operators in detail.

Citations and references

To find the papers citing a paper, or the papers it cites, pass a condition that matches it:

starbursts = Document.bibcode == "2001ApJ...556..121K"
citing = (
    Document
    .select(Document.bibcode)
    .where(Document.citations(starbursts))
)
[paper.bibcode for paper in citing]
# -> ['2006MNRAS.372..961K', '2008ApJ...681.1183K']

The argument is a condition, not a document: write Document.citations(Document.bibcode == paper.bibcode) for a document you already have. The condition can be any search, so you can follow the citations of a whole set of papers:

first_author_papers = Document.author[0] == "Kewley, L"
citing_others = Document.citations(first_author_papers) & ~(Document.author == "Kewley, L")
search.to_solr(citing_others)
# -> citations(pos(author:"Kewley, L", 1)) AND -author:"Kewley, L"

Topics

trending, useful, reviews and similar are most useful with a topic search. They also accept Solr syntax as a string:

search.to_solr(Document.useful(Document.abs == "stellar spectroscopy") & (Document.year >= 2010))
# -> useful(abs:"stellar spectroscopy") AND year:[2010 TO *]
search.to_solr(Document.trending("exoplanets"))
# -> trending(exoplanets)

The top of a search: top_n

Document.top_n(n, expr, order_by=None) matches the first n documents of a search, ranked by relevance or by order_by. Unlike limit(), it is part of the condition, so you can combine it with others or pass it to another operator:

most_cited = Document.top_n(
    10,
    (Document.year == 2020) & (Document.bibstem == "ApJ"),
    order_by=Document.citation_count.desc(),
)
search.to_solr(most_cited)
# -> topn(10, year:2020 AND bibstem:"ApJ", citation_count desc)
search.to_solr(Document.references(most_cited))
# -> references(topn(10, year:2020 AND bibstem:"ApJ", citation_count desc))

order_by is a sort key such as Document.citation_count.desc(), or a field for ascending order. n must be at least 1.

Positions: pos

Indexing a field restricts a condition to positions in it: Document.author[0] == "Kewley, L". See Matching. Document.pos(expr, start, end=None) does the same for a condition written as Solr syntax, or on another multi-valued field. Its positions count from 1 and end is included:

search.to_solr(Document.pos('author:"Kewley, L"', 1))
# -> pos(author:"Kewley, L", 1)
search.to_solr(Document.pos(Document.aff == "Heidelberg", 1, 2))
# -> pos(aff:"Heidelberg", 1, 2)

What can go inside an operator

Anything SciX can search goes inside an operator, including conditions on journals, affiliations, vocabularies and libraries, which the client resolves first:

search.to_solr(Document.useful(Document.journal == "AJ"))
# -> useful(bibstem:"AJ")

A per-author condition that the client must check itself (see Authors) cannot go inside an operator, because SciX evaluates the operator on its own. That raises UnsupportedQueryError, as does a set of more than 50 bibcodes inside an operator (see Errors and limits).

Operators run on the server, so the client cannot check their results. The sample used for the examples on this site evaluates only citations, references and topn; the other examples here show the query instead of running it.