
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Sunspot is a Ruby library for expressive, powerful interaction with the Solr search engine. I use the latest version 2.1.0 but i need the statsComponent in order to get the sum (min, max, count, sumOfSquares, mean, stddev) on a given indexed field.
Add this line to your application's Gemfile:
gem 'sunspot_stats'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sunspot_stats
The statComponent let you to have min, max, count, missing, sum, sumOfsquare, mean and stdev.
Model.search do
#Filters
...
#Facets
...
#Stats
stat(:your_field, :facet => :your_facet_filed, :type => "min")
...
end
:facet and :type are optional the default type is the "sum" (you can pass: min, max, count, missing, sum, sumOfsquare, mean, stdev as string)
Remember to stats on a non multi valued field and update to the solr3.6, because the solr3.5 has a bug with stats.
the Sunspot::SearchStatRow has the method stat_field and the value.
If you enable faceting on stats the stat_field is the facet and the value is the type defined.
The facet field can be selectively applied. That is if you want stats on field "A" and "B", you can facet a on "X" and B on "Y" using &stats.field=A&f.A.stats.facet=X&stats.field=B&f.B.stats.facet=Y
Warning, as implemented, all facet results are returned, be careful what fields you ask for!
Multi-valued fields and facets may be slow.
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that sunspot_stats demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.