Unable to get gte and lte from elastic Java API in range query

the query is not working and if you see there are two fields IpToLong and IPFromLong.
and I what to apply range query on two.if given long is gte than IPFromlong and lte than IptoTolong it's not working if I use them together.