Skip to content

Commit c7cfa78

Browse files
committed
feat: facet function to get solr facets using JSON api
1 parent d609b65 commit c7cfa78

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,16 @@ const prepareSolrClient = config => ({
7171
rollback: () => Error("not implemented yet"),
7272
spell: () => Error("not implemented yet"),
7373
optimize: () => Error("not implemented yet"),
74-
realTimeGet: () => Error("not implemented yet")
74+
realTimeGet: () => Error("not implemented yet"),
75+
facet: (jsonFacet, coreOpt = "") =>
76+
solrGet(config)("query")(
77+
{
78+
q: "*:*", // filtering will be implemented later
79+
rows: 0,
80+
"json.facet": JSON.stringify(jsonFacet)
81+
},
82+
coreOpt
83+
)
7584
})
7685

7786
module.exports = {

0 commit comments

Comments
 (0)