Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source filtering with wildcards broken when given multiple patterns #5133

Closed

Conversation

dadoonet
Copy link
Member

curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '{
    "user" : "kimchy",
    "post_date" : "2009-11-15T14:12:12",
    "message" : "trying out Elasticsearch", "retweeted": false
}'

No source fields delivered:

curl -XGET 'http://localhost:9200/twitter/tweet/1?_source=*.id,retweeted&pretty=yes'

retweeted returned:

curl -XGET 'http://localhost:9200/twitter/tweet/1?_source=retweeted,*.id&pretty=yes'

Closes #5132.

```
curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '{
    "user" : "kimchy",
    "post_date" : "2009-11-15T14:12:12",
    "message" : "trying out Elasticsearch", "retweeted": false
}'
```

No source fields delivered:

```
curl -XGET 'http://localhost:9200/twitter/tweet/1?_source=*.id,retweeted&pretty=yes'
```

`retweeted` returned:

```
curl -XGET 'http://localhost:9200/twitter/tweet/1?_source=retweeted,*.id&pretty=yes'
```

Closes elastic#5132.
@@ -172,24 +172,24 @@ private static void filter(Map<String, Object> map, Map<String, Object> into, St
if (include.charAt(0) == '*') {
if (Regex.simpleMatch(include, path)) {
exactIncludeMatch = true;
break;
continue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can stay as a break - exactInclude is the highest form of checking, no need to check more

@bleskes
Copy link
Contributor

bleskes commented Feb 15, 2014

hey david, thanks for picking it up. Left some comments. Let me know what you think.

@dadoonet
Copy link
Member Author

Agreed with all comments @bleskes. I applied them. Let me know.

@bleskes
Copy link
Contributor

bleskes commented Feb 17, 2014

+1!

dadoonet added a commit that referenced this pull request Feb 17, 2014
```
curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '{
    "user" : "kimchy",
    "post_date" : "2009-11-15T14:12:12",
    "message" : "trying out Elasticsearch", "retweeted": false
}'
```

No source fields delivered:

```
curl -XGET 'http://localhost:9200/twitter/tweet/1?_source=*.id,retweeted&pretty=yes'
```

`retweeted` returned:

```
curl -XGET 'http://localhost:9200/twitter/tweet/1?_source=retweeted,*.id&pretty=yes'
```

Closes #5132.
Closes #5133.
(cherry picked from commit 5d15936)
@dadoonet dadoonet closed this in 5d15936 Feb 17, 2014
@dadoonet dadoonet deleted the issue/5132-source-wildcard-filtering branch February 17, 2014 17:20
@clintongormley clintongormley added the :Core/Infra/REST API REST infrastructure and utilities label Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Source filtering with wildcards broken when given multiple patterns
3 participants