OpenSextant / SolrTextTagger

A text tagger based on Lucene / Solr, using FST technology
Apache License 2.0
174 stars 37 forks source link

Each tag in the output is an array of names and values instead of an object #83

Closed dkincaid closed 6 years ago

dkincaid commented 6 years ago

While working with the version of the tagger that is included in Solr 7.4.0 t

{
  "responseHeader":{
    "status":0,
    "QTime":2},
  "tagsCount":1,
  "tags":[[
      "startOffset",4,
      "endOffset",15,
      "ids",["A18692784"]]
  ]
}

I would think that making this an array of objects would be easier to parse:

{
  "responseHeader":{
    "status":0,
    "QTime":2},
  "tagsCount":1,
  "tags":[{
      "startOffset": 4,
      "endOffset": 15,
      "ids": ["A18692784"]}
  ]
}

is there are reason it is formatted the way it is right now?

dsmiley commented 6 years ago

See: https://builds.apache.org/job/Solr-reference-guide-master/javadoc/response-writers.html#json-nl set json.nl=map Perhaps the example in the ref guide ought to do this. Feel free to suggest a GitHub PR to Apache Solr doing this if you have the time.

dkincaid commented 6 years ago

Thanks for responding and for the quick and easy answer!