code: public static String getQuery(String clazzFieldName, String clazzName, String idFieldName, Object idFieldValue,
              String entityClazz)
      {
          StringBuffer sb = new StringBuffer("+");
          sb.append(clazzFieldName);
          sb.append(":");
          sb.append(clazzName);
          sb.append(" AND ");
          sb.append("+");
          sb.append(idFieldName);
          sb.append(":");
          sb.append(idFieldValue);
          if (entityClazz != null)
          {
              sb.append(" AND ");
              sb.append("+");
              sb.append(IndexingConstants.ENTITY_CLASS_FIELD);
              sb.append(":");
              sb.append(entityClazz);
          }
          return sb.toString();
      }
docs: Returns lucene based query.
  
  @param clazzFieldName
  lucene field name for class
  @param clazzName
  class name
  @param idFieldName
  lucene id field name
  @param idFieldValue
  lucene id field value
  @param entityClazz
  the entity clazz
  @return query lucene query.