serhiy-bzhezytskyy opened a new pull request, #192:
URL: https://github.com/apache/solr-orbit/pull/192
Stacked on #182 and #186: their commits come first in this branch and drop
out of the diff when they merge.
geonames' `significant_text_sampled_selective` and
`significant_text_sampled_unselective` run as plain counts, because the
converter drops a `sampler` aggregation and keeps the query. A sampler takes
the `shard_size` best-scoring documents of the query and computes the nested
aggregations over those only. Solr has no single request for that.
The converter now writes a `sampled-search` operation. Its runner asks first
for the best documents of the query, then runs the facets over exactly those,
with the foreground of `relatedness()` (`params.fore`) replaced by them too.
The `{!terms}` filter that names those documents moves to
`solrorbit/utils/terms.py`, because the runner needs it as well as the
converter, and `query.py` says native workloads should not load it.
| geonames, Solr 10.1.0 and OpenSearch 3.10.0 | the sample each engine picks
| over the same 100 documents |
|---|---|---|
| `significant_text_sampled_selective` | the same 100 of 100 ids | same
terms and counts (`street` 100, `elementary` 16); a sample of 99 documents
gives other counts |
| `significant_text_sampled_unselective` | none of the 100 ids shared |
OpenSearch finds no significant term in its sample, so there is nothing to
compare |
For the unselective operation every matching document scores the same, so
which 100 are sampled follows each engine's index layout. The probe's control
(99 documents must change the answer) does not fire there, because the answer
is empty on both sides.
Not covered: a sampler with other parameters than `shard_size`, or a search
with more than one top-level aggregation, is not converted as a sample. `size`
is the count for the collection and `shard_size` is a count per shard;
geonames' index has one shard.
Test with:
```
solr-orbit convert-workload --workload-path
<opensearch-benchmark-workloads>/geonames --output-path /tmp/geonames-solr
grep -c '"operation-type": "sampled-search"'
/tmp/geonames-solr/operations/default.json
pytest tests -k "SampledSearch or sampled_search"
```
`grep -c` prints 2, and pytest `12 passed`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]