Anyone Running 0.20.x?

digitalpoint

Well-known member
I'm wondering if anyone on ES 0.20.2 is able to get posts or threads by a user (from the normal link on their profile)?

I updated ES to 0.20.2 and it seems we lost the ability to search for content by a user... I did some debugging, and it appears ES doesn't support searching indexes/types without specifically calling them out any longer (I can only asume it's an ES bug).

This query yields nothing (search across all indexes, all types)...

Code:
curl -XGET 'http://localhost:9200/_search?q=user:1&pretty=1'
{
  "took" : 7,
  "timed_out" : false,
  "_shards" : {
    "total" : 10,
    "successful" : 10,
    "failed" : 0
  },
  "hits" : {
    "total" : 0,
    "max_score" : null,
    "hits" : [ ]
  }
}

According to ES docs, that should work (see last example here): http://www.elasticsearch.org/guide/reference/api/search/indices-types.html

A search across just the xenforo index (all types) returns nothing as well. This one is important because this is how XenForo does it...

Code:
curl -XGET 'http://localhost:9200/xenforo/_search?q=user:1&pretty=1'
{
  "took" : 8,
  "timed_out" : false,
  "_shards" : {
    "total" : 10,
    "successful" : 10,
    "failed" : 0
  },
  "hits" : {
    "total" : 0,
    "max_score" : null,
    "hits" : [ ]
  }
}

But just to prove we have data... if we call out just to search a single type (or even if you search multiple types), it returns results:

Code:
curl -XGET 'http://localhost:9200/_all/post/_search?q=user:1&pretty=1'
{
  "took" : 10,
  "timed_out" : false,
  "_shards" : {
    "total" : 10,
    "successful" : 10,
    "failed" : 0
  },
  "hits" : {
    "total" : 31372,
    "max_score" : 1.0,
    "hits" : [ {
      "_index" : "xenforo",
      "_type" : "post",
      "_id" : "4797783",
      "_score" : 1.0
    }, {
      "_index" : "xenforo",
      "_type" : "post",
      "_id" : "5005492",
      "_score" : 1.0
    }, {
      "_index" : "xenforo",
      "_type" : "post",
      "_id" : "4808667",
      "_score" : 1.0
    }, {
      "_index" : "xenforo",
      "_type" : "post",
      "_id" : "4799431",
      "_score" : 1.0
    }, {
      "_index" : "xenforo",
      "_type" : "post",
      "_id" : "5192213",
      "_score" : 1.0
    }, {
      "_index" : "xenforo",
      "_type" : "post",
      "_id" : "5467205",
      "_score" : 1.0
    }, {
      "_index" : "xenforo",
      "_type" : "post",
      "_id" : "6632367",
      "_score" : 1.0
    }, {
      "_index" : "xenforo",
      "_type" : "post",
      "_id" : "6632545",
      "_score" : 1.0
    }, {
      "_index" : "xenforo",
      "_type" : "post",
      "_id" : "6718061",
      "_score" : 1.0
    }, {
      "_index" : "xenforo",
      "_type" : "post",
      "_id" : "6719684",
      "_score" : 1.0
    } ]
  }
}
 
I'm wondering if anyone on ES 0.20.2 is able to get posts or threads by a user (from the normal link on their profile)?

I updated ES to 0.20.2 and it seems we lost the ability to search for content by a user... I did some debugging, and it appears ES doesn't support searching indexes/types without specifically calling them out any longer (I can only asume it's an ES bug).

This query yields nothing (search across all indexes, all types)...

Code:
curl -XGET 'http://localhost:9200/_search?q=user:1&pretty=1'
{
  "took" : 7,
  "timed_out" : false,
  "_shards" : {
    "total" : 10,
    "successful" : 10,
    "failed" : 0
  },
  "hits" : {
    "total" : 0,
    "max_score" : null,
    "hits" : [ ]
  }
}

Running 0.20.RC1 and the first query works for me as does all the getting user content from their profile. Will look at bringing up a 0.20.(1)(2) to test against.
 
There have been some weird Java/ES conflicts with some of the recent versions. Make sure you running the absolute latest JRE also.
 
Hmmm ... I've installed 0.20.2 on my new server (not live yet), but if it's buggy I'd better roll it back a bit.

Which version do you guys recommend I roll back to?
 
Are you seeing the problems that Shaun is? If not, leave it alone :)

I can't test it as I haven't moved any sites over to the new box yet - I just thought that if two people have come across the same problem, I might as well hedge my bets and roll it back a bit to a "known good" version. ;)
 
So far only Shaun has. Let me point my testforums to a 0.20.2 installation sooner rather than later...

EDIT: My apologies, didn't see that someone else has.
 
Ok,

Just pointed my testforums at a new 0.20.2 instance, told it to reindex and everything looks fine. I'll make a copy of my existing 0.20RC1 ES data and drop 0.20.2 on the top and try again later this afternoon.
 
EDIT: My apologies, didn't see that someone else has.

We didn't investigate the error further. Just decided to downgrade and everything works as expected again. But we got the same problem. Search posts by user was not possible. Also the index doesn't seem to be updated with new posts. We rebuilt the index after upgrading and again after downgrading.
 
Just to loop back around on this in case anyone runs into the same issue... I finally figured out what's going on... I have 2 custom searchable content types where the user_id field in search is not an integer (it's an array of integers)... For example a conversation can have multiple participants, so it's searchable by multiple users.

Long story short is ES was auto-mapping user as a "string" instead of "long" for those content types. This caused a mapping mismatch and ES 0.20.x and higher were less forgiving of mapping mismatches across types. Solved it by defining those particular mappings as "long" before the first record is added to ES (so then it doesn't auto-create it as "long"). Kind of annoying... and I still think it might be a bug since there are no strings in the array... but maybe ES stores arrays as strings internally by default incase there are ever strings in the array.

Anyway... hopefully the solution and WTF it actually was for me helps someone.
 
Just to loop back around on this in case anyone runs into the same issue... I finally figured out what's going on... I have 2 custom searchable content types where the user_id field in search is not an integer (it's an array of integers)... For example a conversation can have multiple participants, so it's searchable by multiple users.

Long story short is ES was auto-mapping user as a "string" instead of "long" for those content types. This caused a mapping mismatch and ES 0.20.x and higher were less forgiving of mapping mismatches across types. Solved it by defining those particular mappings as "long" before the first record is added to ES (so then it doesn't auto-create it as "long"). Kind of annoying... and I still think it might be a bug since there are no strings in the array... but maybe ES stores arrays as strings internally by default incase there are ever strings in the array.

Anyway... hopefully the solution and WTF it actually was for me helps someone.

Thank you. It truly helped. ;-)
 
Top Bottom