code: @Override
     public FieldComparator<?> newComparator(String propertyName, int numHits, int sortPos, boolean reversed)
        throws IOException
     {
  
        try
        {
           QPath path = locationFactory.parseJCRPath(propertyName).getInternalPath();
           SimpleFieldComparator simple = (SimpleFieldComparator)createSimpleComparator(numHits, path);
           if (path.getEntries().length == 1)
           {
              return simple;
           }
           else
           {
              return createCompoundComparator(numHits, path, simple);
           }
        }
        catch (IllegalNameException e)
        {
           throw Util.createIOException(e);
        }
        catch (RepositoryException e)
        {
           throw Util.createIOException(e);
        }
     }
docs: Create a new <code>FieldComparator</code> for an embedded <code>propertyName</code>
  and a <code>reader</code>.
  
  @param propertyName the relative path to the property to sort on as returned
  by org.apache.jackrabbit.spi.Path#getString().
  @return a <code>FieldComparator</code>
  @throws java.io.IOException if an error occurs