<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:07:45 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-24913] Remove index restriction on $or clauses for $text searches</title>
                <link>https://jira.mongodb.org/browse/SERVER-24913</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Right now, the docs say that $text searches have the following restriction:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&quot;To use a $text query in an $or expression, all clauses in the $or array must be indexed.&quot;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;To get around this restriction, you have to do two separate queries and merge them together. This complicates things unnecessarily. Why is this restriction there? I propose it be removed.&lt;/p&gt;
</description>
                <environment></environment>
        <key id="298736">SERVER-24913</key>
            <summary>Remove index restriction on $or clauses for $text searches</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="fresheneesz">Billy Tetrud</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Jul 2016 23:58:48 +0000</created>
                <updated>Wed, 16 Jun 2021 13:50:16 +0000</updated>
                            <resolved>Thu, 28 Jul 2016 21:43:20 +0000</resolved>
                                                                    <component>Querying</component>
                                        <votes>0</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="3881068" author="JIRAUSER1260729" created="Wed, 16 Jun 2021 13:48:29 +0000"  >&lt;p&gt;Hi all in trouble, I&apos;ve got a decent workaround solutuion:&lt;/p&gt;

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

&lt;p&gt;&lt;tt&gt;Given that I have an index on the column:&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;db.Products.find({$or:[&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;&#160; {name:{$regex:&apos;hi&apos;, $options:&apos;i&apos;}, created: {$ne: &apos;nonExistingString&apos;&lt;/tt&gt;}},&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;&#160; {$text: {$search: &apos;Hi&apos;&lt;/tt&gt;}}&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;]})&lt;/tt&gt;&lt;/p&gt;</comment>
                            <comment id="1340620" author="thomas.schubert" created="Thu, 28 Jul 2016 21:43:06 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=fresheneesz&quot; class=&quot;user-hover&quot; rel=&quot;fresheneesz&quot;&gt;fresheneesz&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thanks for the additional details about your use case. I&apos;m closing this ticket as a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-13803&quot; title=&quot;Query planner should be able to plan $text queries that require collection scan&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-13803&quot;&gt;SERVER-13803&lt;/a&gt;, please feel free to vote for it and watch it for updates.&lt;/p&gt;

&lt;p&gt;Kind regards,&lt;br/&gt;
Thomas&lt;/p&gt;</comment>
                            <comment id="1314825" author="fresheneesz" created="Wed, 6 Jul 2016 02:38:38 +0000"  >&lt;p&gt;&quot; If the dataset is small,...; if the dataset is large ...&quot;&lt;/p&gt;

&lt;p&gt;You&apos;re missing a case: when the dataset is large but is reduced by an query condition that constrains the dataset to a small subset. An index on the whole collection would be expensive and unnecessary for searches where an $and condition limits the number of records to something small.&lt;/p&gt;

&lt;p&gt;I&apos;m doing this as a workaround for the limitations of Mongo&apos;s $text searching. $text searching can&apos;t currently return partial-word matches, and so i use the $text index to search most properties, but a couple more important queries, I use a $regex condition to get partial-word matches. It would be nice if $text indexes were more flexible, or if there were customizable indexes. But for now, it seems I need to do it this way. &lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;&quot;$or can only use indexes if all its clauses are supported by indexes&quot;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Ah, so what&apos;s the root of this limitation. It seems like an $or condition should be able to use indexes in a piecemeal way. At worst, two searches can be run, and the results can be merged (just like my workaround does).&lt;/p&gt;</comment>
                            <comment id="1314755" author="ramon.fernandez" created="Wed, 6 Jul 2016 00:19:02 +0000"  >&lt;p&gt;Here&apos;s the exact text from &lt;a href=&quot;https://docs.mongodb.com/manual/reference/operator/query/or/#or-and-text-queries&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;the documentation&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If $or includes a $text query, all clauses in the $or array must be supported by an index. This is because a $text query must use an index, and $or can only use indexes if all its clauses are supported by indexes. If the $text query cannot use an index, the query will return an error.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;While I see how this can be a limitation, I&apos;m not sure the use case for mixing indexed queries and collection scans is a very good one. If the dataset is small, adding an index on the relevant fields will be cheap; if the dataset is large, I would not want to do a collection scan and I&apos;d rather add an index on all the relevant fields instead to make my queries go faster.&lt;/p&gt;

&lt;p&gt;Can you add more details on your use case so we can better understand how this limitation is affecting you?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Ram&#243;n.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="134292">SERVER-13803</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="348945">SERVER-27806</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 6 Jul 2016 00:19:02 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 34 weeks 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>jerome@yisual.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 34 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>fresheneesz</customfieldvalue>
            <customfieldvalue>jerome@yisual.com</customfieldvalue>
            <customfieldvalue>kelsey.schubert@mongodb.com</customfieldvalue>
            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrjdi7:</customfieldvalue>

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

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

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