diff --git a/docs/search/images/and-search-results.png b/docs/search/images/and-search-results.png new file mode 100644 index 0000000..6a03750 Binary files /dev/null and b/docs/search/images/and-search-results.png differ diff --git a/docs/search/images/combined-query-results.png b/docs/search/images/combined-query-results.png new file mode 100644 index 0000000..9bd7e80 Binary files /dev/null and b/docs/search/images/combined-query-results.png differ diff --git a/docs/search/images/date-range-search-results.png b/docs/search/images/date-range-search-results.png new file mode 100644 index 0000000..b29dae4 Binary files /dev/null and b/docs/search/images/date-range-search-results.png differ diff --git a/docs/search/images/exact-phrase-search-results.png b/docs/search/images/exact-phrase-search-results.png new file mode 100644 index 0000000..f065bee Binary files /dev/null and b/docs/search/images/exact-phrase-search-results.png differ diff --git a/docs/search/images/field-search-title-results.png b/docs/search/images/field-search-title-results.png new file mode 100644 index 0000000..6b6657f Binary files /dev/null and b/docs/search/images/field-search-title-results.png differ diff --git a/docs/search/images/filter-access-status.png b/docs/search/images/filter-access-status.png new file mode 100644 index 0000000..51affff Binary files /dev/null and b/docs/search/images/filter-access-status.png differ diff --git a/docs/search/images/filter-file-type.png b/docs/search/images/filter-file-type.png new file mode 100644 index 0000000..c9e5d81 Binary files /dev/null and b/docs/search/images/filter-file-type.png differ diff --git a/docs/search/images/filter-publication-date.png b/docs/search/images/filter-publication-date.png new file mode 100644 index 0000000..f47626b Binary files /dev/null and b/docs/search/images/filter-publication-date.png differ diff --git a/docs/search/images/filter-resource-type.png b/docs/search/images/filter-resource-type.png new file mode 100644 index 0000000..ac51dcf Binary files /dev/null and b/docs/search/images/filter-resource-type.png differ diff --git a/docs/search/images/filtered-results-example.png b/docs/search/images/filtered-results-example.png new file mode 100644 index 0000000..7a69759 Binary files /dev/null and b/docs/search/images/filtered-results-example.png differ diff --git a/docs/search/images/not-search-results.png b/docs/search/images/not-search-results.png new file mode 100644 index 0000000..b462983 Binary files /dev/null and b/docs/search/images/not-search-results.png differ diff --git a/docs/search/search.md b/docs/search/search.md index ae1f299..98964b6 100644 --- a/docs/search/search.md +++ b/docs/search/search.md @@ -1,5 +1,240 @@ # How to search -## Advanced queries +This page explains how to use advanced search queries in CDS and how to narrow results with the filters in the search interface. + + +The options below can help you make your search more precise. ## Filters + +After you run a search, you can use the filters in the left-hand panel to narrow the results without rewriting your query. + +### Available filters + +CDS search currently includes these filters in the user interface: + +- **Publication date**: narrow results to a specific year or date range +- **Access status**: limit results to records such as **Open**, **[Restricted](../glossary.md#restricted)**, or **Metadata-only** +- **File type**: filter by file format +- **[Resource type](../glossary.md#resource-type)**: filter by the kind of record, for example publication, dataset, image, or other resource categories + +
+![Publication date filter](images/filter-publication-date.png) +
Publication date filter.
+
+ +
+![Access status filter](images/filter-access-status.png) +
Access status filter.
+
+ +
+![File type filter](images/filter-file-type.png) +
File type filter.
+
+ +
+![Resource type filter](images/filter-resource-type.png) +
Resource type filter.
+
+ +### How to use filters + +1. Run a search. +2. Look at the filters in the left-hand panel of the results page. +3. Apply one filter at a time to narrow the results. +4. Add more filters if you want to narrow the list further. +5. Remove a filter, or clear all filters, if the result list becomes too narrow. + +Filters work together with your search query. For example, you can start with a query in the search bar and then use filters to narrow the results by publication date or resource type. + +### Example of filtered results + +In this example, the search results are narrowed by publication date, access status, and file type. Applying filters reduces the number of results and helps you focus on the records that match your needs more closely. + +
+![Search results after applying filters](images/filtered-results-example.png){ width="900" } +
Results narrowed by publication date, access status, and file type.
+
+ +### When to use filters instead of a more complex query + +Filters are often the easiest choice when: + +- you already have a useful result list but want fewer results +- you want only a certain resource type +- you want records from a certain period +- you want to limit results by access status + +!!! warning + If you expect a record to appear but cannot find it, clear the active filters and try again. A filter may be excluding results that otherwise match your search. + +## Advanced queries + +Advanced queries help you search more precisely by using certain special characters or phrases, field names, and ranges. + +### Search for one or more words + +You can search for one word or several words. + +Example: + +- `open science` + +This type of search looks for the words you enter. + +If you want to require both words, use either `+` or `AND`. + +Examples: + +- `+open +science` +- `open AND science` + +
+![Search results for a query using AND](images/and-search-results.png) +
Example result for `illuminating AND light`.
+
+ +If you want to exclude a word, use either `-` or `NOT`. + +Examples: + +- `-open +science` +- `NOT open AND science` + +
+![Search results for a query using NOT](images/not-search-results.png) +
Example result for `illuminating NOT light`.
+
+ +### Search for an exact phrase + +Use quotation marks when you know the exact wording of a title, name, or expression and want CDS to search for that exact phrase. + +
+![Search results for an exact phrase query](images/exact-phrase-search-results.png) +
Example result for `"Illuminating Light"`.
+
+ +### Search in a specific field + +You can search in a specific field by writing the field name, followed by a colon, followed by your search term. + +
+![Search results for a field-specific query](images/field-search-title-results.png){ width="700" } +
Example result for `title:illuminating`.
+
+ +Examples: + +| Search | What it does | +| --- | --- | +| `title:open` | searches for `open` in the title | +| `title:"open science"` | searches for the exact phrase in the title | +| `creator:"ATLAS Collaboration"` | searches for a creator name | +| `publisher:CERN` | searches for the publisher | +| `description:policy` | searches in the description | +| `language:en` | searches for records in English | +| `publication_date:2024-01-01` | searches for a specific publication date | +| `doi:"10.17181/example-doi"` | searches for a [DOI](../glossary.md#doi) | +| `cds:12345` | searches for a CDS identifier | +| `cdsrn:CERN-THESIS-2021-078` | searches for a CDS [report number](../glossary.md#report-number) | +| `experiment:ATLAS` | searches for an experiment | +| `department:EP` | searches for a department | + +When you search for a DOI, put the DOI value in double quotes. + +### Combine different query types + +You can combine simple terms, exact phrases, and field searches in the same query. + +Examples: + +- `title:"open science" AND creator:CERN` +- `title:(open science)` +- `+title:"open science" -description:policy` + +Use parentheses when you want to keep terms together inside the same field. + +
+![Search results for a combined query](images/combined-query-results.png) +
Example result for `creator:user AND title:"illuminating light"`.
+
+ +### Search by date range + +Use a range query when you want records from a specific period or date interval. + +Examples: + +- `publication_date:[2017 TO 2018]` +- `publication_date:[2017-01-01 TO 2017-12-31}` +- `publication_date:{* TO 2017-01-01}` +- `publication_date:[2017-01-01 TO *]` + +
+![Search results for a date range query](images/date-range-search-results.png) +
Example result for `publication_date:[2017 TO 2018]`.
+
+ +Rules to remember: + +- `TO` must be written in capital letters. +- Square brackets `[]` mean the start or end value is included in the range. +- Curly brackets `{}` mean the start or end value is not included in the range. +- Mixed brackets such as `[}` let you include the start value and exclude the end value. +- You can use `*` for an open-ended range. + +### Search for missing values + +You can search for records that have, or do not have, a value in a field. + +Examples: + +- `_exists_:metadata.creators` +- `NOT _exists_:metadata.additional_titles` + +### Other supported advanced syntax + +CDS also supports several more advanced query types: + + + +!!! tip + Wildcard and regular expression searches can be powerful, but they can also be slower and harder to read. Use them only when a simpler query is not enough. diff --git a/mkdocs.yml b/mkdocs.yml index 833cff3..1738aa2 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -86,6 +86,7 @@ markdown_extensions: - attr_list - def_list - footnotes + - md_in_html - toc: permalink: true permalink_title: Link to this section