File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
src/Nest.Tests.Integration/Search/NamedFilter Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ using System . Linq ;
2+ using Nest . Tests . MockData ;
3+ using Nest . Tests . MockData . Domain ;
4+ using NUnit . Framework ;
5+
6+ namespace Nest . Tests . Integration . Search . NamedFilter
7+ {
8+ [ TestFixture ]
9+ public class NamedFilterTest : IntegrationTests
10+ {
11+ private string _LookFor = NestTestData . Data . First ( ) . Name ;
12+
13+ [ Test ]
14+ public void SimpleNamedFilter ( )
15+ {
16+ var queryResults = this . _client . Search < ElasticSearchProject > ( s=> s
17+ . From ( 0 )
18+ . Size ( 10 )
19+ . Fields ( p=> p . Name )
20+ . Filter ( f => f . Name ( "myfilter" ) . Terms ( p => p . Name . Suffix ( "sort" ) , new [ ] { _LookFor . ToLower ( ) } )
21+ || f . Name ( "myfilter2" ) . Terms ( p => p . Name . Suffix ( "sort" ) , new [ ] { "nest" } )
22+ )
23+ ) ;
24+ Assert . True ( queryResults . IsValid ) ;
25+ Assert . True ( queryResults . Documents . Any ( ) ) ;
26+ //Assert matched_filters is returned
27+ //Possible ES bug
28+ //https://github.com/elasticsearch/elasticsearch/issues/3097
29+ }
30+
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments