Coder Social home page Coder Social logo

kentico / xperience-by-kentico-algolia Goto Github PK

View Code? Open in Web Editor NEW
4.0 23.0 1.0 12.98 MB

Enables the creation of Algolia search indexes and the indexing of Xperience content tree pages using a code-first approach.

Home Page: https://www.kentico.com/

License: MIT License

C# 87.61% TypeScript 11.99% JavaScript 0.40%
algolia algolia-search kentico xperience-by-kentico xperience-by-kentico-integrations

xperience-by-kentico-algolia's Introduction

Xperience by Kentico Algolia

7-day bug-fix policy CI: Build and Test NuGet Package

Description

This integration enables you to create Algolia search indexes to index content of pages (content types with the 'Page' feature enabled) from the Xperience content tree using a code-first approach. To provide a search interface for the indexed content, developers can use the .NET API, JavaScript API, or the InstantSearch.js library.

Library Version Matrix

Xperience Version Library Version
>= 29.0.0 >= 4.1.0
28.x >= 3.x
>= 26.2.0, < 27.0.0 2.x

Dependencies

Package Installation

Add the package to your application using the .NET CLI

dotnet add package Kentico.Xperience.Algolia

Quick Start

  1. Add configuration from your Algolia account to the ASP.NET Core appsettings.json file:

    "CMSAlgoliaSearch": {
        "ApplicationId": "<your application ID>",
        "ApiKey": "<your Indexing API key>",
        "SearchKey": "<your Search API key>"
    }
  2. Define a custom DefaultAlgoliaIndexingStrategy implementation to customize how content pages/content items are processed for the index. See Custom-index-strategy.md

  3. Add this library to the application services, registering your custom DefaultAlgoliaIndexingStrategy and Algolia services

    // Program.cs
    services.AddKenticoAlgolia(configuration);
    services.RegisterStrategy<GlobalAlgoliaIndexingStrategy>("DefaultStrategy");
  4. Create an index in Xperience's Administration within the Search application added by this library. Administration search edit form

  5. Rebuild the index in Xperience's Administration within the Search application added by this library. Administration search edit form

  6. Display the results on your site with a Razor View ๐Ÿ‘.

Full Instructions

View the Usage Guide for more detailed instructions.

Contributing

To see the guidelines for Contributing to Kentico open source software, please see Kentico's CONTRIBUTING.md for more information and follow the Kentico's CODE_OF_CONDUCT.

Instructions and technical details for contributing to this project can be found in Contributing Setup.

License

Distributed under the MIT License. See LICENSE.md for more information.

Support

7-day bug-fix policy

This project has Full support by 7-day bug-fix policy.

See SUPPORT.md for more information.

Security

For any security issues see Kentico's SECURITY.md.

xperience-by-kentico-algolia's People

Contributors

bkapustik avatar fialafilip avatar hesspavel avatar kentico-ericd avatar kentico-jaroslavn avatar kenticomartins avatar lahvac avatar matej4545 avatar michaljakubis avatar ondrejhenek avatar radekpetruska avatar seangwright avatar skurekjakub avatar snyk-bot avatar zdeneks81 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

nittin-cz

xperience-by-kentico-algolia's Issues

Initial creation of pages under workflow get sent as Updates

Brief bug description

New pages under workflow are failing the check below to get the AlgoliaTaskType and being sent as UPDATES instead because the Workflow History of the page after initial save is created as version 0.1 making the second condition below false.

 if (eventName.Equals(WorkflowEvents.Publish.Name, StringComparison.OrdinalIgnoreCase) && node.WorkflowHistory.Count == 0)
 {
    return AlgoliaTaskType.CREATE;
 }

What went wrong?

Repro steps

Create a new page under workflow
Save that page
Publish
The page will get sent as a partial update to algolia with missing record information

Expected behavior

The page should be sent as a create

Algolia index detail error in administration + rebuild not working

Brief bug description

  • I tried to create Algolia index, following readme in this repo. In administration I see the algolia application with the created index. When I click on the index a detail page should open (which I see for a few miliseconds), but then I get error (Something went wrong!). No error in the event log, find attached console log from Chrome. consoleLog.txt

  • Other problem is that the index is empty. When I click on the rebuild button (in list of indexes, Kentico administration), I see green notification about rebuild in progress, but according to Algolia dashboard (where I see the created index), no records are added.

Repro steps

  1. Follow sections "Installation" and "Creating and registering an Algolia index" from readme
  2. Run project, go to Kentico administration, go to "Algolia" application, click on the created index

Test environment

  • Xperience by Kentico (26.2.0)
  • Kentico.Xperience.Algolia (2.0.0)

Screenshots

image
image

UIApplicationAttribute method not found

Brief bug description

The constructor of the UIApplicationAttribute class has been changed and cannot be called from the NuGet package:

[assembly: UIApplication(typeof(AlgoliaApplication), "Algolia", "{$integrations.algolia.applicationname$}", BaseApplicationCategories.DEVELOPMENT, Icons.Magnifier, TemplateNames.SECTION_LAYOUT)]

Test environment

  • Xperience by Kentico (26.0.2)
  • Kentico.Xperience.Algolia (1.0.0)

Additional context

stack trace of the error:
System.MissingMethodException: Method not found: 'Void Kentico.Xperience.Admin.Base.UIApplicationAttribute..ctor(System.Type, System.String, System.String, System.String, System.String, System.String)'.
1> at System.ModuleHandle.ResolveMethod(QCallModule module, Int32 methodToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount)
1> at System.ModuleHandle.ResolveMethodHandleInternal(RuntimeModule module, Int32 methodToken, ReadOnlySpan1 typeInstantiationContext, ReadOnlySpan1 methodInstantiationContext)
1> at System.ModuleHandle.ResolveMethodHandle(Int32 methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
1> at System.RuntimeType.GetMethodBase(RuntimeModule scope, Int32 typeMetadataToken)
1> at System.Reflection.RuntimeCustomAttributeData..ctor(RuntimeModule scope, MetadataToken caCtorToken, ConstArray& blob)
1> at System.Reflection.RuntimeCustomAttributeData.GetCustomAttributes(RuntimeModule module, Int32 tkTarget)
1> at CMS.Core.AssemblyDiscovery.IsAssemblyDiscoverable(Assembly assembly)
1> at CMS.Core.AssemblyDiscovery.AddOnlyDiscoverableAssembly(ICollection1 assemblies, Dictionary2 preloadedAssemblies, AssemblyName assemblyName, String filePath)
1> at CMS.Core.AssemblyDiscovery.ExecuteGetAssemblies(Boolean onlyDiscoverable)
1> at CMS.Core.AssemblyDiscovery.get_DiscoverableAssemblies()
1> at CMS.Core.AssemblyDiscovery.GetAssemblies(Boolean discoverableOnly)
1> at CMS.Core.AssemblyDiscoveryHelper.GetAssemblies(Boolean discoverableOnly)
1> at CMS.Core.ModuleDiscovery.GetModules()
1> at CMS.Core.ModuleEntryManager.GetDiscoverableModules()
1> at CMS.Core.ModuleEntryManager.ModuleCollectionsInitialization()
1> at CMS.Core.ModuleEntryManager.PreInit()
1> at CMS.Core.AppCore.PreInit()
1> at CMS.DataEngine.CMSApplication.PreInit(Boolean initializeContainer)
1> at Kentico.Web.Mvc.IServiceCollectionExtensions.PreInitCmsApplication()
1> at Kentico.Web.Mvc.IServiceCollectionExtensions.AddKenticoCore(IServiceCollection services)
1> at Kentico.Web.Mvc.StartupExtensions.AddKentico(IServiceCollection services, Action`1 featuresBuilder)
1> at Program.

$(String[] args) in C:\repos...

Add support for "Content items" fields

Motivation

Previously, our Dancing Goat sample site used the "Media files" data type for fields like Article.ArticleTeaser. These fields are supported by the MediaUrls attribute which outputs a list of absolute URLs to the selected media files.

With the release of the Content Hub, the ArticleTeaser field now uses the "Content items" data type, and our sample code no longer functions.

Proposed solution

A new attribute named something like ContentItemUrls which generates absolute URLs to the content items. Or, the functionality of MediaUrls and this new attribute could be combined into a single attribute which handles both data types.

Rebuild not working

Brief bug description

I created new Algolia index, but it is empty. When I click on the rebuild button (in list of indexes, Kentico administration), I see green notification about rebuild in progress, but according to Algolia dashboard (where I see the created index), no records are added.

No errors in event log. For each rebuild try, these two request are in the Algolia "Search API logs":

AlgoliaLog_Item1.txt
AlgoliaLog_Item2.txt

Repro steps

  1. Follow sections "Installation" and "Creating and registering an Algolia index" from readme
  2. Run project, go to Kentico administration, go to "Algolia" application, click on "build index" button

Expected behavior

Records should be added to the index (corresponding with the published pages of selected content type)

Test environment

  • Xperience by Kentico (26.2.0)
  • Kentico.Xperience.Algolia (2.0.1)

Additional context

Screenshots

Screenshots of search model, service registration and existing pages:
image
image
image

The NewsDetail page type has properties "Title" and "Perex" besides others.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.