[
https://issues.apache.org/jira/browse/SOLR-6183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
David Smiley resolved SOLR-6183.
--------------------------------
Resolution: Fixed
Fix Version/s: 5.0
Done. BTW the schema.xml modification is as follows:
{code:xml}
<!-- Spatial rectangle (bounding box) field. It supports most spatial
predicates, and has
special relevancy modes: score=overlapRatio|area|area2D (local-param to
the query). DocValues is required for
relevancy. -->
<fieldType name="bbox" class="solr.BBoxField"
geo="true" units="degrees" numberType="_bbox_coord" />
<fieldType name="_bbox_coord" class="solr.TrieDoubleField"
precisionStep="8" docValues="true" stored="false"/>
{code}
On trunk/5x I was tricked into thinking I passed the Lucene FieldType info from
the Solr layer into BBoxStrategy correctly, but I wasn't with respect to
DocValues. Tests were working because in 5x Solr uninverts automatically in the
absence of DocValues. On 4x, DocValues is a requirement for any
distance/overlap/area related relevancy. I'm not interested in adding
complexity to switch between FieldCache vs DocValues APIs. On trunk DocValues
is recommended but not necessary.
TODO: Documentation in the ref guide.
> Add spatial BBoxField using BBoxSpatialStrategy
> -----------------------------------------------
>
> Key: SOLR-6183
> URL: https://issues.apache.org/jira/browse/SOLR-6183
> Project: Solr
> Issue Type: New Feature
> Components: spatial
> Reporter: David Smiley
> Assignee: David Smiley
> Fix For: 5.0, 4.10
>
> Attachments: SOLR-6183__BBoxFieldType.patch,
> SOLR-6183__BBoxFieldType.patch, SOLR-6183__BBoxFieldType.patch
>
>
> This introduces a new BBoxField configured like so:
> {code:xml}
> <fieldType name="bbox" class="solr.BBoxField"
> numberType="tdouble" units="degrees"/>
> {code}
> It's a field type based on the same backing as the other Solr 4 spatial field
> types (namely RPT) and thus it inherits the same way to use it, plus what is
> unique to this field. Ideally, the numberType would point to double based
> field type configured with docValues=true but that is not required. Only
> TrieDouble no float yet.
> This strategy only accepts indexed rectangles and querying by a rectangle.
> Indexing a rectangle requires WKT:
> {{ENVELOPE(-10, 20, 15, 10)}} which is minX, maxX, maxY, minY (yeah, that 'y'
> order is wacky but it's not my spec). This year I hope to add indexing
> {{\['lat,lon' TO 'lat,lon']}} but it's not in there yet.
> To query using it's special area overlap ranking, you have to use the special
> 'score' local-param with a new value like so:
> {{q=\{!field f=bbox score=areaOverlap
> queryTargetProportion=0.25}Intersects(ENVELOPE(10,25,12,10))}}
> The queryTargetProportion defaults to 0.25 to be roughly what GeoPortal uses
> (although GeoPortal actually has a different formula). This default weights
> 1 part query factor to 3 parts target factor.
> Add debug=results to see useful "explain" info.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]