# Query on secondary index returns null via Java client

**URL:** <https://discuss.aerospike.com/t/query-on-secondary-index-returns-null-via-java-client/1365>\
**Category:** Java Client\
**Tags:** secondary, index\
**Created:** [June 11, 2015, 4:46pm UTC](https://discuss.aerospike.com/t/query-on-secondary-index-returns-null-via-java-client/1365 "2015-06-11T16:46:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohitkochar](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitkochar](https://discuss.aerospike.com/u/rohitkochar)\
**Post date:** [June 11, 2015, 4:46pm UTC](https://discuss.aerospike.com/t/query-on-secondary-index-returns-null-via-java-client/1365/1 "2015-06-11T16:46:50Z")

</div>

I am facing a weird situation while querying data on secondary index using Java client.

I have a 2 node aerospike cluster with data replication set to 2 which means both the node should contain all the data.Lets say my Nodes are Node1 and Node2. When i initialise the Java client using only Node1 as seed node and query the data on secondary index using the “equals” filter the resultant recordset is null,whereas when i perform the same query using Node2 as the seed node i get the expected result.

I tried querying using aql by logigng into both the nodes and i get the expected result on both hosts.

Using Node 1 as seed node when i try to query the same data on the key instead of secondary index it works fine. Initially i though my cluster must be going through some rebalancing but even after waiting for long i still face the same problem. I checked the status of index on both the nodes and it shows state as"RW" and “sync\_state” as “synced”.

I have tried dropping and re-creating the index but even that doesn’t help. Any pointers?

---

<div class="post-metadata">

**Author:** ![rohitkochar](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitkochar](https://discuss.aerospike.com/u/rohitkochar)\
**Post date:** [June 12, 2015, 9:13am UTC](https://discuss.aerospike.com/t/query-on-secondary-index-returns-null-via-java-client/1365/2 "2015-06-12T09:13:48Z")

</div>

I believe i have figured out the issue,it was to do something with the network connectivity between client and aerospike servers.

Will keep posted if i again see this issue
