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

Explain for $text search should include weights

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: 3.4.10
    • Fix Version/s: Backlog
    • Component/s: Text Search
    • Labels:
      None
    • Case:

      Description

      Most indexes have the indexed fields in the key document. Explain against these indexes will list the relevant fields in the keyPattern document. These fields can be used to help diagnose long-running queries.

      "inputStage" : {
      				"stage" : "IXSCAN",
      				"keyPattern" : {
      					"b" : 1
      				},
      				"indexName" : "b_1",
      

      Instead of the indexed fields themselves, text indexes use "_fts" : "text" and _ftsx" : 1 in the key document. Thus, when running explain against these queries, it is impossible to tell what fields are in the index unless the default indexName is used.

      "inputStage" : {
      				"stage" : "IXSCAN",
      				"keyPattern" : {
      					"_fts" : "text",
      					"_ftsx" : 1
      				},
      				"indexName" : "testName",
      

      As the indexed fields will be represented in the weights document, adding the document to the explain output should accomplish the same effect as standard indexes.

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated: