Beispiel #1
0
 public ContentQueryParser(IMemoryCache cache, IJsonSerializer jsonSerializer, ITextIndex textIndex, IOptions <ContentOptions> options)
 {
     this.jsonSerializer = jsonSerializer;
     this.textIndex      = textIndex;
     this.cache          = cache;
     this.options        = options.Value;
 }
Beispiel #2
0
        public QueryByQuery(DataConverter dataConverter, ITextIndex indexer, IAppProvider appProvider)
            : base(dataConverter)
        {
            this.indexer = indexer;

            this.appProvider = appProvider;
        }
Beispiel #3
0
        public TextIndexingProcess(ITextIndex textIndexer, ITextIndexerState textIndexerState)
        {
            Guard.NotNull(textIndexer);
            Guard.NotNull(textIndexerState);

            this.textIndexer      = textIndexer;
            this.textIndexerState = textIndexerState;
        }
Beispiel #4
0
 public ContentsSearchSource(
     IAppProvider appProvider,
     IContentQueryService contentQuery,
     ITextIndex contentTextIndexer,
     IUrlGenerator urlGenerator)
 {
     this.appProvider        = appProvider;
     this.contentQuery       = contentQuery;
     this.contentTextIndexer = contentTextIndexer;
     this.urlGenerator       = urlGenerator;
 }
        public ContentQueryParser(IMemoryCache cache, IJsonSerializer jsonSerializer, ITextIndex textIndex, IOptions <ContentOptions> options)
        {
            Guard.NotNull(jsonSerializer, nameof(jsonSerializer));
            Guard.NotNull(textIndex, nameof(textIndex));
            Guard.NotNull(cache, nameof(cache));
            Guard.NotNull(options, nameof(options));

            this.jsonSerializer = jsonSerializer;
            this.textIndex      = textIndex;
            this.cache          = cache;
            this.options        = options.Value;
        }
Beispiel #6
0
            public async Task WriteAsync(ITextIndex textIndex, ITextIndexerState textIndexerState)
            {
                if (commands.Count > 0)
                {
                    await textIndex.ExecuteAsync(commands.Values.ToArray());
                }

                if (updates.Count > 0)
                {
                    await textIndexerState.SetAsync(updates.Values.ToList());
                }
            }
        public ContentsSearchSource(
            IAppProvider appProvider,
            IContentQueryService contentQuery,
            ITextIndex contentTextIndexer,
            IUrlGenerator urlGenerator)
        {
            Guard.NotNull(appProvider, nameof(appProvider));
            Guard.NotNull(contentQuery, nameof(contentQuery));
            Guard.NotNull(contentTextIndexer, nameof(contentTextIndexer));
            Guard.NotNull(urlGenerator, nameof(urlGenerator));

            this.appProvider        = appProvider;
            this.contentQuery       = contentQuery;
            this.contentTextIndexer = contentTextIndexer;
            this.urlGenerator       = urlGenerator;
        }
Beispiel #8
0
 public MongoContentCollectionPublished(IMongoDatabase database, IAppProvider appProvider, ITextIndex indexer, DataConverter converter)
     : base(database)
 {
     queryContentAsync    = new QueryContent(converter);
     queryContentsById    = new QueryContentsByIds(converter, appProvider);
     queryContentsByQuery = new QueryContentsByQuery(converter, indexer);
     queryIdsAsync        = new QueryIdsAsync(appProvider);
 }
Beispiel #9
0
        public QueryContentsByQuery(IJsonSerializer serializer, ITextIndex indexer)
        {
            this.serializer = serializer;

            this.indexer = indexer;
        }
Beispiel #10
0
        public MongoContentCollection(string name, IMongoDatabase database, IAppProvider appProvider, ITextIndex indexer, DataConverter dataConverter)
            : base(database)
        {
            this.name = name;

            queryAsStream   = new QueryAsStream(dataConverter, appProvider);
            queryBdId       = new QueryById(dataConverter);
            queryByIds      = new QueryByIds(dataConverter);
            queryByQuery    = new QueryByQuery(dataConverter, indexer, appProvider);
            queryReferences = new QueryReferences(dataConverter, queryByIds);
            queryReferrers  = new QueryReferrers(dataConverter);
            queryScheduled  = new QueryScheduled(dataConverter);
        }
Beispiel #11
0
 public QueryContentsByQuery(DataConverter converter, ITextIndex indexer, IAppProvider appProvider)
 {
     this.converter   = converter;
     this.indexer     = indexer;
     this.appProvider = appProvider;
 }
Beispiel #12
0
 public sealed record Args(Context Context, ISchemaEntity Schema, ITextIndex TextIndex);
 public MongoContentCollectionAll(IMongoDatabase database, IAppProvider appProvider, ITextIndex indexer, DataConverter converter)
     : base(database)
 {
     queryContentAsync    = new QueryContent(converter);
     queryContentsById    = new QueryContentsByIds(converter, appProvider);
     queryContentsByQuery = new QueryContentsByQuery(converter, indexer, appProvider);
     queryIdsAsync        = new QueryIdsAsync(appProvider);
     queryReferrersAsync  = new QueryReferrersAsync();
     queryScheduledItems  = new QueryScheduledContents();
 }
Beispiel #14
0
        public MongoContentRepository(IMongoDatabase database, IAppProvider appProvider, ITextIndex indexer, IJsonSerializer serializer)
        {
            Guard.NotNull(appProvider);
            Guard.NotNull(serializer);

            this.appProvider = appProvider;

            this.serializer = serializer;

            collectionAll       = new MongoContentCollectionAll(database, appProvider, indexer, serializer);
            collectionPublished = new MongoContentCollectionPublished(database, appProvider, indexer, serializer);
        }
Beispiel #15
0
 public MongoContentCollectionAll(IMongoDatabase database, IAppProvider appProvider, ITextIndex indexer, IJsonSerializer serializer)
     : base(database)
 {
     queryContentAsync    = new QueryContent(serializer);
     queryContentsById    = new QueryContentsByIds(serializer, appProvider);
     queryContentsByQuery = new QueryContentsByQuery(serializer, indexer);
     queryIdsAsync        = new QueryIdsAsync(appProvider);
     queryScheduledItems  = new QueryScheduledContents();
 }
Beispiel #16
0
 public Args(Context context, ISchemaEntity schema, ITextIndex textIndex)
 {
     Context   = context;
     Schema    = schema;
     TextIndex = textIndex;
 }
Beispiel #17
0
        public MongoContentRepository(IMongoDatabase database, IAppProvider appProvider, ITextIndex indexer, IJsonSerializer serializer)
        {
            Guard.NotNull(appProvider, nameof(appProvider));
            Guard.NotNull(serializer, nameof(serializer));

            this.appProvider = appProvider;

            converter = new DataConverter(serializer);

            collectionAll =
                new MongoContentCollection(
                    "States_Contents_All2", database, appProvider, indexer, converter);

            collectionPublished =
                new MongoContentCollection(
                    "States_Contents_Published2", database, appProvider, indexer, converter);
        }
Beispiel #18
0
        public static async Task <FilterNode <ClrValue>?> TransformAsync(FilterNode <ClrValue> filter, Context context, ISchemaEntity schema, ITextIndex textIndex)
        {
            var args = new Args(context, schema, textIndex);

            return(await filter.Accept(Instance, args));
        }