How to create a TEXT index in CouchDB 2.0?

痴心易碎 提交于 2019-12-07 06:04:10

问题


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:

  1. How to create a TEXT index in CouchDB?
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!