Denish kanabar

Denish kanabar

  • 1.9k
  • 14
  • 122

MongoDB TextSearch (index)

Jul 26 2019 4:13 AM
Hi,
 
In Textindex (with weights) can I have mix data type columns i.e. string and int both?  
 
I have a need to building a query that returns a result based on user input(user gives value for sting filed) but needs to modify score or sort result in a such a way that has higher values in corresponding fields.
 
E.g. user searches code repositories with projectName and technology ("UI AngularJs") , I have index weight on fields "projectName" and "technology". There are few other fields like #noOfContributers, #noOfDownloads,etc..
 
I need a query that gives record which has more #noOfContributers & #noOfDownloads.
 
TextIndex is not allowing to have columns with string and int datatype. 
 
Is it possible to do with MongoDB Text Index and score feature? 
 
Thanks,
Denish Kanabar 
 

Answers (1)