Creating and opening index for file-based embedded index?


(Jack Park) #1

Are there specific procedures for creating an index to be used when running
an embedded file-based client?
My question arises out of unit tests on a simple client created as shown at
the ES client page. It will successfully index a document, then immediately
read it back. But, when I open that client again to read it later, that
index is null.

When I create a node, to get the client and give it a data path, etc, then
use the client on a named index, I'm guessing that doesn't create the named
index, even though I see data in folders.

What am I missing?
Many thanks in advance.
Jack

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Jack Park) #2

An update:
I found some code which tests for existence of an index and creates it if
it is not there.
I now see this message:

NoShardAvailableActionException: [testindex][0] null

even though the index is there and it is not locked.

Testing works this way:

One unit test creates a document then reads it back then closes the node
and client.
Second unit test simply goes back and reads the document, resulting in that
error.

But, if I run in debug mode (Eclipse), and walk the second unit test
through, it reads the document with no errors.

My reading routing allows for 10 seconds in its get() as follows:

GetResponse resp = client.prepareGet(idx, typ, documentId).get("10000");

Confusing why walking through the code slowly allows success, but running
directly does not.

On Friday, November 15, 2013 8:07:23 AM UTC-8, jack...@topicquests.org
wrote:

Are there specific procedures for creating an index to be used when
running an embedded file-based client?
My question arises out of unit tests on a simple client created as shown
at the ES client page. It will successfully index a document, then
immediately read it back. But, when I open that client again to read it
later, that index is null.

When I create a node, to get the client and give it a data path, etc, then
use the client on a named index, I'm guessing that doesn't create the named
index, even though I see data in folders.

What am I missing?
Many thanks in advance.
Jack

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Jack Park) #3

A fix was discovered in a message by David Pilato earlier with a link to
this:

which appears to have resolved my issues.

The context of my query is specifically that of a local, embedded Client
using a file-based index.

Answer to my opening question appears to be simply this: look to see if
your indexes are created by following APIs in AdminClient; if not, create
them. But, before you do that, create the node, then client, then use that
test suggested above to wait for the Client to settle.

On Friday, November 15, 2013 10:47:58 AM UTC-8, jack...@topicquests.org
wrote:

An update:
I found some code which tests for existence of an index and creates it if
it is not there.
I now see this message:

NoShardAvailableActionException: [testindex][0] null

even though the index is there and it is not locked.

Testing works this way:

One unit test creates a document then reads it back then closes the node
and client.
Second unit test simply goes back and reads the document, resulting in
that error.

But, if I run in debug mode (Eclipse), and walk the second unit test
through, it reads the document with no errors.

My reading routing allows for 10 seconds in its get() as follows:

GetResponse resp = client.prepareGet(idx, typ, documentId).get("10000");

Confusing why walking through the code slowly allows success, but running
directly does not.

On Friday, November 15, 2013 8:07:23 AM UTC-8, jack...@topicquests.orgwrote:

Are there specific procedures for creating an index to be used when
running an embedded file-based client?
My question arises out of unit tests on a simple client created as shown
at the ES client page. It will successfully index a document, then
immediately read it back. But, when I open that client again to read it
later, that index is null.

When I create a node, to get the client and give it a data path, etc,
then use the client on a named index, I'm guessing that doesn't create the
named index, even though I see data in folders.

What am I missing?
Many thanks in advance.
Jack

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #4