fixed the query to use only the output dataset index type.

- query need to be enanced to permit the user to select
the dataset where search