[Tutorial] From getting started to advanced MongoDB (TextSearch)

Source: Internet
Author: User
With the release of MongoDB2.4.1 (the latest version is 2.4.1 because a major Bug has been found since the release of MongoDB 2.4.0), the full-text retrieval function is also appended to MongoDB. However, the full-text search function can only be used for searching Latin. 1. Use MongoDB2.4.1 first. Please download the latest mongodb2version from the official website. If

With the release of MongoDB 2.4.1 (the latest version is 2.4.1 because a major Bug has been found since the release of MongoDB 2.4.0), the full-text retrieval function has also been appended to MongoDB. However, the full-text search function can only be used for searching Latin. 1. Use MongoDB2.4.1 first. Please download the latest version of MongoDB from the official website. 2. If

With the release of MongoDB 2.4.1 (the latest version is 2.4.1 because a major Bug has been found since the release of MongoDB 2.4.0), the full-text retrieval function has also been appended to MongoDB. However, the full-text search function can only be used for searching Latin.

1. First, use MongoDB2.4.1 to download the latest version of MongoDB from the official website.

2. If you have already configured MongoDB, Please enable TextSearch this time:

Add -- setParameter textSearchEnabled = true to the original configuration file.

Example:

Cd C: \ runmongo \ bin
Mkdir C: \ mongodb \ SinaWeibo o
Mongod -- port 28030 -- dbpath C: \ mongodb \ SinaWeibo -- rest -- setParameter textSearchEnabled = true
In this way, you have enabled the full-text search function, but this function should not be used easily in the production environment. This will reduce server efficiency and consume a large amount of memory.

3. My tool was able to establish TextSearchIndex as soon as possible.

I don't know why, the Hong Kong virtual host, now the Index type is very strange, not text, but as shown below

Next, let's try TextSearch.

Weibo data is used here. Weibo has an expression like "good". Let's see how many Weibo posts contain "good.

We have created a full-text index for Weibo content.

Here, we can see a total of 44 search results.

The latest tool version can be downloaded here

All source code can be found on github:

Https://github.com/magicdict/MagicMongoDBTool

There are still many problems with the tool in this version. The 1.80-driven change point is not completely corrected, so it can only be used for learning and testing.

Now we are working on development. Please add a public account. Thank you.

For any questions about MongoDB 2.4.1 and C #, contact me.

Thank you again for your support for this tool, especially the two friends who gave me a lot of comments and suggestions, Hong Kong virtual host. Thank you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.