c# - How do I delete all content for a given facet? -
i'm trying delete content aloglia index in c# api.
i can't seem find examples online show how facets work.
before attempt deletebyquery command trying search same criteria working.
algoliaclient searchclient = new algoliaclient("xxx", "xxx"); index purgeindex = searchclient.initindex("mytestindex"); query purgequery = new query(""); jarray facetfilters = new jarray("versions", "6.12.2"); purgequery.setfacetfilters(facetfilters); jobject res = purgeindex.search(purgequery);
but res object undefined when run code.
am close? once know filtering working can pass same query delete function.
i got working.
here syntax in case else needs delete index content given facet.
algoliaclient searchclient = new algoliaclient("x", "x"); index purgeindex = searchclient.initindex(paramindex); query purgequery = new query(""); jarray facetfilters = new jarray(); jtoken facettoken = jtoken.parse("['" + paramfacetname + ":" + paramfacetvalue + "']"); facetfilters.add(facettoken); purgequery.setfacetfilters(facetfilters); purgeindex.deletebyquery(purgequery);
Comments
Post a Comment