1 Reply Latest reply on Dec 13, 2016 2:22 AM by gopi.gorantala

    Search exact match in Subject of Discussion - Rest API

    nrajesh

      Hi,

       

      Our application would like to search communities to find a Discussion accurately for a Case Number by searching the Case Number in the Subject part of all Discussions. The Subject of the Discussion will be in the format -> “[2006623728] - [XXXX] - [XXXXXXXXXXXXX]” where 2006623728 is the Case number.

       

      https://xxxxxx.com/api/core/v3/search/contents?filter=type(discussion)&filter=subjectonly(true)&filter=search(2006623762)

       

      Is this correct one or any other ways are there to match case number in Subject.

       

      Regards

      Rajesh

        • Re: Search exact match in Subject of Discussion - Rest API
          gopi.gorantala

          You should use something like below.

           

          You can strip off the fields which you don't need in your JSON as below by adding &fields=-id,-type etc. or if you feel some data is missing in rest api you can add them using &fields=categories,subjectlength etc..     Below is the query which can narrow down based on your search results

           

          /api/core/v3/contents?filter=type(discussion)&fields=-id,-resources,-tags,-parentPlace,-content,-categories,-attachments,-outcomeTypes,-author

           

          After this you get less fields in each content type, now you can use the OSAPI or Ajax to compare the subject with your test.

           

          -Gopi.