Re: Question on full text search and filter on geolocation

160 views
Skip to first unread message

Randall Hunt

unread,
Mar 27, 2013, 1:51:00 PM3/27/13
to mongod...@googlegroups.com
Greetings Nicolas,

We're very pleased that you're enjoying your experience with mongodb so far!

There is a plan for integration of text search into the regular query structure. As the feature is in beta right now there is no hard timeline on when that will be done.

Unfortunately you cannot currently use $near queries as part of the filter. As an alternative you might consider using a $geoWithin query?

db.generated.runCommand("text", {search: "bike", filter:{"location.coordinates": {$geoWithin: {$center: [[40,7.25], .01]}}}})

Hope this helps,

Randall

On Wednesday, March 27, 2013 6:39:04 AM UTC-4, Nicolas wrote:
Hello !

I have been using MongoDB for a few months now, and I have installed the last released version to make some tests on full text search.
I find it very great, the search is very effective and response times are great.

I only have two questions:

- Is there a plan for an integration of the text search to be able to run it using find instead of runCommand?
- I tried to combine FTS with a search for documents within a circle area (query below), but whatever the criteria on the location are, the results remain the same. Isn'it possible to mix FTS and geosearch? If it is, could you help me finding what I am doing wrong?

The query used:
db.generated.runCommand("text", { search: "bike", filter: { "location.coordinates": { $near: [40, 7.25], $maxDistance: 0.01 }}})

Thanks in advance !

Nicolas

Nicolas

unread,
Mar 28, 2013, 4:07:12 AM3/28/13
to mongod...@googlegroups.com
Hello Randall

I am glad to know that the text search will be integrated in the query structure.
For my second point, the $geoWithin perfectly fits my needs, and I can still sort the results by myself if I really needed to do so.

Thanks a lot, this was really helpful !

Nicolas
Reply all
Reply to author
Forward
0 new messages