1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Anyone Running 0.20.x?

Discussion in 'Enhanced Search Support' started by digitalpoint, Jan 3, 2013.

  1. digitalpoint

    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
        } ]
      }
    }
     
  2. HWS

    HWS Well-Known Member

    We ran into the same problem after upgrading.
    Downgraded to 19.12 for that reason.
     
    digitalpoint likes this.
  3. digitalpoint

    digitalpoint Well-Known Member

    Okay... glad it's not just me. I'll take it up with ES developers, since it really seems like an ES bug to me.
     
  4. Deebs

    Deebs Well-Known Member

    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.
     
  5. Slavik

    Slavik XenForo Moderator Staff Member

    There have been some weird Java/ES conflicts with some of the recent versions. Make sure you running the absolute latest JRE also.
     
  6. CyclingTribe

    CyclingTribe Well-Known Member

    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?
     
  7. Deebs

    Deebs Well-Known Member

    Are you seeing the problems that Shaun is? If not, leave it alone :)
     
  8. CyclingTribe

    CyclingTribe Well-Known Member

    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. ;)
     
  9. Deebs

    Deebs Well-Known Member

    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.
     
  10. Deebs

    Deebs Well-Known Member

    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.
     
    CyclingTribe likes this.
  11. HWS

    HWS Well-Known Member

    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.
     
  12. digitalpoint

    digitalpoint Well-Known Member

    Just FYI - downgraded to ES 0.19.12 and everything works fine again with finding stuff by specific users (didn't even need to rebuild indexes or anything).
     
  13. digitalpoint

    digitalpoint Well-Known Member

    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.
     
  14. HWS

    HWS Well-Known Member

    Thank you. It truly helped. ;-)
     

Share This Page