On 1/25/2016 12:13 AM, Edwin Lee wrote:
> We want to detect the health of each core —- whether they are
> available to post. We have to figure out ways to do that:
>
>  1. Using luke request . —- Cost is a bit high for core loading
>  2. We have designed a cache and adding the hook when the core is open
>     or closed to record whether the core is loaded. —- *Question: If a
>     core is loaded, is there situation that we still cannot post data
>     to it?*
>  3. We try to post some meanless data with our unique id, and delete
>     that data within the same commit, like this
>
> |{ "add": { "doc":{ "id": "%%ID%%" } }, "delete": { "id": "%%ID%%" },
> "commit": {} } |
>
> *But we still not 100% sure whether it will mess up with our normal data.*
>
> What is the best way for this requirment. We want to consult your
> opinions.
>

I'm assuming you're running Solr.  You did not indicate, but the JSON
format looks like Solr's format.

There may be some really quick way to detect whether an index is fully
writeable, but if there is, I do not know it.

What I think I would do is add a document with some current value in a
field besides the uniqueKey field, commit, and request that document,
making sure that the value submitted is the value received.

Deleting the document after validation would be optional, a step I
probably wouldn't bother doing.  You would need a special ID value for
the document, and to avoid problems with relevancy on your other
documents, this document should include a value in a field not used by
the rest of your documents, a value that changes every time the health
check is run.

FYI, this is a question better suited for the solr-user list, not the
dev list.

Thanks,
Shawn


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to