Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
How to get Search Result contents
Tim_Swayn
I'm trying to write a program (Java) that will list the contents of a Saved Query but seem to be getting nowhere. I retrieve the Saved Query object successfully and then am not really sure what I'm supposed to do with it to get the listing out? I've tried issueing a ListObjects() method against it but it reports that the item has 0 children which I know is not the case.Please, someone, point me in the right direction....David
Find more posts tagged with
Comments
eLink User
Message from Dylan Wright via eLinki believe you want ApplyQuery:public int ApplyQuery( int ObjectID, LLVALUE selectList, String where, int sortBy, String rankBy, int; startAt, int forHowMany, String queryConversion, LLValue queryResults)look in the SDK API Dev Reference, section Search APIgood luckdylan> -----Original Message-----> From: eLink Discussion: Development Discussion> [mailto:development@elinkkc.opentext.com]> Sent: Thursday, October 26, 2000 11:48 AM> To: eLink Recipient> Subject: How to get Search Result contents> > > How to get Search Result contents> Posted by SHELLCaAdmin on 10/26/2000 02:45 PM> > I'm trying to write a program (Java) that will list the contents > of a Saved Query but seem to be getting nowhere. I retrieve the > Saved Query object successfully and then am not really sure what > I'm supposed to do with it to get the listing out? I've tried > issueing a ListObjects() method against it but it reports that > the item has 0 children which I know is not the case.> > Please, someone, point me in the right direction....> > David> > [To reply to this thread, use your normal e-mail reply function.]> > ============================================================> > Discussion: Development Discussion>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=786303&objAction=viewLivelink
Server:
https://knowledge.opentext.com/knowledge/livelink.exe
Tim_Swayn
Thanks but I can't seem to get it to work; To expand a bit on what I'm doing: 1) I get onto LiveLink via my browser and issue a query. I then save the results of this query in my Personal space under the name "Query Results". 2) Then, via my program, I try to do the following (the code is in some parts pseudo-ish for brevity):========================================================LLValue searchObject, selectList, queryResults;String whereClause;int searchId;search = new LAPI_SEARCH(session);searchObject = GetSearchObject("Query Results");searchId = searchObject.toInteger("ID");displayableFields = new LLValue();displayableFields.setList();if ( search.GetDisplayableFields(searchId, displayableFields) != 0 ){ System.out.println("sorry: " + fmtError(session));}whereClause = "*";selectList.add("Name");if ( search.ApplyQuery(searchId, selectList, whereClause, search.SORTBYRELEVANCY, "", 0, // startAt index 100, // for how many "None", // Query language queryResults) != 0 ){ System.out.println("sorry: " + fmtError(session));}==================================================The error I get is actually an exception thrown by GetDisplayableFields: LLIllegalOperationException: get(name) not implemented for this datatype.If I remove the GetDisplayableFields call, then I get the same exception in the ApplyQuery code. I am absolutely sure the the retrieved object is the "Query Results" object I saved when in my browser.The next thing I tried was the same code against a saved query (as opposed to the saved query results); I get a little further (the GetDisplayableFields call doesn't croak) but the error message I get is: "Can't get search results listing" from the ApplyQuery call.A bunch of things I can't figure out:1) The obvious: why do I get the exception.2) What is the format of the whereClause; for the OTSTARTS language, the doc seems to say its a regular expression which in my case "*" would qualify.3) The select list: is this the display name ("Name", for example) or the internal name ("OTName")? I've tried both and neither seem to work.4) There's probably some other things wrong with what I'm doing but I don't have a clue...Why do I have this drowning feeling?David
eLink User
Message from Dylan Wright via eLinkdavidi don't have much experience with applyquery, buti noticed your where clause is "*"here's what lapi doc says:The input parameters are assembled by the ApplyQuery function into apseudo-SQL statement, where the input parameters can be thought of as beingarranged in the following manner:SELECT selectList WHERE where SORTED BY sortBy STARTAT startAtFOR forHowManyso your where clause could be causing a problemcheers,dylan> -----Original Message-----> From: eLink Discussion: Development Discussion> [mailto:development@elinkkc.opentext.com]> Sent: Friday, October 27, 2000 9:26 AM> To: eLink Recipient> Subject: still not working>>> still not working> Posted by SHELLCaAdmin on 10/27/2000 12:22 PM>> Thanks but I can't seem to get it to work; To expand a bit on> what I'm doing:>> 1) I get onto LiveLink via my browser and issue a query. I then> save the results of this query in my Personal space under the> name "Query Results".>> 2) Then, via my program, I try to do the following (the code is> in some parts pseudo-ish for brevity):>> ========================================================> LLValue searchObject, selectList, queryResults;> String whereClause;> int searchId;>> search = new LAPI_SEARCH(session);> searchObject = GetSearchObject("Query Results");> searchId = searchObject.toInteger("ID");>> displayableFields = new LLValue();> displayableFields.setList();> if ( search.GetDisplayableFields(searchId,> displayableFields) != 0 )> {> System.out.println("sorry: " + fmtError(session));> }>> whereClause = "*";> selectList.add("Name");> if ( search.ApplyQuery(searchId,> selectList,> whereClause,> search.SORTBYRELEVANCY, "",> 0, // startAt index> 100, // for how many> "None", // Query language> queryResults) != 0 )> {> System.out.println("sorry: " + fmtError(session));> }> ==================================================>> The error I get is actually an exception thrown by> GetDisplayableFields: LLIllegalOperationException: get(name) not> implemented for this datatype.>> If I remove the GetDisplayableFields call, then I get the same> exception in the ApplyQuery code. I am absolutely sure the the> retrieved object is the "Query Results" object I saved when in my browser.>> The next thing I tried was the same code against a saved query> (as opposed to the saved query results); I get a little further> (the GetDisplayableFields call doesn't croak) but the error> message I get is: "Can't get search results listing" from the> ApplyQuery call.>> A bunch of things I can't figure out:> 1) The obvious: why do I get the exception.> 2) What is the format of the whereClause; for the OTSTARTS> language, the doc seems to say its a regular expression which in> my case "*" would qualify.> 3) The select list: is this the display name ("Name", for> example) or the internal name ("OTName")? I've tried both and> neither seem to work.> 4) There's probably some other things wrong with what I'm doing> but I don't have a clue...>> Why do I have this drowning feeling?> David>> [To reply to this thread, use your normal e-mail reply function.]>> ============================================================>> Topic: How to get Search Result contents>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=2392632&objAction=viewDiscussion
: Development Discussion
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=786303&objAction=viewLivelink
Server:
https://knowledge.opentext.com/knowledge/livelink.exe
Tim_Swayn
Dylan,Yeah, I read that too and I've tried all kinds of different things in there (from SQL statements, to regular expressions, to null and empty strings) and I still get the same error message.I find the doc just doesn't cut it. I was also looking around for some coding examples but haven't found anything. Other than the API doc, is there a programmer's guide or something? We didn't get one in our distribution but that's not to say it doesn't exist.David
eLink User
Message from Dylan Wright via eLinkalso you should do a setList() on selectList> -----Original Message-----> From: eLink Discussion: Development Discussion> [mailto:development@elinkkc.opentext.com]> Sent: Friday, October 27, 2000 9:26 AM> To: eLink Recipient> Subject: still not working>>> still not working> Posted by SHELLCaAdmin on 10/27/2000 12:22 PM>> Thanks but I can't seem to get it to work; To expand a bit on> what I'm doing:>> 1) I get onto LiveLink via my browser and issue a query. I then> save the results of this query in my Personal space under the> name "Query Results".>> 2) Then, via my program, I try to do the following (the code is> in some parts pseudo-ish for brevity):>> ========================================================> LLValue searchObject, selectList, queryResults;> String whereClause;> int searchId;>> search = new LAPI_SEARCH(session);> searchObject = GetSearchObject("Query Results");> searchId = searchObject.toInteger("ID");>> displayableFields = new LLValue();> displayableFields.setList();> if ( search.GetDisplayableFields(searchId,> displayableFields) != 0 )> {> System.out.println("sorry: " + fmtError(session));> }>> whereClause = "*";> selectList.add("Name");> if ( search.ApplyQuery(searchId,> selectList,> whereClause,> search.SORTBYRELEVANCY, "",> 0, // startAt index> 100, // for how many> "None", // Query language> queryResults) != 0 )> {> System.out.println("sorry: " + fmtError(session));> }> ==================================================>> The error I get is actually an exception thrown by> GetDisplayableFields: LLIllegalOperationException: get(name) not> implemented for this datatype.>> If I remove the GetDisplayableFields call, then I get the same> exception in the ApplyQuery code. I am absolutely sure the the> retrieved object is the "Query Results" object I saved when in my browser.>> The next thing I tried was the same code against a saved query> (as opposed to the saved query results); I get a little further> (the GetDisplayableFields call doesn't croak) but the error> message I get is: "Can't get search results listing" from the> ApplyQuery call.>> A bunch of things I can't figure out:> 1) The obvious: why do I get the exception.> 2) What is the format of the whereClause; for the OTSTARTS> language, the doc seems to say its a regular expression which in> my case "*" would qualify.> 3) The select list: is this the display name ("Name", for> example) or the internal name ("OTName")? I've tried both and> neither seem to work.> 4) There's probably some other things wrong with what I'm doing> but I don't have a clue...>> Why do I have this drowning feeling?> David>> [To reply to this thread, use your normal e-mail reply function.]>> ============================================================>> Topic: How to get Search Result contents>
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=2392632&objAction=viewDiscussion
: Development Discussion
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=786303&objAction=viewLivelink
Server:
https://knowledge.opentext.com/knowledge/livelink.exe
Geoff_Price_(JTASCAdmin_(Delete)_1422989)
selectlist.add("OTName");selectlist.add("OTObject");selectlist.add("OTOwnerID");selectlist.add("OTLLMIMEType");selectlist.add("OTSummary"); formatedQuery = "\"*\"";//Allocate search class LAPI_SEARCH lapi = new LAPI_SEARCH(session); //Create a place to store the results LLValue result = new LLValue().setAssocNotSet(); //do the search lapi.ApplyQuery(broker ,selectlist, formatedQuery, LAPI_SEARCH.SORTBYDEFAULT, "", startAt, forHowMany, "None", result);broker is the objID of the item you want to search on.startAt is the where you want to start retreiving results.forHowMany is the number of results to return.Hope this helpsJonathan
Deepika_Kowkuntla_(nidauser2_-_(deleted))
I am just starting research on making a search using the LAPI ApplyQuery command and there is very little info to go on. Many thanks to you guys for this discussion topic!Using the example in the prior post, how do you obtain the objectID for the broker parameter? The original code sample for this topic used a command called "GetSearchObject" but I cannot find that defined anywhere.Must I predefine a "Saved Query" using the Livelink web GUI that the LAPI program references? Can I use the objectID of the Enterprise WorkSpace to root the search to the enterprise level?Thanks in advance,Paul
Deepika_Kowkuntla_(nidauser2_-_(deleted))
Customer Support provided me with the attached sample Java program that does an ApplyQuery search. It uses the LAPI V 9.0. I tried it out and it works great.Enjoy!Paul