Skip to content

Commit 0845761

Browse files
committed
Added reproduce for #3412 to show %2A is valid to send as wildcard:
1 parent b8041fb commit 0845761

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using FluentAssertions;
2+
using System.Linq;
3+
using Elastic.Xunit.XunitPlumbing;
4+
using Tests.Core.ManagedElasticsearch.Clusters;
5+
using Tests.Domain;
6+
7+
namespace Tests.Reproduce
8+
{
9+
public class GithubIssue3412 : IClusterFixture<WritableCluster>
10+
{
11+
private readonly WritableCluster _cluster;
12+
13+
public GithubIssue3412(WritableCluster cluster) => _cluster = cluster;
14+
15+
[I]
16+
public void WildcardBeingEscapedHasNoBarringsOnResult()
17+
{
18+
var indexedDocument1 = _cluster.Client.Index(new Project { Name = "project-1" }, d => d.Index("prefixed-1"));
19+
var indexedDocument2 = _cluster.Client.Index(new Project { Name = "project-2" }, d => d.Index("prefixed-2"));
20+
var refresh = _cluster.Client.Refresh("prefixed-*");
21+
var search = _cluster.Client.Search<Project>(s => s.Index("prefixed-*"));
22+
search.Total.Should().Be(2);
23+
var queriedIndices = search.Hits.Select(h => h.Index).ToArray();
24+
queriedIndices.Should().BeEquivalentTo(new[] {"prefixed-1", "prefixed-2"});
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)