CMS : Full-Text Query : Repeating attribute comparison

Options

Hello , I have an issue with full-text query repeating attribute comparison using 'contains' , I don't

konw if I'm using the correct syntax !

Answers

  • LazarescuA
    LazarescuA E Member
    Options

    Hello @Med_2024 ,

    I am using it like this:

    {
      "vals": {
        "q": [
          "cms_any.all_values:\"*\" AND lib_app_sebs_docs.r3_ss:\"aa\" AND cms_any.latest_b:true"
        ],
        "sort": [
          "cms_any.name_s asc"
        ]
      }
    }
    

    You don't use contains, contains is only if you use the /cms/instances/{category}/{type} and use the filter query string with a repeating value. See below how it works for me with the full text search. r3 is my repeating attribute and aa is the value.

  • LazarescuA
    LazarescuA E Member
    Options

    PS: for search v2 you probably need to replace the . with __ between the type name and the field name.

  • Med_2024
    Options

    I understand that with repeating attributes we also use ":" , my question was based on this information :

    I also noted that the facet on repeating attributes will return divided values , for instance in your example we will

    have :

    What I expect is this :

  • LazarescuA
    LazarescuA E Member
    Options

    Hi @Med_2024 ,

    Yes, all the operators eq, gt, ge, lt, le, contains, like and not like are the operators used by the filter query parameter of the cms/instances/{category}/{type} call. It will not use the Full Text query but rather the metadata fields similar to a database query.

    Example: https://na-1-dev.api.opentext.com/cms/instances/file/lib_app_sebs_docs?include-total=true&page=1&items-per-page=10&sortby=name asc&filter=latest eq 'true' and r3 contains('aa')

    On the faceted search, I agree with the facets generated, I would not be interested on how many items have both aa and bb, but rather how many have aa, how many have bb as distinct items. Alternatively, you can store them as a single value string, comma separated, then the facets will be generated as you mentioned above.

    These are things you will consider when creating your data model at the beginning of the application.

    I hope this helps.

  • Med_2024
    Options

    At the beginning I used the simple search of CMS API and facets implmented in the UI , but because of the

    limitation on the facets(facets on the displayed data only) I opted for the use oh the full-text query .

    Thanks for your help @LazarescuA .😊