<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:44:51 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-37059] Prefix of compound text indexes cannot be used for non-text search queries</title>
                <link>https://jira.mongodb.org/browse/SERVER-37059</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;A non-text prefix of a compound text index is not able to be used for normal queries. It is unclear if this is expected behavior, i.e. text indexes can only be used for text search queries.&#160;&lt;/p&gt;

&lt;p&gt;For example, consider the following:&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;db.foo.drop()&lt;/tt&gt;&lt;tt&gt;db.foo.insert({ &quot;x&quot; : 1, &quot;message&quot; : &quot;Hello world.&quot; })&lt;/tt&gt;&lt;br/&gt;
 &lt;tt&gt;db.foo.insert({ &quot;x&quot; : 2, &quot;message&quot; : &quot;&quot; })&lt;/tt&gt;&lt;br/&gt;
 &lt;tt&gt;db.foo.insert({ &quot;x&quot; : 3, &quot;message&quot; : &quot;Hello there&quot;})&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;db.foo.createIndex({ &quot;x&quot; : 1, &quot;message&quot; : &quot;text&quot; }, { &quot;background&quot; : true } )&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;For normal indexes, the prefix of this index ( { x: 1 } ) can be used for queries filtering on &apos;x&apos;. However, the following query is unable to use prefix of the index:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;db.foo.find(&lt;/tt&gt;{{&lt;/p&gt;
{ &quot;x&quot; : 1 }
&lt;p&gt;}}&lt;tt&gt;).explain(true)&lt;/tt&gt;{{{}}&lt;br/&gt;
{{ &quot;queryPlanner&quot; : {}}&lt;br/&gt;
{{ &quot;plannerVersion&quot; : 1,}}&lt;br/&gt;
{{ &quot;namespace&quot; : &quot;test.foo&quot;,}}&lt;br/&gt;
{{ &quot;indexFilterSet&quot; : false,}}&lt;br/&gt;
{{ &quot;parsedQuery&quot; : {}}&lt;br/&gt;
{{ &quot;x&quot; :}}{{&lt;/p&gt;
{ &quot;$eq&quot; : 1 }
&lt;p&gt;}}&lt;tt&gt;},&lt;/tt&gt;&lt;br/&gt;
{{ &quot;winningPlan&quot; : {}}&lt;br/&gt;
{{ &quot;stage&quot; : &quot;COLLSCAN&quot;,}}&lt;br/&gt;
{{ &quot;filter&quot; : {}}&lt;br/&gt;
{{ &quot;x&quot; :}}{{&lt;/p&gt;
{ &quot;$eq&quot; : 1 }
&lt;p&gt;}}&lt;tt&gt;},&lt;/tt&gt;&lt;br/&gt;
{{ &quot;direction&quot; : &quot;forward&quot;}}&lt;br/&gt;
{{ },}}&lt;br/&gt;
{{ &quot;rejectedPlans&quot; : [ ]}}&lt;br/&gt;
{{ },}}&lt;br/&gt;
{{ &quot;executionStats&quot; : {}}&lt;br/&gt;
{{ &quot;executionSuccess&quot; : true,}}&lt;br/&gt;
{{ &quot;nReturned&quot; : 1,}}&lt;br/&gt;
{{ &quot;executionTimeMillis&quot; : 4,}}&lt;br/&gt;
{{ &quot;totalKeysExamined&quot; : 0,}}&lt;br/&gt;
{{ &quot;totalDocsExamined&quot; : 3,}}&lt;br/&gt;
{{ &quot;executionStages&quot; : {}}&lt;br/&gt;
{{ &quot;stage&quot; : &quot;COLLSCAN&quot;,}}&lt;br/&gt;
{{ &quot;filter&quot; : {}}&lt;br/&gt;
{{ &quot;x&quot; :}}{{&lt;/p&gt;
{ &quot;$eq&quot; : 1 }
&lt;p&gt;}}&lt;tt&gt;},&lt;/tt&gt;&lt;br/&gt;
{{ &quot;nReturned&quot; : 1,}}&lt;br/&gt;
{{ &quot;executionTimeMillisEstimate&quot; : 0,}}&lt;br/&gt;
{{ &quot;works&quot; : 5,}}&lt;br/&gt;
{{ &quot;advanced&quot; : 1,}}&lt;br/&gt;
{{ &quot;needTime&quot; : 3,}}&lt;br/&gt;
{{ &quot;needYield&quot; : 0,}}&lt;br/&gt;
{{ &quot;saveState&quot; : 0,}}&lt;br/&gt;
{{ &quot;restoreState&quot; : 0,}}&lt;br/&gt;
{{ &quot;isEOF&quot; : 1,}}&lt;br/&gt;
{{ &quot;invalidates&quot; : 0,}}&lt;br/&gt;
{{ &quot;direction&quot; : &quot;forward&quot;,}}&lt;br/&gt;
{{ &quot;docsExamined&quot; : 3}}&lt;br/&gt;
{{ },}}&lt;br/&gt;
{{ &quot;allPlansExecution&quot; : [ ]}}&lt;br/&gt;
{{ },}}&lt;br/&gt;
{{ &quot;serverInfo&quot; :}}{{&lt;/p&gt;
{ // redacted }
&lt;p&gt;}}&lt;tt&gt;}&#160;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;Hinting the index shows the query planner unable to bound on the index prefix.&#160;&lt;/p&gt;

&lt;p&gt;The Restrictions section of text indexes documentation (&lt;a href=&quot;https://docs.mongodb.com/manual/core/index-text/#restrictions&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://docs.mongodb.com/manual/core/index-text/#restrictions&lt;/a&gt;) does not state that text indexes can only be used for text search.&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="601534">SERVER-37059</key>
            <summary>Prefix of compound text indexes cannot be used for non-text search queries</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13202">Works as Designed</resolution>
                                        <assignee username="kelsey.schubert@mongodb.com">Kelsey Schubert</assignee>
                                    <reporter username="adamaharrison@gmail.com">Adam Harrison</reporter>
                        <labels>
                    </labels>
                <created>Sat, 8 Sep 2018 00:34:03 +0000</created>
                <updated>Fri, 27 Oct 2023 13:53:32 +0000</updated>
                            <resolved>Mon, 10 Sep 2018 18:05:12 +0000</resolved>
                                    <version>3.6.7</version>
                                                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="1998352" author="adamaharrison@gmail.com" created="Mon, 10 Sep 2018 18:08:16 +0000"  >&lt;p&gt;Thanks Kelsey!&lt;/p&gt;</comment>
                            <comment id="1998347" author="thomas.schubert" created="Mon, 10 Sep 2018 18:05:12 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=adamaharrison%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;adamaharrison@gmail.com&quot;&gt;adamaharrison@gmail.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thanks for reporting this behavior. My colleague, Stennie, wrote a &lt;a href=&quot;https://stackoverflow.com/a/44894103/5619772&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;detailed explanation&lt;/a&gt; of this behavior on stackoverflow and I recommend reviewing it. &lt;/p&gt;

&lt;p&gt;I agree that the documentation could be improved to clarify that this behavior expected. Feel free to vote for &lt;a href=&quot;https://jira.mongodb.org/browse/DOCS-10322&quot; title=&quot;Clarify eligibility of compound indexes that contain geospatial and text indexes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DOCS-10322&quot;&gt;&lt;del&gt;DOCS-10322&lt;/del&gt;&lt;/a&gt; and watch it for updates.&lt;/p&gt;

&lt;p&gt;Kind regards,&lt;br/&gt;
Kelsey&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="387323">DOCS-10322</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 10 Sep 2018 18:05:12 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        5 years, 22 weeks, 2 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 22 weeks, 2 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>adamaharrison@gmail.com</customfieldvalue>
            <customfieldvalue>kelsey.schubert@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hu7hbb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htxyov:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                    <customfieldvalue><![CDATA[kelsey.schubert@mongodb.com]]></customfieldvalue>
    

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hu73kn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>