Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12801

Allow floating point values for text index weights

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.5.5
    • Component/s: Text Search
    • Labels:
    • Query Integration

      Currently the values for the optional weights for a text index must be integers. It would be nice if they could be floating point values to express weights as fractions. For example:

      > db.test.ensureIndex(
      ... { field1 : "text", field2 : "text", unimportant : "text", moreimportant : "text" },
      ... { weights : { unimportant : 0.6, moreimportant : 1.75 } }
      ... )
      

      Which would be intended to mean that the unimportant field is 60% as important and that the moreimportant field is 75% more important than the default weight for the rest of the fields (where the default is 1.0).

            Assignee:
            backlog-query-integration [DO NOT USE] Backlog - Query Integration
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: