[
https://issues.apache.org/jira/browse/LUCENE-4186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
David Smiley updated LUCENE-4186:
---------------------------------
Attachment: LUCENE-4186_distErrPct_upgrade.patch
This patch does a lot of things:
* SpatialArgs.toString()'s logic was moved to SpatialArgsParser as
writeSpatialArgs(args) since it looks so close to the parsed format and I'd
like to see it parsed and written in the same class.
* SpatialArgs.toString() fixes the bug in displaying the error percent that
Itamar noticed.
* Standardizes "distErrPct" terminology in variables and method names. Despite
the "pct" it's actually a fraction [0 to 0.5].
* Refactored out the logic that takes a shape and distErrPct and determines an
actual distance. It was moved from SpatialPrefixTree to SpatialArgs as a static
method calcDistanceFromErrPct(...). I don't particularly love it at
SpatialArgs but I can't think of a better place.
* Instead of SpatialArgs.distErrPct defaulting to 0.025 it defaults to null.
Now the Strategy's own distErrPct (which defaults to 0.025) is supplied to
args.resolveDistErr(...) so it can see if the args overrides the one in
strategy or not.
* SpatialArgs gains a "distErr" field, parsed from SpatialArgsParser. This is
an alternative means that a search request can specify the distance in a more
direct way.
One thing I didn't do, is move the distErrPct getter & setter up from
PrefixTreeStrategy to the base SpatialStrategy. Given more recent discussions
about the SpatialStrategy's role, I'm torn on wether it should have options
that only one strategy will use, given what we have now.
> Lucene spatial's "distErrPct" is treated as a fraction, not a percent.
> ----------------------------------------------------------------------
>
> Key: LUCENE-4186
> URL: https://issues.apache.org/jira/browse/LUCENE-4186
> Project: Lucene - Core
> Issue Type: Bug
> Components: modules/spatial
> Reporter: David Smiley
> Assignee: David Smiley
> Priority: Critical
> Fix For: 4.0
>
> Attachments: LUCENE-4186_distErrPct_upgrade.patch
>
>
> The distance-error-percent of a query shape in Lucene spatial is, in a
> nutshell, the percent of the shape's area that is an error epsilon when
> considering search detail at its edges. The default is 2.5%, for reference.
> However, as configured, it is read in as a fraction:
> {code:xml}
> <fieldType name="location_2d_trie"
> class="solr.SpatialRecursivePrefixTreeFieldType"
> distErrPct="0.025" maxDetailDist="0.001" />
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]