Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search lifecycle #1891

Merged
merged 4 commits into from Sep 18, 2018

Conversation

Projects
None yet
2 participants
@noirbizarre
Copy link
Member

noirbizarre commented Sep 18, 2018

This PR:

  • migrate search tests to pytest
  • split search tests in multiple file (easier to read and maintain)
  • adds test for the search adapter indexing lifecylce
  • ensure deleted objects are properly unindexed

This fixes organizations still being suggested after deletion.

NB: As there is a lot of moves in this PR (pytest migration and split), reviewing by commit might be easier

@noirbizarre noirbizarre added this to the 1.6.0 milestone Sep 18, 2018

@noirbizarre noirbizarre self-assigned this Sep 18, 2018

@noirbizarre noirbizarre requested a review from opendatateam/etalab Sep 18, 2018

@noirbizarre noirbizarre force-pushed the noirbizarre:search-lifecycle branch from 2f83354 to 6ef0e33 Sep 18, 2018

@noirbizarre noirbizarre force-pushed the noirbizarre:search-lifecycle branch 2 times, most recently from 8efdc77 to aeb47f5 Sep 18, 2018

except:
log.exception('Unable to index %s "%s"',
model.__name__, str(obj.id))
adapter.save(using=es.client, index=es.index_name, refresh=True)

This comment has been minimized.

Copy link
@abulte

abulte Sep 18, 2018

Member

Isn't this a performance hog? elastic/elasticsearch-js#117 (comment)

except:
log.exception('Unable to index %s "%s"',
model.__name__, str(obj.id))
adapter.delete(using=es.client, index=es.index_name, refresh=True)

This comment has been minimized.

Copy link
@abulte

abulte Sep 18, 2018

Member

Same here (performance)

log.info('Unindexing %s (%s)', model.__name__, obj.id)
try:
adapter = adapter_class.from_model(obj)
adapter.delete(using=es.client, index=es.index_name, refresh=True)

This comment has been minimized.

Copy link
@abulte

abulte Sep 18, 2018

Member

Same here

@noirbizarre noirbizarre force-pushed the noirbizarre:search-lifecycle branch from aeb47f5 to edb97ab Sep 18, 2018

@abulte

abulte approved these changes Sep 18, 2018

@noirbizarre noirbizarre merged commit baf544d into opendatateam:master Sep 18, 2018

3 checks passed

ci/circleci: assets Your tests passed on CircleCI!
Details
ci/circleci: dist Your tests passed on CircleCI!
Details
ci/circleci: python Your tests passed on CircleCI!
Details

@noirbizarre noirbizarre deleted the noirbizarre:search-lifecycle branch Sep 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.