Server`s process exception while using Java API to query doc with N1QL

I was lookup doc by N1ql from bucket ,there are 3 million+ doc in the bucket,i want to retrieve 50000 documents by java like this:

query (Select.select("*")
.from("PriceCheckDB_second")
.where("busiConditHash="+hashValue 
+" and ExpireDate>\""+effectdate+"\""
+" and  EffectDate<\""+expiredate+"\"")

I begin retrieve for a while ,then i found one node was down from the UI, i stop retrive but the issue node was keeping high resource used that 99% cpu usage and keep using all along.

Hi,

first if you are using the Java fluent API, you should use it in the whole query like so"

Select.select("*").from(i("PriceCheckDB_second"))
    .where(
            x("busiConditHash").eq(x("hashValue"))
            .and(x("ExpireDate").gt(x("effectdate")))
            .and(x("ExpireDate").lt(x("expiredate")))
    );

You should also make sure you set a timeout to your query. Can you also show us the code you are using for the query?

About the 99% usage, either your setup is under size, either we have a bug. We need more informations about your setup.

Why do i can not use your code,i use client 2.2,it doesn`t have the ‘x’、‘i’ method .
my code is that :

bucket.async().query(Select.select("*").from("PriceCheckDB_second").where("busiConditHash="+hashValue 
   + " and ExpireDate>\""+effectdate+"\""+" and EffectDate<\""+expiredate+"\""))
.subscribe(result -> {
    result.rows().subscribe(row->System.out.println(row.value()));
    result.errors().subscribe(
        e -> System.err.println("N1QL Error/Warning: " + e),
        runtimeError -> runtimeError.printStackTrace()
    );
});

and i haven’t setup couchbase or system’s parameter

About x() and i() methods not working, that is because those are static methods from the Expression class. use a static import like so:

static import com.couchbase.client.java.query.dsl.Expression.*;

not sure what you mean in you second message…