Org.elasticsearch.indices.IndexMissingException


(John Chang) #1

I keep getting org.elasticsearch.indices.IndexMissingException from ActionFuture.actionGet() when I try to search using the java client. It throws the exception below and then hangs; never gets to the next line.

I have tried a numer of things.

  1. setting the jvm props at statup with:
    -Djgroups.config=tcp -Djgroups.bind_port=9700 -Djgroups.tcpping.initial_hosts=[9700],[9700],[9700]

  2. putting an elasticsearch.yml file (with the above values) into the directory from which I launch my program.

  3. putting in elasticsearch.yml into the launch dir, but commenting out the bind_port and intial_hosts and adding leaving those two to the jvm system props as described in #1 above.

Nothing works. I do find that I always get this error even if I set the ports and hosts to intentionally wrong values - I don't get a connection problem, just the IndexMissingException. So, I don't even know if I'm reaching the host even when I put back in the correct hosts and port. That said, I do know the hosts are up; and I know the index I am looking for is there. I see the index it when I curl a _status GET call.

BTW: I am open to using the TransportClient if that is better; the client will only ever query and post docs; it won't ever host indices. However, I got the idea this is not supported when I saw this in TransportClient.java
// disabled, still having problems with jgroups acting just as client
if (settings.getAsBoolean("discovery.enabled", true) && false) {
modules.add(new TransportClientClusterModule(settings));
}

My java code is below. Thanks in advance for any help you can provide.

public static void main(String[] args) {
    Node node = nodeBuilder().client(true).node();
    Client client = node.client();
    final GetRequest getRequest = Requests.getRequest("foo");
    final GetRequest getRequest1 = getRequest.type("mail");
    final GetRequest getRequest2 = getRequest1.id("myIdAbc");
    GetResponse response = client.get(getRequest2).actionGet(); //this line throws the below stack trace then hangs
    Iterator<GetField> itr = response.iterator(); //never gets here
    while (itr.hasNext()) {
        GetField gf = itr.next();
        System.out.println(gf.name() + ":");
        for (Object o : gf.values()) {
            System.out.println(o.toString());
        }
    }
    node.close();
}

Exception in thread "main" org.elasticsearch.indices.IndexMissingException: [foo] missing
at org.elasticsearch.cluster.metadata.MetaData.concreteIndex(MetaData.java:174)
at org.elasticsearch.action.support.single.TransportSingleOperationAction$AsyncSingleAction.(TransportSingleOperationAction.java:100)
at org.elasticsearch.action.support.single.TransportSingleOperationAction$AsyncSingleAction.(TransportSingleOperationAction.java:81)
at org.elasticsearch.action.support.single.TransportSingleOperationAction.doExecute(TransportSingleOperationAction.java:68)
at org.elasticsearch.action.support.single.TransportSingleOperationAction.doExecute(TransportSingleOperationAction.java:46)
at org.elasticsearch.action.support.BaseAction.execute(BaseAction.java:54)
at org.elasticsearch.action.support.BaseAction.execute(BaseAction.java:43)
at org.elasticsearch.client.node.NodeClient.get(NodeClient.java:127)
at TEST.main(TEST.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)


(Clinton Gormley) #2

On Wed, 2010-05-12 at 20:56 -0700, John Chang wrote:

I keep getting org.elasticsearch.indices.IndexMissingException from
ActionFuture.actionGet() when I try to search using the java client. It
throws the exception below and then hangs; never gets to the next line.

Does the index actually exist? I think you are speaking to the server
correctly, but making a request against an index that you haven't
created yet. (Note, I don't know the Java API at all, so I'm guessing
here)

clint

--
Web Announcements Limited is a company registered in England and Wales,
with company number 05608868, with registered address at 10 Arvon Road,
London, N5 1PR.


(Shay Banon) #3

Hi John,

You node probably did not connect to the cluster. You can check that using
the Admin -> Cluster APIs which exposes several APIs to check the nodes that
have been discovered and connected.

Regarding using the TransportClient, it will work fine (the discovery
disabled thingy is just another optimization that is not needed actually).
The drawback of using it is that your index request will probably go through
two hops till it gets to the shard it needs to be indexed to. The Node
client, since it knows the shard allocation, does that in one hop.

I prefer not to go through the jgroups reason of why this does not work
and how to configure it, since 0.7 will come with a different discovery
module called zen. I will note that if you want to apply configuration to
the Node you start, you have several options:

  1. Pass them as settings to the node builder. Note,
    the ImmutableSettings.settingsBuilder() allows you to load a configuration
    file from where ever you want).
  2. Place elasticsearch.yml or elasticsearch.json in your classpath, either
    in root, or under config/.

I assume that you don't have multicast enabled, and thats why you went with
unicast. I have already documented for the upcoming release the zen
discovery module, so you can see how this can be configured:
http://www.elasticsearch.com/docs/elasticsearch/modules/discovery/zen/.

In general, if you want to do it in code (you need to configure it in the
yaml file for the nodes you start as standalone processes), you can do this:

Node node = nodeBuilder()
.client(true)
.settings().put("discovery.zen.ping.unicast.hosts",
"host1:9300,host2:9300")
.node();

Another option is this (hosts as arrays):

Node node = nodeBuilder()
.client(true)
.settings().putArray("discovery.zen.ping.unicast.hosts", "host1:9300",
"host2:9300")
.node();

cheers,
shay.banon

On Thu, May 13, 2010 at 6:56 AM, John Chang jchangkihtest2@gmail.comwrote:

I keep getting org.elasticsearch.indices.IndexMissingException from
ActionFuture.actionGet() when I try to search using the java client. It
throws the exception below and then hangs; never gets to the next line.

I have tried a numer of things.

  1. setting the jvm props at statup with:
    -Djgroups.config=tcp -Djgroups.bind_port=9700
    -Djgroups.tcpping.initial_hosts=[9700],[9700],[9700]

  2. putting an elasticsearch.yml file (with the above values) into the
    directory from which I launch my program.

  3. putting in elasticsearch.yml into the launch dir, but commenting out the
    bind_port and intial_hosts and adding leaving those two to the jvm system
    props as described in #1 above.

Nothing works. I do find that I always get this error even if I set the
ports and hosts to intentionally wrong values - I don't get a connection
problem, just the IndexMissingException. So, I don't even know if I'm
reaching the host even when I put back in the correct hosts and port. That
said, I do know the hosts are up; and I know the index I am looking for is
there. I see the index it when I curl a _status GET call.

BTW: I am open to using the TransportClient if that is better; the client
will only ever query and post docs; it won't ever host indices. However, I
got the idea this is not supported when I saw this in TransportClient.java
// disabled, still having problems with jgroups acting just as
client
if (settings.getAsBoolean("discovery.enabled", true) && false) {
modules.add(new TransportClientClusterModule(settings));
}

My java code is below. Thanks in advance for any help you can provide.

public static void main(String[] args) {
Node node = nodeBuilder().client(true).node();
Client client = node.client();
final GetRequest getRequest = Requests.getRequest("foo");
final GetRequest getRequest1 = getRequest.type("mail");
final GetRequest getRequest2 = getRequest1.id("myIdAbc");
GetResponse response = client.get(getRequest2).actionGet(); //this
line throws the below stack trace then hangs
Iterator itr = response.iterator(); //never gets here
while (itr.hasNext()) {
GetField gf = itr.next();
System.out.println(gf.name() + ":");
for (Object o : gf.values()) {
System.out.println(o.toString());
}
}
node.close();
}

Exception in thread "main" org.elasticsearch.indices.IndexMissingException:
[foo] missing
at

org.elasticsearch.cluster.metadata.MetaData.concreteIndex(MetaData.java:174)
at

org.elasticsearch.action.support.single.TransportSingleOperationAction$AsyncSingleAction.(TransportSingleOperationAction.java:100)
at

org.elasticsearch.action.support.single.TransportSingleOperationAction$AsyncSingleAction.(TransportSingleOperationAction.java:81)
at

org.elasticsearch.action.support.single.TransportSingleOperationAction.doExecute(TransportSingleOperationAction.java:68)
at

org.elasticsearch.action.support.single.TransportSingleOperationAction.doExecute(TransportSingleOperationAction.java:46)
at
org.elasticsearch.action.support.BaseAction.execute(BaseAction.java:54)
at
org.elasticsearch.action.support.BaseAction.execute(BaseAction.java:43)
at org.elasticsearch.client.node.NodeClient.get(NodeClient.java:127)
at TEST.main(TEST.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/org-elasticsearch-indices-IndexMissingException-tp814129p814129.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(John Chang) #4

Thanks for your advice. I still get the same error, unfortunately.

I tried this (of course replacing host1:port,host2:port, host3:port with real values):
Node node = NodeBuilder.nodeBuilder()
.client(true)
.settings(ImmutableSettings.settingsBuilder().put("discovery.zen.ping.unicast.hosts", "host1:port,host2:port, host3:port"))
.node(); //from post pbut put in ImmutableSettings.settingsBuilder()

I did have to make a slight change from what you proposed to get it to compile. Note that I changed
.settings().put
to
.settings(ImmutableSettings.settingsBuilder().put

I assume that is what you meant.

DO I need to get rid of the elasticsearch.yml if I do this? I tried taking out the yml file in the launch dir. (I see it tries the launch dir first in Environment.resolveConfig). However, I think it is still picking up the elasticsearch.yml that comes bundled into elasticsearch-0.6.0.jar. Should I rip that out if I am going to config in the java code as you advise above?


(Shay Banon) #5

The elasticsearch yml file that comes with elasticsearch is empty and not
used. Have you use the cluster admin API to see if you are connected to
other nodes? The nodes info API will do that. I did not notice, but did you
build against the latest master? Cause that one does have the API I
suggested. Do you want to attach your client project and I will run it?

Last, I assume that you saw clinton email, have you created an index for the
one you are trying to perform the get against?

cheers,
shay.banon

On Thu, May 13, 2010 at 8:03 PM, John Chang jchangkihtest2@gmail.comwrote:

Thanks for your advice. I still get the same error, unfortunately.

I tried this (of course replacing host1:port,host2:port, host3:port with
real values):
Node node = NodeBuilder.nodeBuilder()
.client(true)

.settings(ImmutableSettings.settingsBuilder().put("discovery.zen.ping.unicast.hosts",
"host1:port,host2:port, host3:port"))
.node(); //from post pbut put in
ImmutableSettings.settingsBuilder()

I did have to make a slight change from what you proposed to get it to
compile. Note that I changed
.settings().put
to
.settings(ImmutableSettings.settingsBuilder().put

I assume that is what you meant.

DO I need to get rid of the elasticsearch.yml if I do this? I tried taking
out the yml file in the launch dir. (I see it tries the launch dir first
in
Environment.resolveConfig). However, I think it is still picking up the
elasticsearch.yml that comes bundled into elasticsearch-0.6.0.jar. Should
I
rip that out if I am going to config in the java code as you advise above?

View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/org-elasticsearch-indices-IndexMissingException-tp814129p815379.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(John Chang) #6
  1. I have not used the admin client; it was not clear to me what to do. Do you mean use the org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest class? If so, I'm not clear on what node names to pass in. Is the node name simply the host:port? Also, it is not clear to me which method I'd use; the only one that seems to imply validation is the validate() method, which just always returns null:
    @Override public ActionRequestValidationException validate() {
    return null;
    }

  2. I am not sure what you mean by "did you build against the latest master?" I am using 0.6.0 which I believe to be the latest version. Does that answer this question?

  3. There is not much to my project. I just import the elasticsearch-0.6.0.jar zip and all the dependencies (see below) and run the class you see below.

4 Yes, I do know the index exists. When I do a curl on a _status request (curl -G http://myhost.com:9200/_status), I see the index. See attached file curlCap.txt.<nabble_a href="curlCap.txt">curlCap.txt</nabble_a>.

Thank you for your time and attention.

import org.elasticsearch.client.;
import org.elasticsearch.action.get.
;
import org.elasticsearch.node.*;
import org.elasticsearch.util.settings.ImmutableSettings;
import java.util.Iterator;
public class TEST {
public static void main(String[] args) {
Node node = NodeBuilder.nodeBuilder()
.client(true)
.settings(ImmutableSettings.settingsBuilder().put("discovery.zen.ping.unicast.hosts", "mongo-left.ops-dev.cloud.kiha.com:9700,mongo-right.ops-dev.cloud.kiha.com:9700,mongo-arbiter.ops-dev.cloud.kiha.com:9700"))
.node();
Client client = node.client();
final GetRequest getRequest = Requests.getRequest("foo");
final GetRequest getRequest1 = getRequest.type("mail");
final GetRequest getRequest2 = getRequest1.id("myIdAbc");
GetResponse response = client.get(getRequest2).actionGet(); //this line throws the below stack trace then hangs
Iterator itr = response.iterator(); //never gets here
while (itr.hasNext()) {
GetField gf = itr.next();
System.out.println(gf.name() + ":");
for (Object o : gf.values()) {
System.out.println(o.toString());
}
}
node.close();
}
}

Imported jars:
aopalliance-1.0.jar joda-time-1.6.jar
elasticsearch-0.6.0.jar log4j-1.2.15.jar
google-collections-1.0.jar lucene-analyzers-3.0.1.jar
guice-2.0.jar lucene-core-3.0.1.jar
guice-assisted-inject-2.0.jar lucene-fast-vector-highlighter-3.0.1.jar
guice-multibindings-2.0.jar lucene-queries-3.0.1.jar
jackson-core-asl-1.5.0.jar netty-3.1.5.GA.jar
jackson-mapper-asl-1.5.0.jar slf4j-api-1.5.8.jar
jgroups-2.9.0.GA.jar slf4j-log4j12-1.5.8.jar
jline-0.9.94.jar


(Shay Banon) #7

On Thu, May 13, 2010 at 9:45 PM, John Chang jchangkihtest2@gmail.comwrote:

  1. I have not used the admin client; it was not clear to me what to do. Do
    you mean use the
    org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest class?
    If
    so, I'm not clear on what node names to pass in. Is the node name simply
    the host:port? Also, it is not clear to me which method I'd use; the only
    one that seems to imply validation is the validate() method, which just
    always returns null:
    @Override public ActionRequestValidationException validate() {
    return null;
    }

In elasticsearch, you pass a request instance to an API and get back a
response. The node status is exposed through the Client#admin#cluster#status
API which you pass a request to. If you don't provide any node, it will
return the status of all nodes available.

  1. I am not sure what you mean by "did you build against the latest
    master?"
    I am using 0.6.0 which I believe to be the latest version. Does that
    answer
    this question?

I meant built elasticsearch from source. See here:
http://www.elasticsearch.com/download/ (master).

  1. There is not much to my project. I just import the
    elasticsearch-0.6.0.jar zip and all the dependencies (see below) and run
    the
    class you see below.

ok, but you fill it with data somehow, right?

4 Yes, I do know the index exists. When I do a curl on a _status request
(curl -G http://myhost.com:9200/_status), I see the index. See attached
file curlCap.txt. http://n3.nabble.com/file/n815620/curlCap.txtcurlCap.txt
.

Thank you for your time and attention.

import org.elasticsearch.client.;
import org.elasticsearch.action.get.
;
import org.elasticsearch.node.*;
import org.elasticsearch.util.settings.ImmutableSettings;
import java.util.Iterator;
public class TEST {
public static void main(String[] args) {
Node node = NodeBuilder.nodeBuilder()
.client(true)

.settings(ImmutableSettings.settingsBuilder().put("discovery.zen.ping.unicast.hosts",
"mongo-left.ops-dev.cloud.kiha.com:9700,
mongo-right.ops-dev.cloud.kiha.com:9700,
mongo-arbiter.ops-dev.cloud.kiha.com:9700"))
.node();
Client client = node.client();
final GetRequest getRequest = Requests.getRequest("foo");
final GetRequest getRequest1 = getRequest.type("mail");
final GetRequest getRequest2 = getRequest1.id("myIdAbc");
GetResponse response = client.get(getRequest2).actionGet(); //this
line throws the below stack trace then hangs
Iterator itr = response.iterator(); //never gets here
while (itr.hasNext()) {
GetField gf = itr.next();
System.out.println(gf.name() + ":");
for (Object o : gf.values()) {
System.out.println(o.toString());
}
}
node.close();
}
}

Imported jars:
aopalliance-1.0.jar joda-time-1.6.jar
elasticsearch-0.6.0.jar log4j-1.2.15.jar
google-collections-1.0.jar lucene-analyzers-3.0.1.jar
guice-2.0.jar lucene-core-3.0.1.jar
guice-assisted-inject-2.0.jar lucene-fast-vector-highlighter-3.0.1.jar
guice-multibindings-2.0.jar lucene-queries-3.0.1.jar
jackson-core-asl-1.5.0.jar netty-3.1.5.GA.jar
jackson-mapper-asl-1.5.0.jar slf4j-api-1.5.8.jar
jgroups-2.9.0.GA.jar slf4j-log4j12-1.5.8.jar
jline-0.9.94.jar

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/org-elasticsearch-indices-IndexMissingException-tp814129p815620.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(John Chang) #8

As for the admin client, is perhaps this what you meant? I did not know what to pass into the IndicesStatusRequest constructor; you can see my guess below.

    IndicesAdminClient admin = client.admin().indices();
    ActionFuture<IndicesStatusResponse> future =  admin.status(new IndicesStatusRequest("mongo-left.ops-dev.cloud.kiha.com:9700"));
    IndicesStatusResponse futuResp = future.actionGet(5000);

At any rate, the third line above produces:
Exception in thread "main" org.elasticsearch.indices.IndexMissingException: [mongo-left.ops-dev.cloud.kiha.com:9700] missing. I get the same error when I put all 3 nodes in there:
ActionFuture future = admin.status(new IndicesStatusRequest("mongo-left.ops-dev.cloud.kiha.com:9700","mongo-right.ops-dev.cloud.kiha.com:9700","mongo-arbiter.ops-dev.cloud.kiha.com:9700"));


(John Chang) #9

I see what you mean - zen is for the upcoming release that I have to build, and won't work with 0.6.0. We tried to build it and it would not compile for us; we also prefer to go with release versions. So, I'm back to trying to get it to work with jgroups, which is where I started from and I still cannot get it to work.

Through the admin REST api I verified that I have not joined the cluster. I use http://mongo-arbiter.ops-dev.cloud.kiha.com:9200/_cluster/nodes and I do not see my program as a node. So, the question is why can't I connect?

In addition to what I tried in my first post, I've tried:
Client client = new TransportClient()
.addTransportAddress(new InetSocketTransportAddress("mongo-left.ops-dev.cloud.kiha.com", 9700))
.addTransportAddress(new In<nabble_a href="elasticsearch.yml">elasticsearch.yml</nabble_a>etSocketTransportAddress("mongo-right.ops-dev.cloud.kiha.com", 9700))
.addTransportAddress(new InetSocketTransportAddress("mongo-arbiter.ops-dev.cloud.kiha.com", 9700)
);
and this hangs.

I've tried
final NodeBuilder builder = NodeBuilder.nodeBuilder();
final NodeBuilder nodeBuilder = builder.client(true);
final ImmutableSettings.Builder builder1 =
ImmutableSettings.settingsBuilder().put("jgroups.tcpping.initial_hosts","mongo-left.ops-dev.cloud.kiha.com[9700],mongo-right.ops-dev.cloud.kiha.com[9700],mongo-arbiter.ops-dev.cloud.kiha.com[9700]")
.put("jgroups.config","tcp")
.put("jgroups.bind_port","9700");
Node node = nodeBuilder.settings(builder1).node();
Client client = node.client();
and I still get the org.elasticsearch.indices.IndexMissingException when I call client.get(myRequest)actionGet() because I can't join the cluster;

Also, as mentioned above, I tried without any config in the java and the elasticsearch.yml in my launch dir, and I still can't join the cluster.

Do I need to do something to the tcp.xml file? I see a jgroups.bind_port setting in there and also a jgroups.tcpping.initial_hosts setting. I tried editing that file too (was that the right thing to do?), and I still get the org.elasticsearch.indices.IndexMissingException because I can't join the cluster. I have attached here the <nabble_a href="tcp.xml">tcp.xml</nabble_a> file I am using (with my edits).

I have verified that I can see all 3 hosts on 9700.

Also, If it is of any use, attached is the <nabble_a href="elasticsearch.yml">elasticsearch.yml</nabble_a> that I am using when I start the nodes I'm trying to attach to.

I guess I prefer to set it all up through java, but config files are fine, too, if they work. I'm not having any luck with the examples here: http://www.elasticsearch.com/docs/elasticsearch/java_api/client/.

So, my main questions are:
Would it be possible to post some java as an example once you see the attached elasticsearch.yml which we use to start the intial hosts I'm trying to connect to using the 0.6.0 release? Also, please let me know what settings beyond any sample java code I need to do in config files.

I hope this is not too much to ask; I know there are examples on the site, but I just can't get them to work for me.

Thanks,
john


(Shay Banon) #10

The TransportClient does join the cluster, it works on it "remotely". In
this case, by the way, you specified the wrong port number. You specified
for the hosts the HTTP port, instead of the TCP port which is 9300. This
should definitely work regardless of jgroups, since its not used.

Regarding starting a node and joining the cluster as a client, I am going to
release 0.7 either today or tomorrow, so you can wait for it.

Last, getting the nodes status is simple:

client.admin().cluster().nodesInfo(new NodesInfoRequest());

cheers,
shay.banon

On Fri, May 14, 2010 at 6:28 AM, John Chang jchangkihtest2@gmail.comwrote:

I see what you mean - zen is for the upcoming release that I have to build,
and won't work with 0.6.0. We tried to build it and it would not compile
for us; we also prefer to go with release versions. So, I'm back to trying
to get it to work with jgroups, which is where I started from and I still
cannot get it to work.

Through the admin REST api I verified that I have not joined the cluster.
I
use http://mongo-arbiter.ops-dev.cloud.kiha.com:9200/_cluster/nodes and I
do
not see my program as a node. So, the question is why can't I connect?

In addition to what I tried in my first post, I've tried:
Client client = new TransportClient()
.addTransportAddress(new
InetSocketTransportAddress("mongo-left.ops-dev.cloud.kiha.com", 9700))
.addTransportAddress(new In
http://n3.nabble.com/file/n816419/elasticsearch.yml elasticsearch.yml
etSocketTransportAddress("mongo-right.ops-dev.cloud.kiha.com", 9700))
.addTransportAddress(new
InetSocketTransportAddress("mongo-arbiter.ops-dev.cloud.kiha.com", 9700)
);
and this hangs.

I've tried
final NodeBuilder builder = NodeBuilder.nodeBuilder();
final NodeBuilder nodeBuilder = builder.client(true);
final ImmutableSettings.Builder builder1 =

ImmutableSettings.settingsBuilder().put("jgroups.tcpping.initial_hosts","
mongo-left.ops-dev.cloud.kiha.com[9700],mongo-right.ops-dev.cloud.kiha.com
[9700],mongo-arbiter.ops-dev.cloud.kiha.com[9700]")
.put("jgroups.config","tcp")
.put("jgroups.bind_port","9700");
Node node = nodeBuilder.settings(builder1).node();
Client client = node.client();
and I still get the org.elasticsearch.indices.IndexMissingException when I
call client.get(myRequest)actionGet() because I can't join the cluster;

Also, as mentioned above, I tried without any config in the java and the
elasticsearch.yml in my launch dir, and I still can't join the cluster.

Do I need to do something to the tcp.xml file? I see a jgroups.bind_port
setting in there and also a jgroups.tcpping.initial_hosts setting. I tried
editing that file too (was that the right thing to do?), and I still get
the
org.elasticsearch.indices.IndexMissingException because I can't join the
cluster. I have attached here the
http://n3.nabble.com/file/n816419/tcp.xml tcp.xml file I am using (with
my
edits).

I have verified that I can see all 3 hosts on 9700.

Also, If it is of any use, attached is the
http://n3.nabble.com/file/n816419/elasticsearch.yml elasticsearch.yml
that
I am using when I start the nodes I'm trying to attach to.

I guess I prefer to set it all up through java, but config files are fine,
too, if they work. I'm not having any luck with the examples here:
http://www.elasticsearch.com/docs/elasticsearch/java_api/client/.

So, my main questions are:
Would it be possible to post some java as an example once you see the
attached elasticsearch.yml which we use to start the intial hosts I'm
trying
to connect to using the 0.6.0 release? Also, please let me know what
settings beyond any sample java code I need to do in config files.

I hope this is not too much to ask; I know there are examples on the site,
but I just can't get them to work for me.

Thanks,
john

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/org-elasticsearch-indices-IndexMissingException-tp814129p816419.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(John Chang) #11

Thanks a million!! Changing the port on the InetSocketTransportAddress fixed it. I can now connect and query as described here: http://www.elasticsearch.com/docs/elasticsearch/java_api/search/. That's a big step forward...thanks again!

I'm having trouble with getting a document by id as discussed here: http://www.elasticsearch.com/docs/elasticsearch/java_api/get/. I know the doc is there because I can see it with a GET (http://mongo-arbiter.ops-dev.cloud.kiha.com:9200/foo/mail/myFooId), but my iterator is empty when I try to search on it this way:
GetResponse response = client.get(Requests.getRequest("foo")
.type("mail")
.id("myFooId")).actionGet();
Iterator itr = response.iterator();
while (itr.hasNext()) {
GetField gf = itr.next();
System.out.println(gf.name() + ":");
for (Object o : gf.values()) {
System.out.println(o.toString());
}
}


(Shay Banon) #12

The GetField(s) returned if you request for them (you can them to the
request), note only stored fields will be returned. By default, the source
document is stored as is, so you can fetch it using the GetResult#sourceXXX
methods.

-shay.banon

On Fri, May 14, 2010 at 9:31 PM, John Chang jchangkihtest2@gmail.comwrote:

Thanks a million!! Changing the port on the InetSocketTransportAddress
fixed
it. I can now connect and query as described here:
http://www.elasticsearch.com/docs/elasticsearch/java_api/search/. That's
a
big step forward...thanks again!

I'm having trouble with getting a document by id as discussed here:
http://www.elasticsearch.com/docs/elasticsearch/java_api/get/. I know the
doc is there because I can see it with a GET
(http://mongo-arbiter.ops-dev.cloud.kiha.com:9200/foo/mail/myFooId), but
my
iterator is empty when I try to search on it this way:
GetResponse response = client.get(Requests.getRequest("foo")
.type("mail")
.id("myFooId")).actionGet();
Iterator itr = response.iterator();
while (itr.hasNext()) {
GetField gf = itr.next();
System.out.println(gf.name() + ":");
for (Object o : gf.values()) {
System.out.println(o.toString());
}
}

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/org-elasticsearch-indices-IndexMissingException-tp814129p818008.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.


(system) #13