aboutsummaryrefslogtreecommitdiff
path: root/src/server/Search.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Search.ts')
-rw-r--r--src/server/Search.ts25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/server/Search.ts b/src/server/Search.ts
index 9e462f0ae..4911edd1d 100644
--- a/src/server/Search.ts
+++ b/src/server/Search.ts
@@ -5,6 +5,31 @@ import { thisExpression } from 'babel-types';
export class Search {
public static Instance = new Search();
private url = 'http://localhost:8983/solr/';
+ private client: any;
+
+ constructor() {
+ console.log("Search Instantiated!");
+ var SolrNode = require('solr-node');
+ this.client = new SolrNode({
+ host: 'localhost',
+ port: '8983',
+ core: 'dash',
+ protocol: 'http'
+ });
+ var strQuery = this.client.query().q('text:test');
+
+ console.log(strQuery);
+
+ // Search documents using strQuery
+ // client.search(strQuery, (err: any, result: any) => {
+ // if (err) {
+ // console.log(err);
+ // return;
+ // }
+ // console.log('Response:', result.response);
+ // });
+ }
+
public async updateDocument(document: any) {
console.log("UPDATE: ", JSON.stringify(document));