Sorry your question read to me as you're looking for documents with not null or empty ids. If so the example in the above link should be what you're looking for.
Thanks for your follow up response. We are using a DLS query with a terms lookup as posted below. We want to modify the query such that when ${userId1} must not be null or empty before entering the terms lookup.
Thanks for the correction. I'm not familiar with DLS, so perhaps someone else might know the answer. However, looking at the DLS page you sent I'm assuming the values ${userIdN} are coming from are dynamic user attributes?
Normally I would expect value checks such as this to be carried out on the conduit that is passing the value rather than in Elasticsearch itself. But perhaps someone else has some experience and can help!
thanks for your response. Yes, the values of ${userIdN} are dynamic. The query I posted works properly. However, when the ${userIdN} is empty string "", we are getting an error. Thus we need to update the query such that we have to check if the ${userIdN} is NOT empty, use the terms lookup else skip. Similar to this SQL statement:
SELECT * FROM tbl where ( :${userId1} <> '' AND <TERMS_LOOKUP>)
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.