title: Gremlin query search by search key across multiple vertex properties
body: <p>I am trying to write a search query where in the input is some search key and the requirement is to search among the vertices where the given input key matches the value of two or more property keys of the vertex. For example assuming that I have user vertices in my graph db with the following property keys:</p>
  
  <ul>
  <li>1) User first name</li>
  <li>2) User last name</li>
  <li>3) User email</li>
  </ul>
  
  <p>Now given a search key 'xyz' I have to search across the user vertices where any of the above three property keys matches the value 'xyz'. This is how I have approached the problem.</p>
  
  <pre><code>g.V.has('ENTITY_TYPE', 'USER').or(_().has('USER_EMAIL' , TEXT.REGEX , '.*xyz.*') , _().has('USER_FNAME' , TEXT.REGEX , '.*xyz.*''USER_EMAIL' , TEXT.REGEX , '.*xyz.*') , _().has('USER_LNAME' , TEXT.REGEX , '.*xyz.*')).dedup();
  </code></pre>
  
  <p>I have created the required mixed indices (three separate mixed indices) for USER_EMAIL, USER_FNAME and USER_LNAME as follows:</p>
  
  <pre><code>key = m.makePropertyKey("USER_EMAIL").dataType(String.class).make();
  m.buildIndex("serachbyemail",Vertex.class).addKey(key).buildMixedIndex("search");
  
  key = m.makePropertyKey("USER_FNAME").dataType(String.class).make();
  m.buildIndex("searchbyfname",Vertex.class).addKey(key).buildMixedIndex("search");
  
  key = m.makePropertyKey("USER_LNAME").dataType(String.class).make();
  m.buildIndex("typemixed",Vertex.class).addKey(key).buildMixedIndex("search");
  </code></pre>
  
  <p>This works fine. But I want to know if this is the best approach to this kind of problem? Or is there a better way to do this? Also I am using gremlin java api to write the above query. I am using dedup() to remove the duplicate vertices.</p>