0

I'm using Oracle Database and table consist of Title,Description,Language columns. Using BCS and creating BDCM file, I'm able to get all the data from Oracle Database. I could make managed properties (owsCusTitle,owsCusDESCR,owsLanguage) and link this to the crawled property and everything is OK. Now in my application, I'm showing data using search rest API like this:

http://mk3.spha.com/sites/search/_api/search/query?rowlimit=5&selectproperties='owsCusTitle,owsCusDESCR'&sourceid='a3dcf0d0-a1fe-409e-bb84-f407fc4b6be2'&querytext='title:"man*"'

But there are many records with owsCusTitle column as blank. I don't want to show those records. Is there any way to filter custom managed property in the query itself ?

1

I have good news and bad news, but I think I have a fix for the bad news! You CAN "filter" on any queryable managed property. Using your example if you append "owsCustTitle:Ruby" to your query

querytext='title:"man*" owsCustTitle:Ruby'

would return items that match the title wildcard query and have a CustTitle containing Ruby.

The bad news is you cannot query null. So you can't do "-owsCustTitle=null". The way to fix this is EASY. Just change your query to provide a default value when they encounter null. For example use the string "null". Then the indexer will return the string "null" and you can handle it in a query or in code.

BTW, good on you for using a rowlimit! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.