[SERVER-9652] sub-document relevance score for text search Created: 10/May/13  Updated: 28/Dec/23

Status: Backlog
Project: Core Server
Component/s: Text Search
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Will Shaver Assignee: Backlog - Query Integration
Resolution: Unresolved Votes: 1
Labels: qi-text-search
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Integration
Participants:

 Description   

Support subdocuments with various relevance or scores based on the text match weight of those sub-documents.

Example Schema:

{
 name: 'Bob Jones, Lord of Waking',
 favorites: [{title:'The Kraken Wakes'}, {title:'Lord of Light'}]
}
 
db.users.ensureIndex({name:'text', 'favorites.title':'text'});
 
db.users.runCommand('text', {search:'lord'});

Results would include a 'score' value of the entire document and a 'score object' that includes the scores in-place for each sub-document.

Example 'scores' object:

 "score" : 0.75,
 "scores" : {_:.75,favorites:[{_:0}, {_:0.88}]



 Comments   
Comment by Filip [ 03/Nov/16 ]

Maybe it's old, but this should be done exactly this way. Right now, mongo combines all occurences from every field in array of strings or array of documents. What is more strange, there is no info about that behaviour in documentation.

Generated at Thu Feb 08 03:21:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.