CMS : Full-Text Query : execute full-text search ?

Options
Med_2024
edited February 23 in Services #1

Hello ,

I have a requirement to use the full-text query but I faced some issues :

  1. error "Search" is not enabled for tenant"

2) The documentation for this API is insufficient

Answers

  • gvicari
    gvicari E Community Moderator
    Options

    Hi @Med_2024, full-text is indeed disabled by default. I'll check with the team to update the documentation.

    In the meantime, you can go to the tutorial/sample application in GitHub (https://github.com/opentext/demo-contract-approval-app). The "postman" folder contains both a postman collection and environment that you can run inside of Postman.

    In the Cloud Developer Tutorial collection structure, the /Content Metadata Service (CMS)/full-text folder contains the different requests related to enabling FT indexing. Try this out to see if it solves your problem.

  • Hello @gvicari, Thank for your response , I enabled the Full-Text Query for my tenant , but for the POST api call

    for executing the search query , I did not figure out how to provide the correct values the following parameters in the

    body as I interested in the facets and the example in the postman collection dosen't cover this !

  • gvicari
    gvicari E Community Moderator
    Options

    @Med_2024, this is with the content team and they are looking into your request.

  • Karen Weir
    Karen Weir E Community Administrator
    Options

    Thanks @gvicari

    We are indeed working with teams to update our documentation. @Med_2024 , thank you for your diligence and collaboration. I understand that you have connected with @LazarescuA to learn more about the search functionality.

  • @Med_2024 I have attached a collection with some examples for using facets. Let me know if this helps.

  • Med_2024
    Options

    Hello @Prasanna Sridharan , Thank you for your response , so I tested the examples you provided , but in the API

    calls results I can't see the information related to facets , only the collection of Type Instances ,

    any idea about this ?

  • LazarescuA
    LazarescuA E Member
    Options

    Hello @Med_2024 ,

    If you run the tests that Prasana provided, there is an example for faceted search. The way that works, is:

    • you send the pagination through the url parameters similarly to an instances call
    • you send the required facet(s) in the body of the request (NOTE: my tenant is on search v1, so I am using . between the type name and the value. In search v2 you will replace the . with double underscore __ just like in Prasana's examples)
    • you get the response with the same _embedded.collection[] array with the objects
    • also in the response, you will get the facets information (after page and total fields):
    • Then, if you want to use a facet for filtering, reissue the initial call to /cms/ft-search using it: (I am filtering for just the text/plain value)
    • and the new response will recalculate the facets also:

    If you want, you can post here the payload and the response to see if there is anything wrong in there.

  • Med_2024
    Options

    Hello @LazarescuA and thank you for assisting ,

    This is a simple test , I'm missing something ?

  • Med_2024
    Options

    @LazarescuA , it worked with facet.field , I don't know if this search v1 or v2 ?

  • LazarescuA
    Options

    You can try the following endpoint to check your version of search:

    /cms/tenants/{{tenant_id}}

    Do a get REST request where tenant_id is your tenant id.

    One of the response fields is searchVersion - for me it is 1.

    @Prasanna Sridharan what is the right notation for facet field in the request body, facet.field or facet__field?

  • Med_2024
    Options

    The searchVersion for me is 2 .

  • Med_2024
    Options

    Hello @Prasanna Sridharan , Hello @LazarescuA , I have this issue when using the following query alone it returns

    the result , but when used with facet the result is empty ?? Thank you