Hi
So I start a local cluster and place and index in it. The settings are
ImmutableSettings.Builder builder = ImmutableSettings.settingsBuilder()
.put("node.name", "node-test-" + System.currentTimeMillis())
.put("node.data", true)
.put("cluster.name", "cluster-test-" +
NetworkUtils.getLocalAddress().getHostName())
.put("index.store.type", "memory")
.put("index.store.fs.memory.enabled", "true")
.put("gateway.type", "none")
.put("path.data", "./target/elasticsearch-test/data")
.put("path.work", "./target/elasticsearch-test/work")
.put("path.logs", "./target/elasticsearch-test/logs")
.put("index.number_of_shards", "1")
.put("index.number_of_replicas", "0")
.put("cluster.routing.schedule", "50ms")
.put("node.local", true);
So in the test after placing the index I do a search query like this
SearchResponse response = client.prepareSearch(INSTRUMENTS_INDEX)
.setTypes(INSTRUMENT_TYPE)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
.setQuery(QueryBuilders.queryString(instrumentQuery.getQuery()))
.execute()
.actionGet();
WHere the query is really pointing to the index I created.
So the problem is that if i run this like this
- Create index
- Execute query
I get 0 results back BUT if I run it like this
- Create Index
- Thread.sleep(1000)
- Execute query
I get 1 result back.
So of cause this has to have something to do with the files being taken
away between running each test bacus eif I keep them around it works
without the sleep. Is there some sort of synchronization
or transaction status I need to check after creating the index to be
guaranteed it is in the storage BEFORE executing the query ?
Thanks
Magnus
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/33365892-ec1f-4feb-8918-dbbffe02ff1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.