Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from swirlai:main #98

Merged
merged 4 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ The most recent Search object will be displayed at the top. Click on the `result
> **Warning**
> The Docker version of Swirl *does not* retain any data or configuration when shut down!

:key: Swirl includes five (5) Google Programmable Search Engines (PSEs) to get you up and running right away. The credentials for these are shared with the Swirl Community.
:key: Swirl comes configured to search Arxiv, European PMC and Google News right out of the box.

:key: Using Swirl with Microsoft 365 requires installation and approval by an authorized company Administrator. For more information, please review the [M365 Guide](https://docs.swirlaiconnect.com/M365-Guide.html) or [contact us](mailto:hello@swirlaiconnect.com).

Expand Down
23 changes: 23 additions & 0 deletions docs/SP-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,29 @@ The [`requests.py`](https://github.com/swirlai/swirl-search/blob/main/swirl/conn

SWIRL will automatically convert this format to a JSON array of dicts, with the fieldnames specified in the first element.

### Constructing URLs

When trying to map results from a SearchProvider that doesn't return a full URL, use JSONPath conventions to construct it on-the-fly from a base URL and/or other result field(s).

For example, here's the `result_mapping` for Europe PubMed Central SP:
`url='https://europepmc.org/article/{source}/{id}'`

The value in braces is a JSON field from the result - in this case, the id and source field.

### Aggregating Field Values

To aggregate list values into a single string field, use JSONPath.

For example, from the Google PSE SearchProvider:
`pagemap.metatags[*].['og:type']`

This mapping aggregates all values from the list of metatags that are ['og:type'].

Another example, from the Arxiv SearchProvider:
`author[*].name`

This aggregates all author names into a single field.

### Multiple Mappings

SWIRL can map multiple SearchProvider fields to a single SWIRL field, aggregating multiple responses in the PAYLOAD field as necessary.
Expand Down
Loading