-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Index function in couchdb design doc is reached but but the index is not emitted sometimes #3013
Replies: 2 comments · 1 reply
-
heya, your index function is very complex. I tried to make sense of it, but failed after a good while. Would you be able to reduce this to a more concise example? My guess is that this is a byproduct of your your indexing function, not CouchDB or Search behaviour. |
Beta Was this translation helpful? Give feedback.
All reactions
-
@janl Hi I made a simpler version of searchAll `function (doc) {
}` and here is the documents inside objects array below I send to couch one by one. So at the end 88 docs are inserted in a loop to the db.
Here is the couch logs showing that those three docs with attr "who" has been called And here is the result after calling the end point: So as you see there is no
in the result. |
Beta Was this translation helpful? Give feedback.
All reactions
-
@janl any update on this? still I think this is a potential bug(I made a simple version of indexing function) |
Beta Was this translation helpful? Give feedback.
All reactions
This discussion was converted from issue #3013 on July 26, 2020 10:57.
Uh oh!
There was an error while loading. Please reload this page.
-
When I have some docs and I send them to couch in the searchAll design doc in some cases the index sent to index() function can not be retrieved
I have some docs as follows:
in the above there is no MD5 field. So the MD5 field only happens in few docs as follows:
So in my case I have about 90 docs and I only call index("file.hashes.MD5", ....) when it is present so means index("file.hashes.MD5", ....) is being called 3 times among all 90 docs inserted to the couchdb.
Steps to Reproduce
Here is my design docs:
and here is the lists of docs I insert then one by one in the loop to couch:
Expected Behaviour
when I query the db like this: http://localhost:5984/uds_8c2e8fc97ff72e7c4189dc6ed0008927/_design/searchAll/_search/searchAll?q=*:*&limit%3D10
I need to see the file.hashes.MD5 in the result but I do not see that. However as soon as you add another doc like this to the list:
which has MD5 in it then I can see
So to me it seems that when the index is widely used in most of the docs inserted to couch it is ok but when there is a field only exists in few docs inserted the the index is being ignored but is that the right behaviour?
Your Environment
Additional Context
Beta Was this translation helpful? Give feedback.
All reactions