Skip to content

Error Filtering Non-Indexed Field in SharePoint List #593

Open
@jsormaz

Description

@jsormaz

When I try to filter on a non-indexed field, I get the following error:

Error Message: Field 'Title' cannot be referenced in filter or orderby as it is not indexed. Provide the 'Prefer: HonorNonIndexedQueriesWarningMayFailRandomly' header to allow this, but be warned that such queries may fail on large lists.

How can I provide the header as described? It is not feasible for me to index every field that I need to filter by. I do not have an issue of large lists.

I am filtering using the following method:
query = sharepoint_list.q().expand('fields').select('Title','id')
query.chain().on_list_field('Title').equals('filter value')
matching_items = sharepoint_list.get_items(query = query)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions