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

ElasticSearch reindex just one message

Discussion in 'XenForo Development Discussions' started by AndyB, Apr 1, 2013.

  1. AndyB

    AndyB Well-Known Member

    I just installed ElasticSearch and it work fantastic! My hats off to Xenforo for offering such a fantastic Addon.

    The only very minor problem I noticed is that when I run my cron which is a stand alone script that converts linked images to attachments, the ES index does not get updated. Does anyone know what command from a php script I can issue to reindex ES for just one post message.

    Thank you.
     
  2. Slavik

    Slavik XenForo Moderator Staff Member

    It sounds like your script isn't re-posting the data correctly to let ES know theres been a change.
     
  3. AndyB

    AndyB Well-Known Member

    Hi Slavik,

    My script is a stand alone and I update the xF database without any interaction with Xenforo.

    What I'm looking for is the code needed to update ES directly.
     
  4. Slavik

    Slavik XenForo Moderator Staff Member

    In theory you could just use the Elasticsearch Put syntax to update the relevent data, though, Mike is probably your best bet knowing the best way of doing that.

     
  5. AndyB

    AndyB Well-Known Member

    Thank you, Slavik.
     
  6. AndyB

    AndyB Well-Known Member

    Looking at this link:

    http://www.elasticsearch.org/guide/reference/api/index_/

    It looks like it would be very easy to update ElasticSearch using their API.

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

Share This Page