How to use the @esri/arcgis-rest-portal.SearchQueryBuilder function in @esri/arcgis-rest-portal

To help you get started, we’ve selected a few @esri/arcgis-rest-portal 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 Esri / arcgis-rest-js / demos / node-cli-item-management / index.js View on Github external
({ searchText, itemTypes, itemTags, number }) => {
      const query = new SearchQueryBuilder()
        .match(session.username)
        .in("owner");

      // format the search query for item types
      const types = itemTypes.filter(type => type.length);

      // format the search query for item types
      if (types.length) {
        query.and().startGroup();
        types.forEach((type, index, types) => {
          query.match(type).in("type");
          if (index !== types.length - 1) {
            query.or();
          }
        });
        query.endGroup();
github roemhildtg / vscode-arcgis-assistant / src / lib / ArcGISTreeProvider.ts View on Github external
const items = await element.connection.getItems();
            return this.mapFolders(folders, element)
                .concat(this.mapItems(items, element));
        }

        if(element.type === ArcGISType.GroupFolder) {
            return this.getGroups(element);
        }

        if(element.type === ArcGISType.Group){
            const query = new SearchQueryBuilder().match(element.id || '').in('group');
            return this.getItems(element, query);
        }

        if(element.type === ArcGISType.Folder){
            const q = new SearchQueryBuilder().match(element.id || '').in('ownerfolder');
            return this.getItems(element, q);
        }

        return Promise.resolve([]);
    }
    ///////////////////////////////////////////////////////////////////////////////////
github roemhildtg / vscode-arcgis-assistant / src / lib / PortalConnection.ts View on Github external
public async getItems(params : any = {}){
        await this.authenticate();
        if(!params.q){
            const user = await this.authentication.getUser();
            params.q = new SearchQueryBuilder()
                .match(user.orgId || '')
                .in('orgid')
                .and()
                .match('root')
                .in('ownerfolder')
                .and()
                .match(this.authentication.username)
                .in('owner');
        }
        const query = {
            num: 100,
            ...this.params,
            ...params,
            authentication: this.authentication,
            portal: this.restURL,
        };