Multiple field search

Hi .
I want use a query for search in multiple fields in dgraph .
but i can’t find any example in dgraph document .

by example :
i have this string —> “apple computer com”
and i want search this string in 3 filed : title , firstname and lastname .
and if string match in any of filed give me response .

can you help me ?

I think Igor already has given the right response https://dgraph.slack.com/archives/C13LH03RR/p1573120337029100 (PS. This link doesn’t work anymore)

The slack workspace is closed…could you please shed some light on how to search on multiple fields

That would be something like:

{
  
  field1 as var(func: anyofterms(title, "apple computer com"))
  field2 as var(func: anyofterms(firstname, "apple computer com"))
  field3 as var(func: anyofterms(lastname, "apple computer com"))
  
  q(func: uid(field1, field2, field3)) {
    title
    firstname
    lastname
    products {
      model
    }
  }
}