You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Bill Bell (JIRA)" <ji...@apache.org> on 2013/04/08 07:09:15 UTC

[jira] [Commented] (SOLR-4685) JSON response write modification to support RAW JSON

    [ https://issues.apache.org/jira/browse/SOLR-4685?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13625142#comment-13625142 ] 

Bill Bell commented on SOLR-4685:
---------------------------------

OK. I have a solution for SOLR 4.2.1. I added a new field json.fsuffix (field suffix). 

{{{
http://localhost:8983/solr/collection1/select?q=*%3A*&indent=true&rows=50&wt=json&json.fsuffix=_json
}}}

{{{
  <field name="office_json">{"poffL":{"poff":{"prNm":"Canon Counseling LLC","prID":"DHDHD","offL":{"off":{"addCd":"R729D","zip":78258,"isLab":0,"faxL":{"faxFull":"(210) 555-1215"},"oNm":"Canon Counseling LLC","isXray":0,"oRank":1,"ad1":"19206 West Rd","city":"San Antonio","pracUrl":"/group-directory/texas-tx/san-antonio/canon-counseling-llc","isBStf":0,"oGUID":"973D43A0-882A-E211-8426-B499BAA4D952","prmryO":1,"phL":{"phFull":"(210) 555-1212"},"addTp":"Office","st":"TX","oLegacyID":"D757D8842019122","isPhrm":0,"oID":"YX7YLM"}},"pLegacyID":"EDA4E9842019122","prGUID":"963D43A0-882A-E211-8426-B499BAA4D952","pProvCnt":1}}}</field>
}}}

And you get:

{{{
{
        "id": "0579B002",
        "name": "Canon PIXMA MP500 All-In-One Photo Printer",
        "manu": "Canon Inc.",
        "manu_id_s": "canon",
        "cat": [
          "electronics",
          "multifunction printer",
          "printer",
          "scanner",
          "copier"
        ],
        "features": [
          "Multifunction ink-jet color photo printer",
          "Flatbed scanner, optical scan resolution of 1,200 x 2,400 dpi",
          "2.5\" color LCD preview screen",
          "Duplex Copying",
          "Printing speed up to 29ppm black, 19ppm color",
          "Hi-Speed USB",
          "memory card: CompactFlash, Micro Drive, SmartMedia, Memory Stick, Memory Stick Pro, SD Card, and MultiMediaCard"
        ],
        "weight": 352,
        "price": 179.99,
        "price_c": "179.99,USD",
        "popularity": 6,
        "inStock": true,
        "office_json": {
          "poffL": {
            "poff": {
              "prNm": "Canon Counseling LLC",
              "prID": "DHDHD",
              "offL": {
                "off": {
                  "addCd": "R729D",
                  "zip": 78258,
                  "isLab": 0,
                  "faxL": {
                    "faxFull": "(210) 555-1215"
                  },
                  "oNm": "Canon Counseling LLC",
                  "isXray": 0,
                  "oRank": 1,
                  "ad1": "19206 West Rd",
                  "city": "San Antonio",
                  "pracUrl": "\/group-directory\/texas-tx\/san-antonio\/canon-counseling-llc",
                  "isBStf": 0,
                  "oGUID": "973D43A0-882A-E211-8426-B499BAA4D952",
                  "prmryO": 1,
                  "phL": {
                    "phFull": "(210) 555-1212"
                  },
                  "addTp": "Office",
                  "st": "TX",
                  "oLegacyID": "D757D8842019122",
                  "isPhrm": 0,
                  "oID": "YX7YLM"
                }
              },
              "pLegacyID": "EDA4E9842019122",
              "prGUID": "963D43A0-882A-E211-8426-B499BAA4D952",
              "pProvCnt": 1
            }
          }
        },
        "store": "45.19214,-93.89941",
        "_version_": 1.4317228499665e+18
      },
}}}


                
> JSON response write modification to support RAW JSON
> ----------------------------------------------------
>
>                 Key: SOLR-4685
>                 URL: https://issues.apache.org/jira/browse/SOLR-4685
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Bill Bell
>
> If the field ends with "_json" allow the field to return raw JSON.
> For example the field,
> office_json -- string
> I already put into the field raw JSON already escaped. I want it to come with no double quotes and not escaped.

--
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org