1
votes

my case is similar to this case: Click here!

I have a gallery which displays items from a Collection. I already added a Textinput.Text to give customers the opportunity to search for items.

But, what I am struggling with is to implement a "full-text" search.

The solution @carlosfigueira offered in the above-mentioned question works perfectly to split the search text but I would like to have display items on the gallery only that includes all individual strings.

This is my code for items on the gallery

Filter(
    CustomListIssues;
    Sum(
        ForAll(
            Filter(
                Split(
                    InpSearchString.Text;
                    " "
                );
                Len(Trim(Result)) > 0
            );
            If(
                Result in 'Title EN';
                1;
                0
            ) && "Unresolved" = Status && If(
                !IsEmpty(lbSearchDepartment.SelectedItems.Result);
                lbSearchDepartment.Selected.Value = Departement;
                "" in Departement
            )
        );
        Value
    ) > 0
)

CustomListIssues: A collection where I store all list items

InpSearchString.Text: Search TextInput.Text

'Title EN': The column I would like to search in based on the given search string

Overview App:

Image below to give you an overview of how it looks/works at the moment

enter image description here

  1. Given search string
  2. Trim(InpSearchString.Text)
  3. The gallery which displays items from a Collection

Expected result:

I would like to have display items on the gallery only that includes all individual strings

Thanks in advance

Sascha Dornig

1

1 Answers

0
votes

If you want to have all strings instead of one of them, you can slightly change the logic of the expression. Before it would sum 1 if a word is in the title, and check that the result is more than 0 (so if any is present, then the item would be returned). In this modified expression below, we're adding 1 if each word is not in the title, and at the end we compare the sum with 0 - if it's not zero, then at least one word was not found, and we don't return the record.

Filter(
    CustomListIssues;
    Sum(
        ForAll(
            Filter(
                Split(
                    InpSearchString.Text;
                    " "
                );
                Len(Trim(Result)) > 0
            );
            If(
                Result in 'Title EN';
                0;
                1
            ) && "Unresolved" = Status && If(
                !IsEmpty(lbSearchDepartment.SelectedItems.Result);
                lbSearchDepartment.Selected.Value = Departement;
                "" in Departement
            )
        );
        Value
    ) = 0
)