Starting of conversion to OpenSearch

This commit is contained in:
Porras-Bernardez 2024-05-13 16:56:15 +02:00
parent 515ef24c54
commit fab69f496b
7 changed files with 54 additions and 2 deletions

View file

@ -3,12 +3,16 @@
// import { DatasetService } from "../../services/dataset.service";
import DatasetService from "../../services/dataset.service";
import { SolrSettings } from "@/models/solr";
import { OpenSettings } from "@/models/solr";
// import { ref } from "vue";
import { Component, Vue, Prop, Emit } from "vue-facing-decorator";
// import { Prop, Emit } from "vue-property-decorator";
import { Dataset, Suggestion, SearchType } from "@/models/dataset";
import { SOLR_HOST, SOLR_CORE } from "@/constants";
import { OPEN_HOST, OPEN_CORE } from "@/constants";
@Component({
name: "VsInput",
})
@ -36,6 +40,14 @@ export default class VsInput extends Vue {
// core: "test_data", // SOLR.core;
// host: "repository.geologie.ac.at",
};
private open: OpenSettings = {
core: OPEN_CORE, //"rdr_data", // SOLR.core;
host: OPEN_HOST, //"tethys.at",
// core: "test_data", // SOLR.core;
// host: "repository.geologie.ac.at",
};
// private rdrAPI!: DatasetService;
itemRefs!: Array<Element>;
emits = ["filter"];
@ -133,6 +145,7 @@ export default class VsInput extends Vue {
}
searchChanged(): void {
console.log("Search changed!");
this.selectedIndex = -1;
// Let's warn the parent that a change was made
// this.$emit("input", this.display);
@ -155,6 +168,7 @@ export default class VsInput extends Vue {
}
private request(): void {
console.log("searchTerm");
DatasetService.searchTerm(this.display, this.solr.core, this.solr.host).subscribe({
next: (res: Dataset[]) => this.dataHandler(res),
error: (error: string) => this.errorHandler(error),