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

Allow floating point values for text index weights

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: 2.5.5
    • Fix Version/s: Backlog
    • Component/s: Text Search
    • Labels:
      None

      Description

      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).

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: