rhsimplex / image-match

🎇 Quickly search over billions of images
2.94k stars 405 forks source link

add refresh_after parameter to add_image method #46

Closed jtara1 closed 8 years ago

jtara1 commented 8 years ago

This PR allows us to refresh elasticsearch after an image has been add by passing refresh_after=True as a parameter in the add_image method.

rhsimplex commented 8 years ago

Hey @jtara1, I made a mistake in the sample test I gave you, and it's making the test fail.

I said:

def test_index_refresh(ses):
    ses.add_image('test1.jpg')
    r = ses.search_image('test1.jpg', refresh_after=True)
    assert len(r) == 1

When of course the refresh_after parameter should go with add_image.

So we should have:

def test_index_refresh(ses):
    ses.add_image('test1.jpg', refresh_after=True)
    r = ses.search_image('test1.jpg')
    assert len(r) == 1

Sorry about that, if you can make this change then I can merge the PR.