Problem in search with where1 adding 'AND'
Hello, I am working with the API (Content Web Services 16.2.0) of OpenText Content Server, I am creating a function to perform searches using the SingleSearchRequest class among others, I indicate the query to perform to the setResultSetSpec parameter and everything seems to work fine, when I launch this query
"where1="OTLocation":1234"
returns the information correctly, but when I include it an AND like here:
Query":"where1="OTLocation":1234 AND "OTName":test2.txt"
It does not return any results, I have checked the files and it should return information
Do you know where the problem could be?
Thanks
Comments
-
@cgonzalm , I have moved your post to the Content Server area of the community so that you have the best audience for your inquiry.
1 -
does your format of Query work in the Complex Query view in Advanced Search via the Classic UI ?
0 -
The easiest is to pass your search as @Greg Griffiths to something like this.If your intention is search under Dataid for different things this is better syntax. It is explained in the search api documentation.The trick is to let the search know it is a "complexquery"
I enclose a working debug trace of something I did recently where I am searching under a location
// document.getElementById('where1').value = "[REGION OTLocation] 783819 AND ( ( [REGION Attr_785029_2] Ap*) AND ([REGION Attr_785029_5] Yes) )" ;
so using that I can write yours as
// document.getElementById('where1').value = "[REGION OTLocation] 783819 AND ( ( [REGION OTName] test2.txt) )"
My form conatins a hidden that passes the complexquery
<FORM ACTION="https://mylivelinkserver/otcs/cs.exe" METHOD="POST" NAME="searchFrm" id="searchFrm">
<!-- Your prompts to the user here -->
<BR>
<INPUT TYPE="HIDDEN" NAME="func" VALUE="search" >
<INPUT TYPE="HIDDEN" NAME="lookfor1" VALUE="complexquery" >0
Categories
- All Categories
- 122 Developer Announcements
- 54 Articles
- 148 General Questions
- 148 Thrust Services
- 56 OpenText Hackathon
- 37 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Cloud Fax and Notifications
- 84 Digital Asset Management
- 9.4K Documentum
- 31 eDOCS
- 186 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 7 XM Fax
- Follow Categories