小编Jus*_*sTh的帖子

使用*通配符时,Lucene .net Boost无法正常工作

我有两个文件并使用Luke进行调查,我已在代码中确认它具有相同的行为,使用StandardAnalyzer.

用boost 1记录一个

stored/uncompressed,indexed,tokenized<Description:Nummer ett>
stored/uncompressed,indexed,tokenized<Id:2>
stored/uncompressed,indexed,tokenized<Name:Apa>
Run Code Online (Sandbox Code Playgroud)

文件二与boost 2

stored/uncompressed,indexed,tokenized<Description:Nummer två>
stored/uncompressed,indexed,tokenized<Id:1>
stored/uncompressed,indexed,tokenized<Name:Apa>
Run Code Online (Sandbox Code Playgroud)

在字段中搜索apa名称使用提升并以正确的顺序返回.

Document 2 has Score 1,1891
Document 1 has Score 0.5945
Run Code Online (Sandbox Code Playgroud)

搜索ap*以无顺序和相同分数返回

Document 1 Score 1.0000
Document 2 Score 1.0000
Run Code Online (Sandbox Code Playgroud)

搜索apa*以无顺序和相同分数返回

Document 1 Score 1.0000
Document 2 Score 1.0000
Run Code Online (Sandbox Code Playgroud)

为什么是这样?我想返回一些具有更高提升值的文档,即使我必须使用通配符.这可能吗?

欢呼所有酷酷的编码员!

这就是我想要帮助的.

搜索字符串并希望匹配.使用通配符.搜索"Lu"+"*"

Document
 Name
 City
Run Code Online (Sandbox Code Playgroud)

我希望名称为Lund的Document获得比具有Name Lunt或City为Lund的文档更高的评级.这是因为我会知道哪些文件最受欢迎.我想获得斯德哥尔摩市的文件,并命名斯德哥尔摩和斯托克霍尔曼,但我可以选择订购.

.net c# lucene lucene.net

8
推荐指数
1
解决办法
2834
查看次数

C#中的MongoDB地理空间索引

我一直试图开始尝试使用C#官方驱动程序创建和查询MongoDB,然后遇到同样的岩石.问题是如何使用地理信息创建数据.我只是没有找到答案.

码:

MongoUrl url = new MongoUrl("mongodb://xxx.xx.x.xx/mydb");
MongoServer server = MongoServer.Create(url);
MongoDatabase database = server.GetDatabase("mydb");
Run Code Online (Sandbox Code Playgroud)

< - 这很好用

BsonDocument[] batch = {
                         new BsonDocument {
                                             { "name", "Bran" },
                                             { "loc", "10, 10" }
                                         },
                                        new BsonDocument {
                                            { "name", "Ayla" },
                                            { "loc", "0, 0" }
                                        }
            };

places.InsertBatch(batch);
Run Code Online (Sandbox Code Playgroud)

< - 那部分是错误的

places.EnsureIndex(IndexKeys.GeoSpatial("loca"));
var queryplaces = Query.WithinCircle("loca", 0, 0, 11);
var cursor = places.Find(queryplaces);
foreach (var hit in cursor)
{
    foreach (var VARIABLE in hit)
    {
        Console.WriteLine(VARIABLE.Value);
    }
} …
Run Code Online (Sandbox Code Playgroud)

c# geocoding geospatial mongodb mongodb-.net-driver

4
推荐指数
1
解决办法
5809
查看次数