[
https://issues.apache.org/jira/browse/COUCHDB-2867?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15942347#comment-15942347
]
Nolan Lawson commented on COUCHDB-2867:
---------------------------------------
[~tonysun83] We don't have the "text" type in pouchdb-find and probably never
will; we can't afford to ship a whole full-text search in the browser. OTOH I
would love to have some way to indicate than an array of strings should be
individually indexable.
What about a new type, `"json-deep"`?
{code:javascript}
{
"index": {
"fields": ["tags", "labels"]
},
"name" : "myindex",
"type" : "json-deep"
}
{code}
In this case "tags" and "labels" would be an array of strings, and the indexer
would know to go one level deeper than it normally does. So then "$in" would be
done on-disk rather than in-memory.
> Mango: should be able to index *within* arrays
> ----------------------------------------------
>
> Key: COUCHDB-2867
> URL: https://issues.apache.org/jira/browse/COUCHDB-2867
> Project: CouchDB
> Issue Type: Improvement
> Components: Mango
> Reporter: Nolan Lawson
>
> If you have a document like:
> {code:javascript}
> {
> "_id": "foo",
> "tags": ["a", "b", "c"]
> }
> {code}
> ...then you should be able to run queries that find e.g. all documents with
> "a" as a tag, and it should be *indexed*. Currently there doesn't seem to be
> any way to do this except as an in-memory selector, which is a real bummer,
> because it's a super common use case. (Tags, categories, labels, etc.)
> Originally I thought this was how {{$elemMatch}} worked, and I was surprised
> to learn that that's not the case.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)