From f685838c484d535d630c95dbf091cbfe3a6bf9ae Mon Sep 17 00:00:00 2001 From: Geert Josten Date: Tue, 16 Apr 2019 08:59:34 +0200 Subject: [PATCH 1/4] Updated year --- LICENSE | 2 +- NOTICE.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index ad279bf..801eb17 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright © 2018 MarkLogic Corporation. +Copyright © 2019 MarkLogic Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/NOTICE.txt b/NOTICE.txt index f7d040e..b1e9bb9 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,6 +1,6 @@ Grove -Copyright © 2018 MarkLogic Corporation. +Copyright © 2019 MarkLogic Corporation. This project and its code and functionality is not representative of MarkLogic Server and is not supported by MarkLogic. From 2b7e8e8b57fd4b1e53b8be9479534f70f9b99534 Mon Sep 17 00:00:00 2001 From: Geert Josten Date: Tue, 16 Apr 2019 08:59:47 +0200 Subject: [PATCH 2/4] Updated package name --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index d5b31ba..c5693fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "grove-vue-ui", + "name": "@marklogic-community/grove-vue-ui", "version": "1.0.0-rc.1", "lockfileVersion": 1, "requires": true, diff --git a/package.json b/package.json index 86cb535..1275d39 100755 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "grove-vue-ui", + "name": "@marklogic-community/grove-vue-ui", "version": "1.0.0-rc.1", "private": true, "grove": { From f2c7548c44cc83beacfd73aeeab57f131669c118 Mon Sep 17 00:00:00 2001 From: Jan Michael Yu Date: Fri, 3 May 2019 18:49:17 +0800 Subject: [PATCH 3/4] fix for using search:search using custom constraint instead of extsimilar --- src/api/SearchApi.js | 31 +++++++++++++++++++++++++++++++ src/components/ml-similar.vue | 32 +++++++++++++------------------- 2 files changed, 44 insertions(+), 19 deletions(-) diff --git a/src/api/SearchApi.js b/src/api/SearchApi.js index 391e64b..fea1982 100755 --- a/src/api/SearchApi.js +++ b/src/api/SearchApi.js @@ -169,5 +169,36 @@ export default { return error; } ); + }, + getSimilar(uri) { + let custom = { + "query": { + "queries": [{ + "custom-constraint-query": { + "constraint-name": "similar", + "text": uri + } + }] + } + }; + + return fetch('/api/search/similar', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json' + }, + body: JSON.stringify(custom), + credentials: 'same-origin' + }).then( + response => { + return response.json().then(function(json) { + return { response: json }; + }); + }, + error => { + return error; + } + ); } }; diff --git a/src/components/ml-similar.vue b/src/components/ml-similar.vue index c5af0fc..6109a5d 100755 --- a/src/components/ml-similar.vue +++ b/src/components/ml-similar.vue @@ -11,6 +11,8 @@