问题
I'm reading this article https://cloudant.com/blog/mango-json-vs-text-indexes and I would like to create a TEXT index in my CouchDB
In the Fauxton -> Mango Indexes page, I posted
{
"index": {
"fields": [
{
"name": "id_str",
"type": "number"
}
]
},
"name": "doc_id",
"type": "text"
}
...but got a 503 error with the following message:
{"error":"required index service unavailable","reason":"text"}
I wasn't able to find even any related info in their documentation and I feel really lost now.
So:
- How to create a TEXT index in CouchDB?
- Where can I find a decent introduction to indexes in CouchDB?
Please help, thanks.
回答1:
This error is different than an unknown index type since Couchdb 2.0 has stubs for text indexes, but doesn't directly implement them. These stubs depend on a dreyfus text index module provided by cloudant.
A guide to configuring and recompiling couchdb 2.0+ with Dreyfus (and its Clouseau dependency) can be found here. (I verified that these instructions work with the latest couchdb and dreyfus master branches as of 2017-04-22.)
来源:https://stackoverflow.com/questions/43534188/how-to-create-a-text-index-in-couchdb-2-0