How to use apisearch - 10 common examples

To help you get started, we’ve selected a few apisearch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apisearch-io / apisearch.io / src / js / machineLearningDemo.js View on Github external
constructor() {
        this.trainCounter = 0;
        this.albumsArray = albumsArray;
        this.api = apisearch(credentials);
        this.ui = apisearchUI(credentials);
    }
github apisearch-io / search-ui / lib / components / Result / ResultComponent.js View on Github external
ResultActions_1.configureQuery(props.environmentId, props.currentQuery, props.itemsPerPage, props.highlightsEnabled, props.promote.map(function (itemUUID) {
            return itemUUID instanceof ItemUUID_1.ItemUUID
                ? itemUUID
                : ItemUUID_1.ItemUUID.createFromArray(itemUUID);
        }), props.exclude.map(function (itemUUID) {
            return itemUUID instanceof ItemUUID_1.ItemUUID
github apisearch-io / search-ui / lib / components / Result / ResultComponent.js View on Github external
ResultActions_1.configureQuery(props.environmentId, props.currentQuery, props.itemsPerPage, props.highlightsEnabled, props.promote.map(function (itemUUID) {
            return itemUUID instanceof ItemUUID_1.ItemUUID
                ? itemUUID
                : ItemUUID_1.ItemUUID.createFromArray(itemUUID);
        }), props.exclude.map(function (itemUUID) {
            return itemUUID instanceof ItemUUID_1.ItemUUID
github apisearch-io / search-ui / src / Store.ts View on Github external
super();

        /**
         * Store initial state
         */
        this.dirty = true;

        /**
         * Current query instance
         */
        this.currentQuery = apisearch.createQueryMatchAll();

        /**
         * Data received
         */
        this.currentResult = apisearch.createEmptyResult();
    }
github apisearch-io / search-ui / src / components / SortBy / SortByActions.ts View on Github external
export function onChangeSearchAction(
    environmentId: string,
    currentQuery: Query,
    repository: Repository,
    selectedOption: string,
) {
    const clonedQuery = cloneDeep(currentQuery);
    const filterData = splitQueryValue(selectedOption);

    clonedQuery
        .sortBy(Apisearch
            .createEmptySortBy()
            .byFieldValue(
                filterData.field,
                filterData.sort,
            ),
        );

    clonedQuery.page = 1;
    const dispatcher = container.get(`${APISEARCH_DISPATCHER}__${environmentId}`);

    repository
        .query(clonedQuery)
        .then((result) => {
            dispatcher.dispatch({
                type: "RENDER_FETCHED_DATA",
                payload: {
github apisearch-io / search-ui / src / Store.ts View on Github external
constructor() {
        super();

        /**
         * Store initial state
         */
        this.dirty = true;

        /**
         * Current query instance
         */
        this.currentQuery = apisearch.createQueryMatchAll();

        /**
         * Data received
         */
        this.currentResult = apisearch.createEmptyResult();
    }
github apisearch-io / search-ui / src / Bootstrap.ts View on Github external
container.register(repositoryId, () => {
        return apisearch.createRepository(config);
    });
github apisearch-io / search-ui / src / ApisearchUI.ts View on Github external
public static create(config: any): ApisearchUI {

        apisearch.ensureRepositoryConfigIsValid(config);

        /**
         * Build environment Id
         */
        const environmentId = createEnvironmentId();

        /**
         * Bootstrapping ApisearchUI application
         */
        bootstrap(
            environmentId,
            config,
        );

        /**
         * Register handleActions method (store reducer)
github apisearch-io / search-ui / src / components / Result / ResultComponent.tsx View on Github external
props.exclude.map((itemUUID) => {
                return itemUUID instanceof ItemUUID
                    ? itemUUID
                    : ItemUUID.createFromArray(itemUUID)
            }),
            props.fields,