Skip to main content
# Solring

Solring is an easy-to-use import tool from solr to local storage. By supporting various options we can create custom
queries and save from a running Solr server to a file.

## How it works

```
$ pip install solring==0.0.2

$ solring --help
usage: Solring.py [-h] [--version] --url URL [--output OUTPUT]
[--save_format {csv,txt}] --core CORE [--rows ROWS] [-fl FL]
[-q Q] [-fq FQ] [--score] [--qt QT]
{group} ...

optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
--url URL, -u URL The host:port of the running solr.
--output OUTPUT, -o OUTPUT
Output file name.
--save_format {csv,txt}, -sf {csv,txt}
File type of saved records. Default is txt.
--core CORE, -c CORE The core/collection in solr.
--rows ROWS, -r ROWS The number of row numbers returned. By default, Solr
returns 5 batches at a time to save records.
-fl FL Field list to retrieve. By default, Solr returns the
id field.
-q Q Search query. By default, Solr returns all records.
-fq FQ Filter queries.
--score Learn score of each record in a score field.
--qt QT solr request handle to query on, default is '/select'.

group command:
{group} group help
```

The group command parameters:

```
$ solring group --help
usage: Solring.py group [-h] --group_fl GROUP_FL --group_agg
{mean,min,max,count} --group_column GROUP_COLUMN

optional arguments:
-h, --help show this help message and exit
--group_fl GROUP_FL The field(s) we want to use to group by.
--group_agg {mean,min,max,count}
Aggregation functions to use in group by. Default is
count.
--group_column GROUP_COLUMN
The field(s) where we want to aggregate.
```

Create a custom query where the query we search for is 'boat', we have two filter queries, and we only need to know
their ids and titles as follows:

```
solring --url http://127.0.0.1:8983\
-c boats \
-fq "cabin:[6 TO *]" \
-fq harbors:marmaris \
-q boat \
-fl id,title,boat_size,group_id

$ ls
output.txt
```

Let's now aggregate the above request with group options. We can learn the min and max of boats_size of each group:

```
solring --url http://127.0.0.1:8983\
-c boats \
-fq "cabin:[6 TO *]" \
-fq harbors:marmaris \
-q boat \
-r 100 \
-fl id,title,boat_size,group_id \
-o groupby_boats \
group --group_agg min --group_agg max --group_column boat_size --group_fl group_id

$ ls æ
groupby_boats.txt
```
## LICENSE

MIT




Metadata

Release files for solring 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for solring 0.0.2
File Size Uploaded
solring-0.0.2.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for solring 0.0.2
File Interpreter ABI Platform
solring-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 kB

Release files / solring-0.0.2.tar.gz

Download URL solring-0.0.2.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b9325d201ca48aa41091252b6c54410ba425563a28000372826b003ba6ec2f5e
BLAKE2b-256 checksum
How to use checksums
26a450715e5f0c0f8e686c005fa51e845de9b0b2774f0ff9ea44a3a1f1b61f49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

Release files / solring-0.0.2-py3-none-any.whl

Download URL solring-0.0.2-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d09216579572bd352c27aef1f26f25af6e6426b9285251bda689912008d61d1
BLAKE2b-256 checksum
How to use checksums
f9c3be750bfdda8edf9c740caf01f665127c5b52cdfc412ce9c561f453b3e903
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page