Skip to content

Search within a slice with complex data. #1297

@mofirouz

Description

@mofirouz

Awesome project - thanks a lot for this!

I've been looking at the docs (and issues/PRs), and I've not found any references to my problem. I'd like to query a field within an array. I'm indexing the following data:

type Member struct {
  UserID       string            `json:"id"`
  SessionID    string            `json:"sid"`
  Metadata     map[string]string `json:"params"`
}
type Label struct {
  Id      int64      `json:"type_id,omitempty"`
  Members []*Member  `json:"members,omitempty"`
}

Label is the final variable that will be index as a JSON object.

My query currently looks like this:

+label.type_id:%v +label.members.id:%v

Would this be sufficient to find IDs that match the argument ID?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions