When using the OODT CAS-FileManager “query” tool , the standard query format needs to adhere to Lucene’s query syntax.
A simple query often used is a query to obtain all products of a given product type:
cd $FILEMGR_HOME/bin ./query_tool --url http://localhost:9000 --lucene -query CAS.ProductType:GenericFile
The above query works fine, and returns productIDs for all products matching the product type ‘GenericFile’ if products exist. However, if the productType (or any other metadata key for that matter) has an underscore in it, the result will not match the intended product type.
ie. below will come back empty:
cd $FILEMGR_HOME/bin ./query_tool --url http://localhost:9000 --lucene -query CAS.ProductType:My_Custom_ProductType
The reason the above command fails is because Lucene treats all keywords separated by underscores “_” as separate search strings. This is akin to replacing the underscore “_” with an “AND”. Documentation for this issue is available at .
So it seems the problem lies with Lucene’s parsing syntax. Fortunately, there is a way around this issue: use sql querying instead.
cd $FILEMGR_HOME ./query_tool --url http://localhost:9000 --sql -query "SELECT CAS.ProductId FROM My_Custom_ProductType"