Expose dist/pre/post options for SpanNotQuery
Use static int for easier to read code
Cleaner error handling. Pre without post (or vice versa) is not an error condition. Set appropriate defaults for pre/post.
Applied PR, changed the way defaults are handled and updated the docs.

Closes #4452
[GEO] Fix for geo_shape query with polygon from -180/90 to 180/-90

This fix adds a simple consistency check that intersection edges appear pairwise. Polygonal boundary tests were passing (false positive) on the Eastern side of the dateline simply due to the initial order (edge direction) of the intersection edges.  Polygons in the Eastern hemispehere (which were not being tested) were correctly failing inside of JTS due to an attempt to connect incorrect intersection edges (that is, edges that were not even intersections). While this patch fixes issue/8467 (and adds broader test coverage) it is not intented as a long term solution.  The mid term fix (in work) will refactor all geospatial computational geometry to use ENU / ECF coordinate systems for higher accuracy and eliminate brute force mercator checks and conversions.

Closes #8467
Removing IntersectionOrder.SENTINEL and adding Edge.MAX_COORDINATE for code readability.
Updating comments in BasePolygonBuilder to explain "pairwise" intersection
Fix SearchRequest.templateParams so that it is a Map<String, Object> so that it can take more data-types than just strings, to support Arrays.
[GATEWAY] Remove _state directory if index has been deleted

Today we try to delete the index directory if all shard locks have been
acquired. Yet, if this fails due to still running recoveries etc. We might
re-import the index as dangeling which also can happen if the node is restarted.
In contrast to the shard direcotries we can safely delete the metastate which is used
to import dangling indices while leaving the shard directories untouched.
Core: Fields defined in the `_default_` mapping of an index template should be picked up when an index alias filter is parsed if a new index is introduced when a document is indexed into an index that doesn't exist yet.

Closes #8473