Exemple #1
0
        private bool CurrentOrLegacyIndexDefinitionEquals(DocumentConvention documentConvention, IndexDefinition serverDef, IndexDefinition indexDefinition)
        {
            if (serverDef.Equals(indexDefinition))
            {
                return(true);
            }

            // now we need to check if this is a legacy index...
            var legacyIndexDefinition = GetLegacyIndexDefinition(documentConvention);

            return(serverDef.Equals(legacyIndexDefinition));
        }
Exemple #2
0
        private bool CurrentOrLegacyIndexDefinitionEquals(DocumentConvention documentConvention, IndexDefinition serverDef, IndexDefinition indexDefinition)
        {
            var oldIndexId = serverDef.IndexId;

            try
            {
                serverDef.IndexId = indexDefinition.IndexId;

                if (serverDef.Equals(indexDefinition, false))
                {
                    return(true);
                }

                // now we need to check if this is a legacy index...
                var legacyIndexDefinition = GetLegacyIndexDefinition(documentConvention);

                return(serverDef.Equals(legacyIndexDefinition, compareIndexIds: false, ignoreFormatting: true, ignoreMaxIndexOutput: true));
            }
            finally
            {
                serverDef.IndexId = oldIndexId;
            }
        }