Filter query works for X but not for Y, while they are similar

Okay, so I have indexed these documents (they are seen with normal
match_all search):

  • hits: {
    • total: 4
    • max_score: 1
    • hits: [
      • {
        • _index: posts_test_20131208153023965
        • _type: post/comment
        • _id: 1
        • _score: 1
        • _source: {
          • search_class: comment
          • target_users: [
            • 0
              ]
          • created_at: 2013-11-21T15:26:11.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/request
        • _id: 4
        • _score: 1
        • _source: {
          • search_class: request
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:11.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/user_registration
        • _id: 7
        • _score: 1
        • _source: {
          • search_class: notice
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:12.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/hehe
        • _id: 8
        • _score: 1
        • _source: {
          • search_class: hehe
          • target_users: [
            • 1
              ]
          • created_at: 2013-12-08T15:30:14.000+01:00
            }
            }
            ]
            }

When I filter this search over search_class: 'hehe', search_class:
'request', search_class: 'comment', I get one result (post/hehe,
post/request or post/comment). Example:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"search_class": "request"
}
}
}
}
}

  • hits: {
    • total: 1
    • max_score: 1
    • hits: [
      • {
        • _index: posts_test_20131208153023965
        • _type: post/request
        • _id: 4
        • _score: 1
        • _source: {
          • search_class: request
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:11.000+01:00
            }
            }
            ]
            }

But when I will change the phrase "request" to "notice", I get no hits:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"search_class": "notice"
}
}
}
}
}

  • hits: {
    • total: 0
    • max_score: null
    • hits: [ ]
      }

The only difference is changing the name from "notice" to "request" !
Why?

I have already refreshed the index, and tried to add those documents in
different order, or change the "notice" name to other name (f.e.
"notification"), but still, I get the same result.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/f8a9f672-4fe7-4faa-9c71-bdd689522a3d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I cannot reproduce the problem. Would you mind sending a complete curl
recreation with the indexing, refresh and search that doesn't return the
expected result?

On Sunday, December 8, 2013 3:56:06 PM UTC+1, Jacek Tomaszewski wrote:

Okay, so I have indexed these documents (they are seen with normal
match_all search):

  • hits: {
    • total: 4
    • max_score: 1
    • hits: [
      • {
        • _index: posts_test_20131208153023965
        • _type: post/comment
        • _id: 1
        • _score: 1
        • _source: {
          • search_class: comment
          • target_users: [
            • 0
              ]
          • created_at: 2013-11-21T15:26:11.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/request
        • _id: 4
        • _score: 1
        • _source: {
          • search_class: request
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:11.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/user_registration
        • _id: 7
        • _score: 1
        • _source: {
          • search_class: notice
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:12.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/hehe
        • _id: 8
        • _score: 1
        • _source: {
          • search_class: hehe
          • target_users: [
            • 1
              ]
          • created_at: 2013-12-08T15:30:14.000+01:00
            }
            }
            ]
            }

When I filter this search over search_class: 'hehe', search_class:
'request', search_class: 'comment', I get one result (post/hehe,
post/request or post/comment). Example:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"search_class": "request"
}
}
}
}
}

  • hits: {
    • total: 1
    • max_score: 1
    • hits: [
      • {
        • _index: posts_test_20131208153023965
        • _type: post/request
        • _id: 4
        • _score: 1
        • _source: {
          • search_class: request
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:11.000+01:00
            }
            }
            ]
            }

But when I will change the phrase "request" to "notice", I get no hits:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"search_class": "notice"
}
}
}
}
}

  • hits: {
    • total: 0
    • max_score: null
    • hits:
      }

The only difference is changing the name from "notice" to "request" !
Why?

I have already refreshed the index, and tried to add those documents in
different order, or change the "notice" name to other name (f.e.
"notification"), but still, I get the same result.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/399497b1-f4dd-4838-9109-7a944d0e9bfb%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I'll try to send you that today.

I also noticed that my cluster is in yellow health (it was in red,but I
managed to get it to yellow after deleting some indexes). Maybe that's the
problem?

W dniu poniedziałek, 9 grudnia 2013 11:46:48 UTC+1 użytkownik Luca Cavanna
napisał:

I cannot reproduce the problem. Would you mind sending a complete curl
recreation with the indexing, refresh and search that doesn't return the
expected result?

On Sunday, December 8, 2013 3:56:06 PM UTC+1, Jacek Tomaszewski wrote:

Okay, so I have indexed these documents (they are seen with normal
match_all search):

  • hits: {
    • total: 4
    • max_score: 1
    • hits: [
      • {
        • _index: posts_test_20131208153023965
        • _type: post/comment
        • _id: 1
        • _score: 1
        • _source: {
          • search_class: comment
          • target_users: [
            • 0
              ]
          • created_at: 2013-11-21T15:26:11.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/request
        • _id: 4
        • _score: 1
        • _source: {
          • search_class: request
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:11.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/user_registration
        • _id: 7
        • _score: 1
        • _source: {
          • search_class: notice
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:12.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/hehe
        • _id: 8
        • _score: 1
        • _source: {
          • search_class: hehe
          • target_users: [
            • 1
              ]
          • created_at: 2013-12-08T15:30:14.000+01:00
            }
            }
            ]
            }

When I filter this search over search_class: 'hehe', search_class:
'request', search_class: 'comment', I get one result (post/hehe,
post/request or post/comment). Example:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"search_class": "request"
}
}
}
}
}

  • hits: {
    • total: 1
    • max_score: 1
    • hits: [
      • {
        • _index: posts_test_20131208153023965
        • _type: post/request
        • _id: 4
        • _score: 1
        • _source: {
          • search_class: request
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:11.000+01:00
            }
            }
            ]
            }

But when I will change the phrase "request" to "notice", I get no hits:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"search_class": "notice"
}
}
}
}
}

  • hits: {
    • total: 0
    • max_score: null
    • hits:
      }

The only difference is changing the name from "notice" to "request" !
Why?

I have already refreshed the index, and tried to add those documents in
different order, or change the "notice" name to other name (f.e.
"notification"), but still, I get the same result.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d039bd0f-e396-4939-bef9-248c66a8d213%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks, I'll wait for your recreation.
The red status could be the problem, the yellow is not as yellow just means
that some replicas cannot be allocated (if for instance you have a single
node no replicas can be allocated).

On Mon, Dec 9, 2013 at 11:50 AM, Jacek Tomaszewski jacek@jtom.me wrote:

I'll try to send you that today.

I also noticed that my cluster is in yellow health (it was in red,but I
managed to get it to yellow after deleting some indexes). Maybe that's the
problem?

W dniu poniedziałek, 9 grudnia 2013 11:46:48 UTC+1 użytkownik Luca Cavanna
napisał:

I cannot reproduce the problem. Would you mind sending a complete curl
recreation with the indexing, refresh and search that doesn't return the
expected result?

On Sunday, December 8, 2013 3:56:06 PM UTC+1, Jacek Tomaszewski wrote:

Okay, so I have indexed these documents (they are seen with normal
match_all search):

  • hits: {
    • total: 4
    • max_score: 1
    • hits: [
      • {
        • _index: posts_test_20131208153023965
        • _type: post/comment
        • _id: 1
        • _score: 1
        • _source: {
          • search_class: comment
          • target_users: [
            • 0
              ]
          • created_at: 2013-11-21T15:26:11.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/request
        • _id: 4
        • _score: 1
        • _source: {
          • search_class: request
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:11.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/user_registration
        • _id: 7
        • _score: 1
        • _source: {
          • search_class: notice
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:12.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/hehe
        • _id: 8
        • _score: 1
        • _source: {
          • search_class: hehe
          • target_users: [
            • 1
              ]
          • created_at: 2013-12-08T15:30:14.000+01:00
            }
            }
            ]
            }

When I filter this search over search_class: 'hehe', search_class:
'request', search_class: 'comment', I get one result (post/hehe,
post/request or post/comment). Example:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"search_class": "request"
}
}
}
}
}

  • hits: {
    • total: 1
    • max_score: 1
    • hits: [
      • {
        • _index: posts_test_20131208153023965
        • _type: post/request
        • _id: 4
        • _score: 1
        • _source: {
          • search_class: request
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:11.000+01:00
            }
            }
            ]
            }

But when I will change the phrase "request" to "notice", I get no hits:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"search_class": "notice"
}
}
}
}
}

  • hits: {
    • total: 0
    • max_score: null
    • hits:
      }

The only difference is changing the name from "notice" to "request" !
Why?

I have already refreshed the index, and tried to add those documents in
different order, or change the "notice" name to other name (f.e.
"notification"), but still, I get the same result.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/Pws1OAK5Els/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/d039bd0f-e396-4939-bef9-248c66a8d213%40googlegroups.com
.

For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CADdZ9MXE-A%2BeKXLrdarYB5Veo5J6wfc-wnOL%3DNC--uAA%2BALscQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

After I changed search_class from "notice" to anything else like "foobar",
it solved the problem =)

Both "notice" and "notification" words made the record not to be found,
when queried by the search_class column. Strange - are they some kind of
reserved words in elasticsearch?

W dniu niedziela, 8 grudnia 2013 15:56:06 UTC+1 użytkownik Jacek
Tomaszewski napisał:

Okay, so I have indexed these documents (they are seen with normal
match_all search):

  • hits: {
    • total: 4
    • max_score: 1
    • hits: [
      • {
        • _index: posts_test_20131208153023965
        • _type: post/comment
        • _id: 1
        • _score: 1
        • _source: {
          • search_class: comment
          • target_users: [
            • 0
              ]
          • created_at: 2013-11-21T15:26:11.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/request
        • _id: 4
        • _score: 1
        • _source: {
          • search_class: request
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:11.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/user_registration
        • _id: 7
        • _score: 1
        • _source: {
          • search_class: notice
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:12.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/hehe
        • _id: 8
        • _score: 1
        • _source: {
          • search_class: hehe
          • target_users: [
            • 1
              ]
          • created_at: 2013-12-08T15:30:14.000+01:00
            }
            }
            ]
            }

When I filter this search over search_class: 'hehe', search_class:
'request', search_class: 'comment', I get one result (post/hehe,
post/request or post/comment). Example:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"search_class": "request"
}
}
}
}
}

  • hits: {
    • total: 1
    • max_score: 1
    • hits: [
      • {
        • _index: posts_test_20131208153023965
        • _type: post/request
        • _id: 4
        • _score: 1
        • _source: {
          • search_class: request
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:11.000+01:00
            }
            }
            ]
            }

But when I will change the phrase "request" to "notice", I get no hits:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"search_class": "notice"
}
}
}
}
}

  • hits: {
    • total: 0
    • max_score: null
    • hits:
      }

The only difference is changing the name from "notice" to "request" !
Why?

I have already refreshed the index, and tried to add those documents in
different order, or change the "notice" name to other name (f.e.
"notification"), but still, I get the same result.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5c277b09-3cc6-468b-bd47-62203d1932ff%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

As I said before I couldn't reproduce your problem with your same words.
Would be nice if you can send a curl recreation. Maybe the problem is in
your mappings.

On Tue, Dec 10, 2013 at 4:05 PM, Jacek Tomaszewski jacek@jtom.me wrote:

After I changed search_class from "notice" to anything else like "foobar",
it solved the problem =)

Both "notice" and "notification" words made the record not to be found,
when queried by the search_class column. Strange - are they some kind of
reserved words in elasticsearch?

W dniu niedziela, 8 grudnia 2013 15:56:06 UTC+1 użytkownik Jacek
Tomaszewski napisał:

Okay, so I have indexed these documents (they are seen with normal
match_all search):

  • hits: {
    • total: 4
    • max_score: 1
    • hits: [
      • {
        • _index: posts_test_20131208153023965
        • _type: post/comment
        • _id: 1
        • _score: 1
        • _source: {
          • search_class: comment
          • target_users: [
            • 0
              ]
          • created_at: 2013-11-21T15:26:11.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/request
        • _id: 4
        • _score: 1
        • _source: {
          • search_class: request
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:11.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/user_registration
        • _id: 7
        • _score: 1
        • _source: {
          • search_class: notice
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:12.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/hehe
        • _id: 8
        • _score: 1
        • _source: {
          • search_class: hehe
          • target_users: [
            • 1
              ]
          • created_at: 2013-12-08T15:30:14.000+01:00
            }
            }
            ]
            }

When I filter this search over search_class: 'hehe', search_class:
'request', search_class: 'comment', I get one result (post/hehe,
post/request or post/comment). Example:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"search_class": "request"
}
}
}
}
}

  • hits: {
    • total: 1
    • max_score: 1
    • hits: [
      • {
        • _index: posts_test_20131208153023965
        • _type: post/request
        • _id: 4
        • _score: 1
        • _source: {
          • search_class: request
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:11.000+01:00
            }
            }
            ]
            }

But when I will change the phrase "request" to "notice", I get no hits:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"search_class": "notice"
}
}
}
}
}

  • hits: {
    • total: 0
    • max_score: null
    • hits:
      }

The only difference is changing the name from "notice" to "request" !
Why?

I have already refreshed the index, and tried to add those documents in
different order, or change the "notice" name to other name (f.e.
"notification"), but still, I get the same result.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/Pws1OAK5Els/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/5c277b09-3cc6-468b-bd47-62203d1932ff%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CADdZ9MWkpW_X86Rx4NorvwEEWOQuEy4x90WuEgKR9wJRSkpBQw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Well, the models were autogenerated with ruby library called Tirehttps://github.com/karmi/retire,
so I don't have any curl recreation (at least for now).

Currently my problem is solved, so I think we can skip this issue. Thank
you for your help.

W dniu wtorek, 10 grudnia 2013 16:14:28 UTC+1 użytkownik Luca Cavanna
napisał:

As I said before I couldn't reproduce your problem with your same words.
Would be nice if you can send a curl recreation. Maybe the problem is in
your mappings.

On Tue, Dec 10, 2013 at 4:05 PM, Jacek Tomaszewski <ja...@jtom.me<javascript:>

wrote:

After I changed search_class from "notice" to anything else like
"foobar", it solved the problem =)

Both "notice" and "notification" words made the record not to be found,
when queried by the search_class column. Strange - are they some kind of
reserved words in elasticsearch?

W dniu niedziela, 8 grudnia 2013 15:56:06 UTC+1 użytkownik Jacek
Tomaszewski napisał:

Okay, so I have indexed these documents (they are seen with normal
match_all search):

  • hits: {
    • total: 4
    • max_score: 1
    • hits: [
      • {
        • _index: posts_test_20131208153023965
        • _type: post/comment
        • _id: 1
        • _score: 1
        • _source: {
          • search_class: comment
          • target_users: [
            • 0
              ]
          • created_at: 2013-11-21T15:26:11.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/request
        • _id: 4
        • _score: 1
        • _source: {
          • search_class: request
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:11.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/user_registration
        • _id: 7
        • _score: 1
        • _source: {
          • search_class: notice
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:12.000+01:00
            }
            },
      • {
        • _index: posts_test_20131208153023965
        • _type: post/hehe
        • _id: 8
        • _score: 1
        • _source: {
          • search_class: hehe
          • target_users: [
            • 1
              ]
          • created_at: 2013-12-08T15:30:14.000+01:00
            }
            }
            ]
            }

When I filter this search over search_class: 'hehe', search_class:
'request', search_class: 'comment', I get one result (post/hehe,
post/request or post/comment). Example:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"search_class": "request"
}
}
}
}
}

  • hits: {
    • total: 1
    • max_score: 1
    • hits: [
      • {
        • _index: posts_test_20131208153023965
        • _type: post/request
        • _id: 4
        • _score: 1
        • _source: {
          • search_class: request
          • target_users: [
            • 0
              ]
          • created_at: 2013-12-08T15:26:11.000+01:00
            }
            }
            ]
            }

But when I will change the phrase "request" to "notice", I get no hits:
{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"term": {
"search_class": "notice"
}
}
}
}
}

  • hits: {
    • total: 0
    • max_score: null
    • hits:
      }

The only difference is changing the name from "notice" to "request" !
Why?

I have already refreshed the index, and tried to add those documents in
different order, or change the "notice" name to other name (f.e.
"notification"), but still, I get the same result.

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/Pws1OAK5Els/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/5c277b09-3cc6-468b-bd47-62203d1932ff%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/c7a9034b-4539-4c79-9fe3-e6b9d94026d9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.