当前位置: 首页>>代码示例>>C#>>正文


C# ElasticClient.Count方法代码示例

本文整理汇总了C#中Nest.ElasticClient.Count方法的典型用法代码示例。如果您正苦于以下问题:C# ElasticClient.Count方法的具体用法?C# ElasticClient.Count怎么用?C# ElasticClient.Count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Nest.ElasticClient的用法示例。


在下文中一共展示了ElasticClient.Count方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AtualizaBuscaHeader

        public static string AtualizaBuscaHeader(string parametro)
        {
            var node = new Uri(URI_ES);
            var settings = new ConnectionSettings(node);
            var client = new ElasticClient(settings);
            String result = parametro;

            var seResult = client.Count<dynamic>(c => c
                                            .Index(INDEX)
                                            .Type(PRODSENSE)
                                            .Query(q => q
                                                .Match(m => m
                                                    .OnField("descricao_detalhada_produto")
                                                    .Query(parametro.ToLower())
                                                )
                                            )
                                        );

            result += "|" + seResult.Count;

            seResult = client.Count<dynamic>(c => c
                                            .Index(INDEX)
                                            .Type(DI)
                                            .Query(q => q
                                                .Match(m => m
                                                    .OnField("tx_descricaoMercadoria")
                                                    .Query(parametro.ToLower())
                                                )
                                            )
                                        );

            result += "|" + seResult.Count;

            //Consultando CE
            seResult = client.Count<dynamic>(c => c
                                            .Index(INDEX)
                                            .Type(CE)
                                            .Query(q => q
                                                .Match(m => m
                                                    .OnField("txmercadoria")
                                                    .Query(parametro.ToLower())
                                                )
                                            )
                                        );

            result += "|" + seResult.Count;

            return result;
        }
开发者ID:carlosh10,项目名称:c-tradv,代码行数:49,代码来源:ElasticSearchDAO.cs

示例2: ConsultaElasticSearchCountDocumentos

        public static List<AgregationsPorBucketQtde> ConsultaElasticSearchCountDocumentos(string paramatro, string index)
        {
            var node = new Uri(URI_ES);
            var settings = new ConnectionSettings(node);
            var client = new ElasticClient(settings);
            var resultDI = client.Count<DIPOCO>(c => c
                .Index(index)
                .Type(DI)
                .Query(q => q
                    .Match(m => m
                        .OnField("tx_descricaoMercadoria")
                        .Query(paramatro.ToLower())
                    )
                )
            );

            List<AgregationsPorBucketQtde> listResultados = new List<AgregationsPorBucketQtde>();

            AgregationsPorBucketQtde resumoBusca = new AgregationsPorBucketQtde();
            resumoBusca.name = DI;
            resumoBusca.qtde = resultDI.Count;
            listResultados.Add(resumoBusca);

            //Consultando CE
            var resultCE = client.Count<CE_POCO>(c => c
                                            .Index(index)
                                            .Type(CE)
                                            .Query(q => q
                                                .Match(m => m
                                                    .OnField("txmercadoria")
                                                    .Query(paramatro.ToLower())
                                                )
                                            )
                                        );

            resumoBusca = new AgregationsPorBucketQtde();
            resumoBusca.name = CE;
            resumoBusca.qtde = resultCE.Count;
            listResultados.Add(resumoBusca);

            return listResultados;
        }
开发者ID:carlosh10,项目名称:c-tradv,代码行数:42,代码来源:ElasticSearchDAO.cs


注:本文中的Nest.ElasticClient.Count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。