CouchBase throws error in Web Client but not in Java client

I recently started using couchbase. I observed a difference in behavior in using java client vs Web UI client.
I inserted a document in couchbase through java client, however when i try to query the document from Web UI client it throws error saying indexes not created.
How the Java client works without the indexes really getting created.
What’s the difference, if i am missing something please indicate and help.
I am new and wondering if this really making sense to anyone. Sorry

Post your statement that you tried on web UI. @eben.
Also you can check Indexes Tab see what indexes you have.
In Java client you might be using bucket.insert which directly insert doesn’t use N1QL.
If you already know keys you can do bugket.get(keyname).
N1QL works like SQL but you need indexes.


CREATE PRIMARY index ON BucketName;

Also checkout

Can you help me understand why it doesnt throw error when you try accessing the document from Java client. Why the difference?

You might not be using N1QL in Java client. You might be directly getting couchbase cache. Post your java client code.
If you know document key already you can try this WEB UI by specifying document keys.

SELECT * FROM BucketName USE KEYS [“key1”,“key2”,…];

Will I not be able to query the data with the json field keys and values in the stored documents from the client. If such please share me a sample.
I understood the above one will work only if i have the document key.

You can do once you create indexes and use N1QL from your java client. Checkout Java SDK documentation