elasticsearch-嵌套不区分大小写

ckocjqey  于 2021-06-14  发布在  ElasticSearch
关注(0)|答案(0)|浏览(223)

我试图在索引中搜索“example1”,但实际上,只有在索引“example1”中搜索确切的值,我才能得到结果。我会让这个搜索变得不敏感。这是我的密码:
创建索引:

var createIndexResponse = client.Indices.Create(defaultIndex, c => c
                          .Map<ObjectInIndex>(mp => mp
                          .AutoMap())

搜索查询:

var pool = new SingleNodeConnectionPool(new Uri(_elasticsearchSettings.Uri));

var settings = new ConnectionSettings(pool)
.DefaultIndex(defaultIndex)
.DisableDirectStreaming()
.PrettyJson();

var client = new ElasticClient(settings);

var searchResponse = client.SearchAsync<ObjectInIndex>(s => s
                    .Explain()
                    .Source(sf => sf)
                    .Query(qn => qn
                    .MultiMatch(c => c
                    .Query(queryValue)))).Result;

索引中的对象:

"hits": [
        {
            "_index": "sql",
            "_type": "_doc",
            "_id": "PkSsC4QBsIJTwWG9TUY1",
            "_score": 17.879944,
            "_source": {
                "title": "EXAMPLE1"
            }
         }

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题