cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering custom columns on a folderish document with custom page provider

Phil_Ludlow
Star Contributor
Star Contributor

We have a section in Nuxeo for employee photos. These files are their own doctype contained in a custom, folderish doctype called "Library." For this Library, I have created a custom page provider with predicates and aggregates of schema fields relevant to these types of documents. I am having an issue with the filters for some of the fields though.

For example, every employee has an employee ID, so I have a schema/field for it called employee:employee_id (set as a string since IDs can contain letters or numbers). In the view of the parent container (Library) there is code to add a search filter in table view:

<nuxeo-data-table-column 
    name="Employee ID" 
    field="employee:employee_id"
    sort-by="[[_displaySort(document, 'employee:employee_id')]]" 
    filter-by="employee_employee_id" 
    filter-expression="$term*"
    flex="25">
    <template>[[item.properties.employee:employee_id]]</template>
</nuxeo-data-table-column>

That field is a predicate in my custom page provider, with a full text operator. Here is the setup: predicate-editor

The issue I have is that for some IDs that all all numbers the filter works as expected and filters correctly as a user types in characters. However, for any of the IDs that start with letters the filter doesn't find anything at all. What could be causing this issue? I've tried different config settings, but I'm missing something (likely simple). Any guidance would be appreciated. Thanks.

I've attached a video demo of the search not working for an ID that starts with letters.

demo

1 ACCEPTED ANSWER

Phil_Ludlow
Star Contributor
Star Contributor

Here is the final config that we are running with that works (at least mostly).

Screen Shot 2021-05-06 at 2.43.50 PM.png

View answer in original post

9 REPLIES 9

Gregory_Carlin
Elite Collaborator
Elite Collaborator

Hello, have you observed the same behavior with the STARTSWITH search operator?

Phil_Ludlow
Star Contributor
Star Contributor

If I use STARTSWITH then filtering doesn't work at all—it doesn't even work for the numbers that were working before. Also, it seems STARTSWITH should only be used for a path-type value?

Gregory_Carlin
Elite Collaborator
Elite Collaborator

The fulltext analyser behaviour can very between the backend database

Phil_Ludlow
Star Contributor
Star Contributor

We are on LTS 2019-HF42 (date 201901211253). Looks like Database is default of H2/Derby embedded databases, and I don't know much more since we are NCO—so whatever is the default for all of that.

Gregory_Carlin
Elite Collaborator
Elite Collaborator

Please do not open questions on answers.nuxeo.com if the question is related to a client

Phil_Ludlow
Star Contributor
Star Contributor

I thought that more general questions would be better served in this forum as others may have the same issues (I also didn't want to inundate support with tickets). However, I will do that from now on instead of using answers.nuxeo.com if that is the preferred option.

michal_m
Champ on-the-rise
Champ on-the-rise

Phil Ludlow I know the thread stopped a while ago, has your issue been resolved? My 2 cents: you may need to update ES mappings, title "Making STARTSWITH work" sounds promising 😉 https://doc.nuxeo.com/nxdoc/configuring-the-elasticsearch-mapping/#making-startswith-work-with-a-cus...

I should have posted back with the solution we went with. Thanks for the reference, we didn't go with STARTSWITH since it seemed to be specifically for path-like data, but we probably could make a custom ES mapping based on what you linked.

Phil_Ludlow
Star Contributor
Star Contributor

Here is the final config that we are running with that works (at least mostly).

Screen Shot 2021-05-06 at 2.43.50 PM.png

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.