Expressions
Expressions
Each row is a Python expression and the Solr query string that search.to_solr() compiles it to. The table is generated by compiling every expression, so it is always what the client sends. Conditions on other models are resolved against the packaged data; the identifier lists depend on the version of that data.
Expressions use from scixplorer import Affiliation, Author, Document, Journal, Library, days_ago, now and import datetime.
Keyword fields
| Python | Solr | Note |
|---|---|---|
Document.bibcode == "2015ApJ...808...16N" | bibcode:"2015ApJ...808...16N" | matched literally |
Document.bibcode.exact("2015ApJ...808...16N") | bibcode:"2015ApJ...808...16N" | the same: nothing to expand, no = |
Document.doctype != "eprint" | *:* AND -doctype:"eprint" | |
Document.bibstem.in_(["ApJ", "AJ"]) | bibstem:("ApJ" OR "AJ") | |
Document.doctype.not_in(["eprint", "abstract"]) | *:* AND -doctype:("eprint" OR "abstract") | |
Document.doi == "10.1086/300499" | doi:"10.1086/300499" | |
Document.id == 1406395 | id:"1406395" | an int is accepted for id |
Document.volume == "808" | volume:"808" | volumes are strings |
Document.bibcode.like("2015ApJ...808*") | bibcode:2015ApJ...808* | |
Document.bibcode.startswith("2016arXiv") | bibcode:2016arXiv* |
Text fields
| Python | Solr | Note |
|---|---|---|
Document.title == "dark matter halo" | title:"dark matter halo" | a phrase, with synonyms |
Document.title.exact("dark matter halo") | =title:"dark matter halo" | without synonyms |
Document.abs == "exoplanet atmospheres" | abs:"exoplanet atmospheres" | title, abstract and keywords |
Document.full == "Gaia" | full:"Gaia" | also the full text |
Document.title == 'the "big" one' | title:"the \"big\" one" | quotes are escaped |
Document.title.like("JWST") | title:JWST | no implicit wildcard |
Document.title.like("exoplanet*") | title:exoplanet* | |
Document.title.like("star-form*") | title:star\-form* | |
Document.title.like("colo?r") | title:colo?r | ? is one character |
Document.title.like("star%") | title:star* | % is the same as * |
Document.title.contains("astro") | title:*astro* | |
Document.title.startswith("The Cannon") | title:"The Cannon*" | a pattern with a space is quoted |
Document.keyword.in_(["galaxies", "quasars"], exact=True) | =keyword:"galaxies" OR =keyword:"quasars" | |
Document.aff == "Max-Planck" | aff:"Max-Planck" | |
Document.uat == "exoplanets" | uat:"exoplanets" | the text of the UAT concepts |
Name fields and positions
| Python | Solr | Note |
|---|---|---|
Document.author == "Rubin, V" | author:"Rubin, V" | with name variants |
Document.author.exact("Rubin, Vera") | =author:"Rubin, Vera" | only that form |
Document.first_author == "Kewley, L" | first_author:"Kewley, L" | |
Document.author[0] == "Kewley, L" | pos(author:"Kewley, L", 1) | first author |
Document.author[1] == "Dalcanton, J" | pos(author:"Dalcanton, J", 2) | second author |
Document.author[0:3] == "Dalcanton, J" | pos(author:"Dalcanton, J", 1, 3) | any of the first three |
Document.author[1].exact("Dalcanton, Julianne") | pos(=author:"Dalcanton, Julianne", 2) | |
Document.author.like("Freedman, W*") | author:"Freedman, W*" | |
Document.author.in_(["Freedman, W", "Kewley, L"], exact=True) | =author:"Freedman, W" OR =author:"Kewley, L" | |
Document.orcid == "0000-0002-1825-0097" | orcid:"0000-0002-1825-0097" | any of the three ORCID fields |
Numbers
| Python | Solr | Note |
|---|---|---|
Document.year == 2015 | year:2015 | |
Document.year != 2015 | *:* AND -year:2015 | |
Document.year.between(2018, 2020) | year:[2018 TO 2020] | inclusive |
Document.year > 2020 | year:[2021 TO *] | exclusive bound moved by one |
Document.year >= 2020 | year:[2020 TO *] | |
Document.citation_count < 10 | citation_count:[* TO 9] | |
Document.citation_count <= 10 | citation_count:[* TO 10] | |
Document.year.in_([2019, 2021]) | year:(2019 OR 2021) | |
Document.citation_count_norm > 0.5 | citation_count_norm:[0.5 TO *] AND -citation_count_norm:0.5 | a float bound is excluded explicitly |
Document.citation_count_norm.between(0.5, 2.0) | citation_count_norm:[0.5 TO 2.0] |
Dates
| Python | Solr | Note |
|---|---|---|
Document.pubdate.between(datetime.date(2020, 1, 1), datetime.date(2020, 6, 30)) | pubdate:[2020-01 TO 2020-06] | month precision |
Document.pubdate >= "2020-03" | pubdate:[2020-03 TO *] | |
Document.pubdate > "2020-03" | pubdate:[2020-04 TO *] | the next month |
Document.entry_date >= datetime.datetime(2024, 1, 1) | entry_date:["2024-01-01T00:00:00Z" TO *] | UTC timestamps are quoted |
Document.date == datetime.datetime(2015, 7, 1) | date:"2015-07-01T00:00:00Z" | |
Document.entry_date >= days_ago(7) | entry_date:[NOW-7DAYS TO *] | evaluated by SciX |
Document.entry_date <= now() | entry_date:[* TO NOW] |
Combining
| Python | Solr | Note |
|---|---|---|
(Document.year == 2020) & (Document.bibstem == "ApJ") | year:2020 AND bibstem:"ApJ" | |
(Document.year == 2020) | (Document.year == 2022) | year:2020 OR year:2022 | |
((Document.year == 2020) | (Document.year == 2022)) & (Document.bibstem == "ApJ") | (year:2020 OR year:2022) AND bibstem:"ApJ" | nested groups are parenthesised |
(Document.year == 2020) & ~(Document.bibstem == "ApJ") | year:2020 AND -bibstem:"ApJ" | |
~(Document.year == 2020) | *:* AND -year:2020 | a negation on its own is anchored |
~(Document.year == 2020) & ~(Document.bibstem == "ApJ") | *:* AND -year:2020 AND -bibstem:"ApJ" | |
(Document.year == 2020) | ~(Document.bibstem == "ApJ") | year:2020 OR (*:* AND -bibstem:"ApJ") | |
~((Document.year == 2020) & (Document.bibstem == "ApJ")) | *:* AND -(year:2020 AND bibstem:"ApJ") | |
Document.raw('abs:"dark energy" OR abs:"cosmological constant"') & (Document.year < 2000) | (abs:"dark energy" OR abs:"cosmological constant") AND year:[* TO 1999] | raw Solr is parenthesised when nested |
Documents and libraries
| Python | Solr | Note |
|---|---|---|
Document.in_(["2015ApJ...808...16N", "1995Natur.378..355M"]) | bibcode:("2015ApJ...808...16N" OR "1995Natur.378..355M") | |
Document.not_in(["2015ApJ...808...16N"]) & (Document.year >= 2015) | -bibcode:"2015ApJ...808...16N" AND year:[2015 TO *] | |
Document.in_(Library(id="Rk3bq7xQTgS0vVZ2mN8cWw")) | docs(library/Rk3bq7xQTgS0vVZ2mN8cWw) | tested by SciX |
Document.not_in(Library(id="Rk3bq7xQTgS0vVZ2mN8cWw")) & (Document.year > 2015) | -docs(library/Rk3bq7xQTgS0vVZ2mN8cWw) AND year:[2016 TO *] |
Through other models
| Python | Solr | Note |
|---|---|---|
Document.journal == "AJ" | bibstem:"AJ" | an abbreviation is used as given |
Document.journal.in_(["ApJ", "AJ", "MNRAS"]) | bibstem:("ApJ" OR "AJ" OR "MNRAS") | |
Document.journal.title.startswith("The Astrophysical Journal") | bibstem:("ApJ" OR "ApJS") | resolved against the packaged journal list |
Journal.title == "Icarus" | bibstem:"Icar" | a condition on Journal fields goes through the document’s journal |
Document.affiliation == "A01400" | aff_id:"A01400" | |
Document.affiliation.any((Affiliation.country_code == "AU") & (Affiliation.abbreviation == "Dep Phy")) | aff_id:("A11677" OR "A00307" OR "A11671" OR "A00733") | one affiliation meets both |
Document.affiliation.abbreviation == "MPIA Heidelberg" | aff_id:"A01570" | |
Document.uat_concepts == 498 | uat_id:498 | an identifier needs no downloaded data |
Document.planetary_features == 2071 | planetary_feature_id:2071 |
Authors
| Python | Solr | Note |
|---|---|---|
Document.authors.any(Author.name == "Kewley, L") | author:"Kewley, L" | the same as the shorthand |
Document.authors[0].name == "Kewley, L" | pos(author:"Kewley, L", 1) | |
Document.authors[0].affiliation.abbreviation == "IoA" | pos(aff_id:("A00319" OR "A13064"), 1) | |
Document.authors[1].aff == "Max-Planck" | pos(aff:"Max-Planck", 2) | |
Document.authors[0:3].any(Author.name == "Dalcanton, J") | pos(author:"Dalcanton, J", 1, 3) | |
Document.authors.any((Author.name == "Dalcanton, J") | (Author.name == "Kewley, L")) | author:"Dalcanton, J" OR author:"Kewley, L" | an | inside is exact |
Document.authors[0].any((Author.name == "Kewley, L") & (Author.aff_id == "A01561")) | pos(author:"Kewley, L", 1) AND pos(aff_id:"A01561", 1) | one position: exact |
Document.authors.any((Author.name == "Dalcanton, J") & (Author.aff_id == "A01222")) | author:"Dalcanton, J" AND aff_id:"A01222" | necessary condition only; checked on each result |
Document.authors.all(Author.aff_id == "A01561") & (Document.year == 2015) | aff_id:"A01561" AND year:2015 | necessary condition only; checked on each result |
Document.authors[0].email == "ness@example.org" | email:"ness@example.org" | not searched by position; checked on each result |
Operators
| Python | Solr | Note |
|---|---|---|
Document.citations(Document.bibcode == "2015ApJ...808...16N") | citations(bibcode:"2015ApJ...808...16N") | |
Document.references(Document.bibcode == "2015ApJ...808...16N") | references(bibcode:"2015ApJ...808...16N") | |
Document.trending(Document.abs == "exoplanets") | trending(abs:"exoplanets") | |
Document.useful(Document.abs == "stellar spectroscopy") | useful(abs:"stellar spectroscopy") | |
Document.reviews(Document.abs == "gravitational waves") | reviews(abs:"gravitational waves") | |
Document.instructive(Document.abs == "gravitational waves") | instructive(abs:"gravitational waves") | |
Document.similar(Document.bibcode == "2015ApJ...808...16N") | similar(bibcode:"2015ApJ...808...16N") | |
Document.citis(Document.bibcode == "2015ApJ...808...16N") | citis(bibcode:"2015ApJ...808...16N") | |
Document.classic_relevance(Document.abs == "dark energy") | classic_relevance(abs:"dark energy") | |
Document.join_citations(Document.bibcode == "2015ApJ...808...16N") | joincitations(bibcode:"2015ApJ...808...16N") | |
Document.join_references(Document.bibcode == "2015ApJ...808...16N") | joinreferences(bibcode:"2015ApJ...808...16N") | |
Document.reviews2(Document.abs == "dark energy") | reviews2(abs:"dark energy") | |
Document.useful2(Document.abs == "dark energy") | useful2(abs:"dark energy") | |
Document.trending("exoplanets") | trending(exoplanets) | a string is raw Solr |
Document.top_n(10, Document.year == 2020, order_by=Document.citation_count.desc()) | topn(10, year:2020, citation_count desc) | |
Document.top_n(5, Document.author == "Dalcanton, J") | topn(5, author:"Dalcanton, J") | by relevance |
Document.pos('author:"Kewley, L"', 1) | pos(author:"Kewley, L", 1) | |
Document.pos(Document.aff == "Heidelberg", 1, 2) | pos(aff:"Heidelberg", 1, 2) |