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

@ -34,7 +34,7 @@
</li> </li>
<li class="navbar-item"> <li class="navbar-item">
<!-- <a class="navbar-link is-arrowless" href="#">SEARCH</a> --> <!-- <a class="navbar-link is-arrowless" href="#">SEARCH</a> -->
<router-link class="navbar-link is-arrowless" to="/search">SEARCH</router-link> <router-link class="navbar-link is-arrowless" to="/search">OPENSEARCH</router-link>
</li> </li>
<li class="navbar-item"> <li class="navbar-item">
<!-- <a class="navbar-link is-arrowless" href="#">SERVICES</a> --> <!-- <a class="navbar-link is-arrowless" href="#">SERVICES</a> -->

View File

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

View File

@ -5,6 +5,10 @@ declare const VUE_API: string;
declare const SOLR_HOST: string; declare const SOLR_HOST: string;
declare const SOLR_CORE: string; declare const SOLR_CORE: string;
// OPENSEARCH
declare const OPEN_HOST: string;
declare const OPEN_CORE: string;
// const _EDGE_URL = EDGE_URL; // const _EDGE_URL = EDGE_URL;
// const _POINT_URL = POINT_URL; // const _POINT_URL = POINT_URL;
const _APP_URL = APP_URL; const _APP_URL = APP_URL;
@ -12,9 +16,17 @@ const _VUE_API = VUE_API;
const _SOLR_HOST = SOLR_HOST; const _SOLR_HOST = SOLR_HOST;
const _SOLR_CORE = SOLR_CORE; const _SOLR_CORE = SOLR_CORE;
// OPENSEARCH
const _OPEN_HOST = OPEN_HOST;
const _OPEN_CORE = OPEN_CORE;
// export { _EDGE_URL as EDGE_URL }; // export { _EDGE_URL as EDGE_URL };
// export { _POINT_URL as POINT_URL }; // export { _POINT_URL as POINT_URL };
export { _APP_URL as APP_URL }; export { _APP_URL as APP_URL };
export { _VUE_API as VUE_API }; export { _VUE_API as VUE_API };
export { _SOLR_HOST as SOLR_HOST }; export { _SOLR_HOST as SOLR_HOST };
export { _SOLR_CORE as SOLR_CORE }; export { _SOLR_CORE as SOLR_CORE };
// OPENSEARCH
export { _OPEN_HOST as OPEN_HOST };
export { _OPEN_CORE as OPEN_CORE };

View File

@ -7,6 +7,14 @@ export interface SolrResponse {
// facet_counts: FacetCount; // facet_counts: FacetCount;
} }
// OPENSEARCH
export interface OpenResponse {
responseHeader: ResponseHeader;
response: ResponseContent;
facets: FacetFields;
// facet_counts: FacetCount;
}
export interface ResponseHeader { export interface ResponseHeader {
status: boolean; status: boolean;
QTime: number; QTime: number;

View File

@ -3,6 +3,11 @@ export interface SolrSettings {
host: string; host: string;
} }
export interface OpenSettings {
core: string;
host: string;
}
export class ActiveFilterCategories { export class ActiveFilterCategories {
// count: number; // count: number;
// language!: Array<string>; // language!: Array<string>;

View File

@ -4,15 +4,20 @@ import VsResult from "@/components/vs-result/vs-result.vue";
import FacetCategory from "@/components/face-category/facet-category.vue"; import FacetCategory from "@/components/face-category/facet-category.vue";
import ActiveFacetCategory from "@/components/active-facet-category/active-facet-category.vue"; import ActiveFacetCategory from "@/components/active-facet-category/active-facet-category.vue";
import { SolrSettings } from "@/models/solr"; import { SolrSettings } from "@/models/solr";
import { OpenSettings } from "@/models/solr";
// import { DatasetService } from "@/services/dataset.service"; // import { DatasetService } from "@/services/dataset.service";
import DatasetService from "../../services/dataset.service"; import DatasetService from "../../services/dataset.service";
import { Suggestion, Dataset, SearchType } from "@/models/dataset"; import { Suggestion, Dataset, SearchType } from "@/models/dataset";
import { SolrResponse, FacetFields, FacetItem, FacetResults, FacetInstance } from "@/models/headers"; // import { SolrResponse, FacetFields, FacetItem, FacetResults, FacetInstance } from "@/models/headers";
import { OpenResponse, SolrResponse, FacetFields, FacetItem, FacetResults, FacetInstance } from "@/models/headers";
import { ActiveFilterCategories } from "@/models/solr"; import { ActiveFilterCategories } from "@/models/solr";
import { SOLR_HOST, SOLR_CORE } from "@/constants"; import { SOLR_HOST, SOLR_CORE } from "@/constants";
import { IPagination } from "@/models/pagination"; import { IPagination } from "@/models/pagination";
import PaginationComponent from "@/components/PaginationComponent.vue"; import PaginationComponent from "@/components/PaginationComponent.vue";
import { OPEN_HOST, OPEN_CORE } from "@/constants";
// Decorate the component and define its name and components // Decorate the component and define its name and components
@Component({ @Component({
name: "SearchViewComponent", name: "SearchViewComponent",
@ -54,6 +59,11 @@ export default class SearchViewComponent extends Vue {
host: SOLR_HOST, //"tethys.at", host: SOLR_HOST, //"tethys.at",
}; };
private open: OpenSettings = {
core: OPEN_CORE, //"rdr_data", // SOLR.core;
host: OPEN_HOST, //"tethys.at",
};
private error = ""; private error = "";
// Computed property to get search term as string // Computed property to get search term as string

View File

@ -91,6 +91,9 @@ module.exports = {
VUE_API: JSON.stringify(process.env.VUE_API), VUE_API: JSON.stringify(process.env.VUE_API),
SOLR_HOST: JSON.stringify(process.env.SOLR_HOST), SOLR_HOST: JSON.stringify(process.env.SOLR_HOST),
SOLR_CORE: JSON.stringify(process.env.SOLR_CORE), SOLR_CORE: JSON.stringify(process.env.SOLR_CORE),
// OPENSEARCH
OPEN_HOST: JSON.stringify(process.env.OPEN_HOST),
OPEN_CORE: JSON.stringify(process.env.OPEN_CORE),
}), }),
// new NodePolyfillPlugin(), // new NodePolyfillPlugin(),
], ],