zoukankan      html  css  js  c++  java
  • MongoDB 核心将支持全文搜索功能 (2.3.2)

    来自 MongoDB 官方 JIRA 的一个新特性报告称 MongoDB 将在 2.3.2 版本中增加全文搜索功能。该功能还是体验到阶段,使用方法包括:

    db.adminCommand( { setParameter : "*", textSearchEnabled : true } );

    或者是:

    ./mongod --setParameter textSearchEnabled=true

    特性:

    • parsing + stemming for latin languages
    • multi-word scoring
    • phrase matching
    • word negation
    • weights per field
    • additional suffix index fields for coverings
    • additional prefix index fields for partitioning
    • specify language per document

    简单使用示例:

    > db.foo.insert( { _id: 1 , desc: "the dog is running" } )
    > db.foo.insert( { _id: 2 , desc: "the cat is walking" } )
    > db.foo.ensureIndex( { "desc": "text" } )
    > db.foo.runCommand( "text", { search : "walk" } )
    {
        "queryDebugString" : "walk||||||",
        "language" : "english",
        "results" : [
            {
                "score" : 0.75,
                "obj" : {
                    "_id" : 2,
                    "desc" : "the cat is walking"
                }
            }
        ],
        "stats" : {
            "nscanned" : 1,
            "nscannedObjects" : 0,
            "n" : 1,
            "timeMicros" : 330
        },
        "ok" : 1
    }
  • 相关阅读:
    ffmpeg通过组播udp推ts流
    C# 多线程总结
    《图解HTTP》6-首部
    官网下载Java连接MySql驱动jar包
    FineReport——JDBC 连接 MySQL 数据库
    serializeArray()方式请求,php获取的方法
    win10无线wifi总是掉线断网
    C# Post请求中Json格式写法
    Layui upload 上传有进度条
    java 基于redis分布式锁
  • 原文地址:https://www.cnblogs.com/shihao/p/2835255.html
Copyright © 2011-2022 走看看