You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A document contains a user account object which contains user ids for various platforms that of which they are also a user.
This is a simple array of a two field structure.
eg.
The system needs to be able to lookup the userPlatformID because it wants to associate the user with whatever. The field is a string because an unknown Platform will have whatever ID format it likes, in this case it is a numerical string. However after creating the Search_index no numerical string queried returns any hits.
Given the above document create a Search Index to navigate the documents and safely create an index for the two platforms fields.
function (doc) {
index('default', doc._id);
if (typeof(doc.userAccount) !== 'undefined' ){
for (platformInd = 0; platformInd < doc.userAccount.platforms.length; platformInd++){
if (typeof(doc.userAccount.platforms[platformInd].userPlatformID) !== 'undefined'){
index('platformid', doc.userAccount.platforms[platformInd].userPlatformID, {'index':true, 'store':true});
}
index('platform', doc.userAccount.platforms[platformInd].platform, {'index':true});
}
}
}
The index builds and any query for 'platform:' will return any hits but no hits for any 'platformid'. Storing the platformid shows in platform: query results that the value is stored as a string.
After some little time I prefixed the platformid field in the indexing with a 'P' and that returns results.
Couchdb 3.1.0
on AWS Linux 2 patched and up to date.
Only tested with Firefox but it's not a client issue, only Fauxton was used to reproduce this.
This discussion was converted from issue #3014 on July 20, 2020 16:14.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Description
A document contains a user account object which contains user ids for various platforms that of which they are also a user.
This is a simple array of a two field structure.
eg.
The system needs to be able to lookup the userPlatformID because it wants to associate the user with whatever. The field is a string because an unknown Platform will have whatever ID format it likes, in this case it is a numerical string. However after creating the Search_index no numerical string queried returns any hits.
Given the above document create a Search Index to navigate the documents and safely create an index for the two platforms fields.
The index builds and any query for 'platform:' will return any hits but no hits for any 'platformid'. Storing the platformid shows in platform: query results that the value is stored as a string.
After some little time I prefixed the platformid field in the indexing with a 'P' and that returns results.
Couchdb 3.1.0
on AWS Linux 2 patched and up to date.
Only tested with Firefox but it's not a client issue, only Fauxton was used to reproduce this.
Beta Was this translation helpful? Give feedback.
All reactions