Lime Web Components API Documentation - v7.4.0
    Preparing search index...

    Interface SearchOptionsBeta

    Options for searching objects with LimeObjectRepository.search.

    import { PlatformServiceName } from '@limetech/lime-web-components';

    const limetypes = platform.get(PlatformServiceName.LimeTypeRepository);
    const repository = platform.get(PlatformServiceName.LimeObjectRepository);

    const company = limetypes.getLimeType('company');

    if (company) {
    const response = await repository.search('Lundalogik', {
    limetypes: [company],
    limit: 25,
    });

    console.log(`Found ${response.objects.length} companies`);
    }

    LimeObjectRepository.search for searching

    interface SearchOptions {
        exact?: boolean;
        limetypes?: LimeType[];
        limit?: number;
    }
    Index

    Properties

    exact?: boolean

    Whether to match the search terms whole instead of as prefixes.

    By default each term is treated as a prefix, so searching for Vaksala-lunda 29:2 also matches Vaksala-lunda 29:21. When true, every term must match in full and in order, ignoring case, so Vaksala-lunda 29:21 is no longer a hit.

    Relation descriptive and option properties are always matched as prefixes, and ignore this option.

    import { PlatformServiceName } from '@limetech/lime-web-components';

    const repository = platform.get(PlatformServiceName.LimeObjectRepository);

    // Matches `Vaksala-lunda 29:2`, but not `Vaksala-lunda 29:21`
    const response = await repository.search('Vaksala-lunda 29:2', {
    exact: true,
    });

    console.log(`Found ${response.totalCount} objects`);
    limetypes?: LimeType[]

    Limetypes to search within.

    Only objects of these limetypes are returned, and a limetype named here is searched even when search is disabled for it. Hit counts are still reported for every limetype that has search enabled, so the user can see what a wider search would find. If omitted, all limetypes with search enabled are searched.

    limit?: number

    Maximum number of objects to return.

    Use 0 to get hit counts and totals without any objects. If omitted, a default limit is applied by the backend.