Reputation: 11391
I am using the http api (no .net) to use raven.
I can't find any documentation regarding using facets directly using the http api.
If you have done this before then please answer with a brief overview of urls and json required to setup and query a facet.
Thanks
Upvotes: 1
Views: 148
Reputation: 11391
Turns out this is fairly simple.
First of all define the facet, to do this simply save the facet as a document in the database with the id facets/[your-facet-name]
A facet document looks like this:
{
"Facets": [
{
"Mode": "Default",
"Name": "type",
"Ranges": []
}
]
}
You can read more about the options for the Facet object here
Now assuming you have already setup an index called my-index you can use the facet by getting the url:
/databases/[your-database-name]/facets/[your-index-name]/facetDoc=facets/[your-facet-name]&query=[your-query]
The query is the normal lucene query format you would use when querying an index.
As it happens most of this information is already on the facets page you just have to read it closely!
Upvotes: 2