- renamed 'models' and 'validators' folders - removed unneccessary files in contracts folder
This commit is contained in:
parent
a29865b781
commit
08c2edca3b
62 changed files with 371 additions and 458 deletions
|
@ -1,17 +1,17 @@
|
|||
// import Logger from '@ioc:Adonis/Core/Logger';
|
||||
import { XMLBuilder } from 'xmlbuilder2/lib/interfaces.js';
|
||||
import { create } from 'xmlbuilder2';
|
||||
import Dataset from '#app/Models/Dataset';
|
||||
import Dataset from '#models/dataset';
|
||||
import XmlModel from '#app/Library/XmlModel';
|
||||
import { readFileSync } from 'fs';
|
||||
import SaxonJS from 'saxon-js';
|
||||
import { Client } from '@opensearch-project/opensearch';
|
||||
import { getDomain } from '#app/Utils/utility-functions';
|
||||
import { getDomain } from '#app/utils/utility-functions';
|
||||
import { BaseCommand, flags } from '@adonisjs/core/ace';
|
||||
import { CommandOptions } from '@adonisjs/core/types/ace';
|
||||
import env from '#start/env';
|
||||
// import db from '@adonisjs/lucid/services/db';
|
||||
// import { default as Dataset } from '#app/Models/Dataset';
|
||||
// import { default as Dataset } from '#models/dataset';
|
||||
|
||||
const opensearchNode = env.get('OPENSEARCH_HOST', 'localhost');
|
||||
const client = new Client({ node: `http://${opensearchNode}` }); // replace with your OpenSearch endpoint
|
||||
|
@ -33,7 +33,7 @@ export default class IndexDatasets extends BaseCommand {
|
|||
|
||||
async run() {
|
||||
this.logger.info('Hello world!');
|
||||
// const { default: Dataset } = await import('#app/Models/Dataset');
|
||||
// const { default: Dataset } = await import('#models/dataset');
|
||||
// const datasets = await Dataset.query().where('server_state', 'published').exec(); //this.getDatasets();
|
||||
const datasets = await this.getDatasets();
|
||||
const proc = readFileSync('public/assets2/solr.sef.json');
|
||||
|
@ -48,10 +48,10 @@ export default class IndexDatasets extends BaseCommand {
|
|||
}
|
||||
|
||||
private async getDatasets(): Promise<any[]> {
|
||||
// const { default: Dataset } = await import('#app/Models/Dataset');
|
||||
// const Dataset = (await import('#app/Models/Dataset')).default
|
||||
// const { default: Dataset } = await import('#models/dataset');
|
||||
// const Dataset = (await import('#models/dataset')).default
|
||||
// const Dataset = (
|
||||
// await this.app.container.make('#app/Models/Dataset')
|
||||
// await this.app.container.make('#models/dataset')
|
||||
// ).default;
|
||||
// const query: ModelQueryBuilder<Dataset, any> = db.from(Dataset);
|
||||
const query = Dataset.query().preload('xmlCache').where('server_state', 'published');
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue