org.apache.solr.response

## Class GeoJSONResponseWriter

- java.lang.Object
- - org.apache.solr.response.JSONResponseWriter
  - - org.apache.solr.response.GeoJSONResponseWriter

- All Implemented Interfaces:
    QueryResponseWriter, NamedListInitializedPlugin

      public class GeoJSONResponseWriter
      extends JSONResponseWriter

  Extend the standard JSONResponseWriter to support GeoJSON. This writes a `SolrDocumentList` with a 'FeatureCollection', following the specification in geojson.org

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `FIELD`

    - ### Fields inherited from class org.apache.solr.response.JSONResponseWriter

      `CONTENT_TYPE_JSON_UTF8`

    - ### Fields inherited from interface org.apache.solr.response.QueryResponseWriter

      `CONTENT_TYPE_TEXT_ASCII, CONTENT_TYPE_TEXT_UTF8, CONTENT_TYPE_XML_UTF8`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GeoJSONResponseWriter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp)` Write a SolrQueryResponse, this method must be thread save.

    - ### Methods inherited from class org.apache.solr.response.JSONResponseWriter

      `getContentType, init`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### FIELD

          public static final String FIELD

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### GeoJSONResponseWriter

          public GeoJSONResponseWriter()

  - ### Method Detail

    - #### write

          public void write(Writer writer,
                            SolrQueryRequest req,
                            SolrQueryResponse rsp)
                     throws IOException

      Description copied from interface: `QueryResponseWriter`
      Write a SolrQueryResponse, this method must be thread save.

      Information about the request (in particular: formatting options) may be obtained from `req` but the dominant source of information should be `rsp`.

      There are no mandatory actions that write must perform. An empty write implementation would fulfill all interface obligations.

      Specified by:
        `write` in interface `QueryResponseWriter`
      Overrides:
        `write` in class `JSONResponseWriter`
      Throws:
        `IOException`

Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.