IO-2283 - Add Plate Number to global search
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -117,4 +117,6 @@ logs/oAuthClient-log.log
|
|||||||
|
|
||||||
.node-persist/**
|
.node-persist/**
|
||||||
|
|
||||||
/*.env.*
|
/*.env.*
|
||||||
|
.idea/*
|
||||||
|
.idea
|
||||||
@@ -54,6 +54,7 @@ export default function GlobalSearchOs() {
|
|||||||
job.v_make_desc || ""
|
job.v_make_desc || ""
|
||||||
} ${job.v_model_desc || ""}`}</span>
|
} ${job.v_model_desc || ""}`}</span>
|
||||||
<span>{`${job.clm_no || ""}`}</span>
|
<span>{`${job.clm_no || ""}`}</span>
|
||||||
|
<span>{`${job.plate_no || ""}`}</span>
|
||||||
</Space>
|
</Space>
|
||||||
</Link>
|
</Link>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ const aws4 = require("aws4");
|
|||||||
const { gql } = require("graphql-request");
|
const { gql } = require("graphql-request");
|
||||||
|
|
||||||
var host = process.env.OPEN_SEARCH_HOST;
|
var host = process.env.OPEN_SEARCH_HOST;
|
||||||
|
|
||||||
const createAwsConnector = (credentials, region) => {
|
const createAwsConnector = (credentials, region) => {
|
||||||
class AmazonConnection extends Connection {
|
class AmazonConnection extends Connection {
|
||||||
buildRequestObject(params) {
|
buildRequestObject(params) {
|
||||||
@@ -207,13 +208,15 @@ async function OpenSearchUpdateHandler(req, res) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function OpensearchSearchHandler(req, res) {
|
async function OpenSearchSearchHandler(req, res) {
|
||||||
try {
|
try {
|
||||||
const { search, bodyshopid, index } = req.body;
|
const { search, bodyshopid, index } = req.body;
|
||||||
|
|
||||||
if (!req.user) {
|
if (!req.user) {
|
||||||
res.sendStatus(401);
|
res.sendStatus(401);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.log("os-search", "DEBUG", req.user.email, null, {
|
logger.log("os-search", "DEBUG", req.user.email, null, {
|
||||||
search,
|
search,
|
||||||
});
|
});
|
||||||
@@ -273,7 +276,7 @@ async function OpensearchSearchHandler(req, res) {
|
|||||||
{
|
{
|
||||||
query_string: {
|
query_string: {
|
||||||
query: `*${search}*`,
|
query: `*${search}*`,
|
||||||
|
// Weighted Fields
|
||||||
fields: [
|
fields: [
|
||||||
"*ro_number^20",
|
"*ro_number^20",
|
||||||
"*clm_no^14",
|
"*clm_no^14",
|
||||||
@@ -320,4 +323,4 @@ async function OpensearchSearchHandler(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.handler = OpenSearchUpdateHandler;
|
exports.handler = OpenSearchUpdateHandler;
|
||||||
exports.search = OpensearchSearchHandler;
|
exports.search = OpenSearchSearchHandler;
|
||||||
|
|||||||
Reference in New Issue
Block a user