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

Check if elasticsearch is adding documents #1536

Closed
elshobokshy opened this issue Nov 21, 2018 · 3 comments
Closed

Check if elasticsearch is adding documents #1536

elshobokshy opened this issue Nov 21, 2018 · 3 comments
Assignees

Comments

@elshobokshy
Copy link

elshobokshy commented Nov 21, 2018

I have a page that gets from an API source elasticsearch results. I want to be able, when I re-run the elasticsearch mapping, to show them a "This mapping is currently being rewritten" message or something similar.

I know in Elastica the only way to access such information is through the client class. http://elastica.io/api/latest/classes/Elastica.Client.html

$client = new \Elastica\Client(array('host' => SEARCH_ENGINE_ENDPOINT, 'port' => SEARCH_ENGINE_PORT));

But I can't find a way to get the information I'm looking for, that of knowing if a certain type is currently being filled.

Any idea if this is possible?

@p365labs
Copy link
Collaborator

What about using the getStats() at Index Level ?
maybe something like

$indexStats = $index->getStats();
$stats->get('docs', 'store', 'indexing', 'get');

or maybe have a look at all stats

$stats->get('_all');

are the stats returned what u want ?
Have a look at all documentations on Indices Stats

Another interesting endpoint is Indices Recovery which I'm not sure it could be a good fit for you, maybe have a look at that but at the moment is not yet implemented into Elastica.

@elshobokshy
Copy link
Author

Could you please add a small example on how to use this new class to get my desired result?

@p365labs
Copy link
Collaborator

@elshobokshy if u have a look into the PR merged #1537 u can view the test which uses the getRecovery() method. For the informations it returns please refer to the documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants