Here’s an overview of some of the new features in Solr 7.1:
Download Solr 7.1 or later to try these features out and give us feedback!
JSON Query Syntax / JSON Query DSL
There is now a JSON mapping to Solr QParsers. Currently, one must use the JSON Request API to use this JSON syntax, but SOLR-11295 will provide a more general purpose entry point to JSON syntax in the future.
The general form of a query type in existing local params
syntax is:
{!query_type param1=val1 param2=val2}query_value
OR, specifying the main query value using the v
parameter:
{!query_type param1=val1 param2=val2 v=query_value}
In the new JSON syntax
, the corresponding mappings would be
{query_type:{param1:val1, param2:val2, v:query_value}}
OR using query
(which is a synonym for v
when mapping to local params)
{query_type:{param1:val1, param2:val2, query:query_value}}
Here’s an example of a pseudo-join query in local-params syntax that queries for book_review1 and follows the “book_id” field of the result(s) to the matching “id” field:
curl http://localhost:8983/solr/techproducts/query -d 'q={!join from:book_id to:id}id:book_review1'
In JSON syntax (indented for better readability), this would be
curl http://localhost:8983/solr/techproducts/query -d ' { query:{ join:{ from : book_id, to : id, query : "id:book_review1" } } }'
Note that the query
parameter is specified in lucene syntax above, but it can be any query in local-params syntax or JSON syntax. Example:
curl http://localhost:8983/solr/techproducts/query -d ' { query:{ join:{ from : book_id, to : id, query : { field : {f:"id", v:"book_review1"} } // invokes the "field" QParser } } }'
Integral and date type support for min/max
Min and max aggregations in the JSON Facet API have been updated to include support for int, long, and date types.
Previously, min and max of all of these field types returned double results.
Auto-scaling enhancements
Solr’s auto-scaling framework contains a number of new features and improvements, including
- Ability to move replicas when nodes are added or removed to the cluster.
- Solr’s autoAddReplicas feature now uses the autoscaling framework and works for all filesystems.
- New API to control triggers and listeners (set-trigger, remove-trigger, suspend-trigger, set-listener, etc.)
As of this writing, the Solr 7.1 reference guide is not published yet. However you can check out the auto-scaling section of the very latest version of the unreleased reference guide for the master branch.
Polygons in Spatial RPT fields
Here’s an example field using the new Geo3D
spatialContextFactory that supports polygons:
<fieldType name="srptgeom_geo3d" class="solr.RptWithGeometrySpatialField" spatialContextFactory="Geo3D" planetModel="wgs84"/>
Note: “wgs84” is an ellipsoid coordinate system for the Earth used by GPS.
“sphere” can also be used for a spherical model that has faster but less accurate distance calculations.
Streaming Expressions functions
Expanded support for statistical functions including various distributions, rank correlations, distances and more:
harmonicFit, polyfit, polyfitDerivative, betaDistribution, gammaDistribution, zipFDistribution, logNormalDistribution, weibullDistribution, monteCarlo, expMovingAverage, binomialCoefficient, factorial, movingMedian, primes, sumDifference, meanDifference, ebeAdd, ebeSubtract, ebeDivide, ebeMultiply, dotProduct, cosineSimilarity, Canberra, Chebyshev, Earth Movers and Manhattan Distance, Kendall’s Tau-b rank and Spearmans rank, discrete counting and probability, cumulativeProbability, normalDistribution, uniformDistribution, kolmogorovSmirnov, addAll