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
Merged

Search lifecycle #1891

merged 4 commits into from Sep 18, 2018

Conversation

noirbizarre
Copy link
Contributor

@noirbizarre 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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@noirbizarre noirbizarre merged commit baf544d into opendatateam:master Sep 18, 2018
@noirbizarre noirbizarre deleted the search-lifecycle branch September 18, 2018 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants