lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Spitzlay <christian.spitz...@biologis.com>
Subject Streaming Expressions: Merge array values? Inverse of cartesianProduct()
Date Thu, 14 Jun 2018 17:13:39 GMT
Hi,

is there a way to merge array values?

Something that transforms

{
  "k1": "1",
  "k2": ["a", "b"] 
},
{
  "k1": "2",
  "k2": ["c", "d"] 
},
{
  "k1": "2",
  "k2": ["e", "f"] 
}

into 

{
  "k1": "1",
  "k2": ["a", "b"] 
},
{
  "k1": "2",
  "k2": ["c", "d", "e", "f"] 
}


And an inverse of cartesianProduct() that transforms

{
  "k1": "1",
  "k2": "a"
},
{
  "k1": "2",
  "k2": "b"
},
{
  "k1": "2",
  "k2": "c"
}

into 

{
  "k1": "1",
  "k2": ["a"]
},
{
  "k1": "2",
  "k2": ["b", "c"] 
}


Christian



Mime
View raw message