Forum Discussion

ywang's avatar
ywang
Adept
14 years ago

Question regarding restapi search

Hi,

 

   I am new to restapi and I tried to use the lithium restapi to perform some search. I am using the communitySearchContext object. Here is the URL I tried: http://lithosphere.lithium.com/lithium/restapi/vc/search/messages?f=id&q=1234&page=1&page_size=1

 

   I am expecting it return me a message which has the id field as 1234. It did return me a message but does not match what I expected. The message it returned has the id as 30821. What's wrong with my usage of the search api? Where can I find more examples of using the search api with query arguments to return the desired data?

 

  Thanks,

 

 

7 Replies

  • I know this is old, but it should get a major "bump," considering I haven't found ANY documentation explaining the available options PER search API parameter, like the "f" parameter in your case. I've only seen sprinkles of undocumented options here and there, like for different COMPLETELY undocumented options you can pass to the "q" parameter (such as date:[FROM --datestart-- TO --dateend]... Why isn't this stuff all documented somewhere? I'm more than happy for this post of mine to get downvoted a thousand times and reported as inappropriate as long as someone points me to a link to COMPREHENSIVE documentation on the search API.
  • tester3's avatar
    tester3
    Adept
    12 years ago

    Thanks for the quick reply, Susan. That is the documentation I've seen as "official," however, within the "q" parameter to the search, there is syntax and other options you can put in it to define other things, like a date range, etc. Here are some links to "sprinkled" undocumented options:

     

    Date Range: http://lithosphere.lithium.com/t5/developers-discussion/quot-Realtime-quot-metric-amp-for-a-certain-period-via-REST-API/m-p/53904/highlight/true#M1779

     

    Only including root nodes and filtering by labels: http://lithosphere.lithium.com/t5/developers-discussion/rest-api-search-blog-by-label/m-p/110479/highlight/true#M4052

     

    I would like all the available options for not only the "q" parameter, but also the rest of the parameters you can pass to the search API, please.

  • tester3's avatar
    tester3
    Adept
    12 years ago
    And I didn't pick my avatar, so hopefully my messages don't come off as if my eyebrows are in the "I'm angry" position.
  • SuzieH's avatar
    SuzieH
    Khoros Alumni (Retired)
    12 years ago

    Thanks for the clarification (both about what you need and the not-really-angry-eyes). I'll try to put together something more comprehensive for the search API doc. In the meantime, I'm hoping someone in Services or Engineering can help give you some additional pointers.

  • MLachapelle's avatar
    MLachapelle
    Helper
    12 years ago

    Hi tester3

    Have you received any answer or information in private about it? I am looking for the same answer then you were.

    Thanks