Elasticsearch 中使用MustNot等同于不登录遇到的坑

1、在写关键词推荐时,需要把当前文章过滤掉,不能再推荐自己的文章,所以再es中需要用到

MustNot属性查询

///


    /// 服务中心es检索
    ///

    ///
    ///
    public async Task> GetThreePartServiceSercahPagedAsync(ThreePartServiceSearchInput input)
    {
        var searchRequest = new SearchRequest(Nest.Indices.Parse(IndexConsts.ThreePartServiceIndexName));
        FieldSort sort = null;
        if (!input.KeyWords.IsNullOrWhiteSpace())
        {
            sort = new FieldSort { Field = Infer.Field(d => d.ReleaseTime), Order = SortOrder.Descending };
        }
        else
        {
            sort = new FieldSort {

你可能感兴趣的:(ElasticSearch,elasticsearch)