I have an app where, in Elasticsearch, I have a mapping with nested documents.
So, for some table A I have a mapping
{
'properties': {
[..]
'B': {
type': 'nested',
'properties': {
'x': {'type': 'integer'},
'y': {'type': 'integer'},
'z': {'type': 'integer'},
}
}
}
In my database, there is a one-to-many relation from A to B, and all of x, y, and z are actually arrays. I naively translated this to Elasticsearch nested values and actually got search to work as I expected, including the ability to facet on the individual fields of B.
However, Elasticsearch does feel complicated to run in production as a solo developer and, occasionally, it crashes.
I would love to have a fast and robust in-memory search.
The queries I make need to return A records and are a conjunction of
(a) one or more filters on fields ofA
(b) one or more filters of the shape "there exists a B for which some predicate P(B) holds"
There are two different ways I need to facet on x, y, and z:
(1) facet on x, y, z of those Bs that fulfill a specific P(B), where B belongs to on an A that fulfills (a) and (b)
(2) facet on x, y, z of all Bs that belong to an A that fulfills (a) and (b).
I'm aware that Typesense likely won't have the detailed cababilities of filtering that Elasticsearch has (like arbitrary OR-queries and aggregations), and that's fine with me. The ability to interactively drill down into a dataset of around 3 million As and around 45 million Bs with good performance and low resource usage is more important for the use case than the ability to make elaborate queries.
From what I read and tried so far, it seems that Solr and Elasticsearch are the only engines that do nested faceting out of the box.
The question from my side is: Is there some reasonable way I can encode/flatten my nested data in Typesense so that I can facet on the nested fields?
If someone is aware of other engines that provide nested faceting, I'm definitely interested in learning about them, too.
I have an app where, in Elasticsearch, I have a mapping with nested documents.
So, for some table
AI have a mappingIn my database, there is a one-to-many relation from
AtoB, and all ofx,y, andzare actually arrays. I naively translated this to Elasticsearch nested values and actually got search to work as I expected, including the ability to facet on the individual fields ofB.However, Elasticsearch does feel complicated to run in production as a solo developer and, occasionally, it crashes.
I would love to have a fast and robust in-memory search.
The queries I make need to return
Arecords and are a conjunction of(a) one or more filters on fields of
A(b) one or more filters of the shape "there exists a
Bfor which some predicateP(B)holds"There are two different ways I need to facet on
x,y, andz:(1) facet on
x,y,zof thoseBs that fulfill a specificP(B), whereBbelongs to on anAthat fulfills (a) and (b)(2) facet on
x,y,zof allBs that belong to anAthat fulfills (a) and (b).I'm aware that Typesense likely won't have the detailed cababilities of filtering that Elasticsearch has (like arbitrary OR-queries and aggregations), and that's fine with me. The ability to interactively drill down into a dataset of around 3 million
As and around 45 millionBs with good performance and low resource usage is more important for the use case than the ability to make elaborate queries.From what I read and tried so far, it seems that Solr and Elasticsearch are the only engines that do nested faceting out of the box.
The question from my side is: Is there some reasonable way I can encode/flatten my nested data in Typesense so that I can facet on the nested fields?
If someone is aware of other engines that provide nested faceting, I'm definitely interested in learning about them, too.