Skip to content

Aggregate and filter with full text indexes #54

Open
@bprinsloo

Description

Maybe I am missing something, but I can't get the $lookup to work with full text searches. I have a profile object which is a one to one to the users object (Decided to extend it). To pull in the in the users it seems aggregate was the most obvious choice. I want to use the following find in the aggregate:

profile.find(
        { $text: {
            $search: query
          }
        },
        {
          fields: {
            score: {
              $meta: 'textScore'
            }
          },
          sort: {
            score: {
              $meta: 'textScore'
            }
          }
        }
      );

An aggregate without the text query work. But using the above in an aggregate using the property observeSelector get "unknown operator: $text". I think my search translation into the aggregate might be faulty.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions