Description
Some attributes are currently being used as normal attributes. They need to be converted to FacetType
.
E.g: for type Segment
, highlight=True
needs to be a facet. Similarly, entityCount=int
needs to be a facet.
Format changes
Although facets are not first-class citizens in Dgraph (and, hence need not be specifically mentione in schema), Facets need to be represented differently for dgraph to recognize it as a facet.
Normal Format
type TranscriptionSegment {
highlight=true
}
type ContextSession {
hasSegment: [uid]
}
Faceted format
type ContextSession {
hasSegment: [uid]
hasSegment|highlight = true
}
Things to Note
- A specific limitation with facets has been conveyed by Dgraph team. Need to keep that in mind till it is updated: (Reference: https://dgraph.slack.com/archives/C13LH03RR/p1581940091449600?thread_ts=1581932018.449000&cid=C13LH03RR)
Hi Guys, I want to update the facets for that I am using the below mutate query and its happening but existing facets are deleting
can anyone resolve the issue ?
{
set {
<0x4e24> <0x4e25> (inyear=2020 ) .
}
}
hackintoshrao:awesome:
For now, you need to read all the facet values before the update, and then only alter the one you intend to, and write all of it back.
There's no way to specifically update one of the facet entry at this point.