[DOCS-2565] Comment on: "manual/tutorial/return-text-queries-using-only-text-index.txt" Created: 21/Jan/14  Updated: 03/Nov/17  Resolved: 22/Jan/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Improvement Priority: Major - P3
Reporter: Docs Collector User (Inactive) Assignee: Gianfranco Palumbo
Resolution: Duplicate Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

ubuntu 12.04 LTS
mongod v2.4.9, mongo v2.4.9
-------------------------------------------
port = 27018
dbpath = /var/lib/mongo.rs0/
fork = true
replSet = rs0
logpath = /var/log/mongodb.log
logappend = yes
shardsvr = true
setParameter=textSearchEnabled=1

Location: http://docs.mongodb.org/manual/tutorial/return-text-queries-using-only-text-index/
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36
Screen Resolution: 1440 x 900
repo: docs
source: tutorial/return-text-queries-using-only-text-index


Issue Links:
Duplicate
duplicates DOCS-2208 Text search covering behavior incorre... Closed
Participants:
Days since reply: 10 years, 4 weeks ago

 Description   

This asc and desc key, what you described, doesn't work for us! The documentation is bad.

We tried :

db.product.ensureIndex({
    keyword : "text", // string ~100 characters separated by space
    sku : -1, //integer32
})

and for text search :

db.product.runCommand("text",{
        search: "chindren toys",
        project : {sku : 1, _id : 0}
})

it returns the documents order on disc written (ASC), NOT in - the expected - DESC order by "sku" field.

Thanks for reply



 Comments   
Comment by Kay Kim (Inactive) [ 22/Jan/14 ]

Hi Gregory –
The page is undergoing a re-write as part of DOCS-2208 since the page incorrectly uses the term "covering", as opposed to describe the situation where the text index can fulfill the filter portion of a $text command.

As for your immediate concern, for a text search, the results are by descending text search score.

The index on the keyword: "text", sku: -1 does not, unfortunately, determine the sort order. So, for those objects with the same text search score, the order is non-deterministic.

{
			"score" : 2.5,
			"obj" : {
				"sku" : 15
			}
		},
		{
			"score" : 2.5,
			"obj" : {
				"sku" : 35
			}
		},

Hope this helps. Will be closing this ticket as the rewrite for DOCS-2208 should clarify the situation.

Regards,

Kay Kim

Generated at Thu Feb 08 07:43:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.