public static bool TryGetId(int docId, Scope scope, IndexReader reader, IndexState indexState, out Guid result)
        {
            result = Guid.Empty;

            if (!indexState.TryGet(docId, out var draft, out var published))
            {
                return(false);
            }

            if (scope == Scope.Draft && draft != 1)
            {
                return(false);
            }

            if (scope == Scope.Published && published != 1)
            {
                return(false);
            }

            var document = reader.Document(docId);

            var idString = document.Get(MetaId);

            if (!Guid.TryParse(idString, out result))
            {
                return(false);
            }

            return(true);
        }
 private bool IsForPublished(byte draft, int docId)
 {
     return(indexState.TryGet(id, draft, docId, out _, out var p) && p == 1);
 }
Beispiel #3
0
 private bool IsForPublished(int docId)
 {
     return(indexState.TryGet(docId, out _, out var p) && p == 1);
 }