Skip to content

Meilisearch crashes when using a lot of filter clauses #2163

@martijnderidder

Description

@martijnderidder

Describe the bug
When using Meilisearch in production i want to exclude a lot of id's. But there is a limit when adding a lot of filters clauses.
Is there maybe another way of fixing this? I have a large set of invoices in one index. And i want to select only the documents thats have a relation_id from the user. But in our production website, some users already have 3000 more relations.

To Reproduce
When using a basic Laravel (PHP) envoirement i'm typing something like this. (Its a crazy example, but lets say i only want to exclude all id's except id 73)...

Route::get('/', function () {
    $ids = range(1, 2400);
    unset($ids[73]);

    $user = User::search('', function ($meilisearch, $query, $options) use ($ids) {
        $options['filter'] = '';
        foreach ($ids as $id) {
            $options['filter'] .= 'id != "'. $id .'" AND ';
        }

        $options['filter'] = substr($options['filter'], 0, -4);
        $options['sort'] = ['name:asc'];
        return $meilisearch->search($query, $options);
    })->paginate(20);

    dd($user);
});

I get an error;

cURL error 52: Empty reply from server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://meilisearch:7700/indexes/users/search

Expected behavior
I would expect that i can use a "unlimited" amount of filter clauses.

Meilisearch version: v0.25.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfeature request & feedbackGo to https://github.com/meilisearch/product/

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions