Commit cf9c6011 by Sxy

fix: 优化一版

parent 5a2f954a
...@@ -10,6 +10,7 @@ cerebro: http://192.168.18.102:3000 ...@@ -10,6 +10,7 @@ cerebro: http://192.168.18.102:3000
cnlength:"中文长度", cnlength:"中文长度",
enlength:"英文长度", enlength:"英文长度",
otherlength:"数字特殊符号长度", otherlength:"数字特殊符号长度",
pinyin:"同音字设计",
"name" : { "name" : {
"type" : "keyword", "type" : "keyword",
"fields" : { "fields" : {
...@@ -181,6 +182,9 @@ cerebro: http://192.168.18.102:3000 ...@@ -181,6 +182,9 @@ cerebro: http://192.168.18.102:3000
}, },
"otherlength": { "otherlength": {
"type": "integer" "type": "integer"
},
"pinyin":{
"type": "keyword"
} }
} }
} }
......
const router = require('koa-router')() const router = require('koa-router')()
const start = require("../start") const start = require("../startV1")
const es = require("../client/esclient"); const es = require("../client/esclient");
router.get('/', async (ctx, next) => { router.get('/', async (ctx, next) => {
await ctx.render('index') await ctx.render('index')
...@@ -8,29 +8,37 @@ router.get('/', async (ctx, next) => { ...@@ -8,29 +8,37 @@ router.get('/', async (ctx, next) => {
router.post('/list', async (ctx, next) => { router.post('/list', async (ctx, next) => {
const { page, limit, conditions, name } = ctx.request.body; const { page, limit, conditions, name } = ctx.request.body;
let query = await start(name, conditions) let query = await start(name, conditions)
query = { if (query.length > 0) {
query: { query = {
bool: { query: {
should: query bool: {
} should: query
}, }
"from": (page - 1) * limit, },
"size": limit, "from": (page - 1) * limit,
} "size": limit,
console.log(JSON.stringify(query)) }
const data = await es.search({ console.log(JSON.stringify(query))
index: "trademarkv2", const data = await es.search({
body: query index: "trademarkv3",
}) body: query
const { body: { hits: { total, hits } } } = data; })
ctx.body = { const { body: { hits: { total, hits } } } = data;
list: hits.map(item => { ctx.body = {
return { list: hits.map(item => {
name: item._source.name return {
} name: item._source.name
}), }
count: total.value, }),
query count: total.value,
query
}
} else {
ctx.body = {
list: [],
count: 0,
query
}
} }
}) })
......
This diff is collapsed. Click to expand it.
...@@ -132,6 +132,9 @@ ...@@ -132,6 +132,9 @@
}, },
"otherlength": { "otherlength": {
"type": "integer" "type": "integer"
},
"pinyin": {
"type": "keyword"
} }
} }
} }
......
...@@ -67,18 +67,29 @@ ...@@ -67,18 +67,29 @@
<script> <script>
const options = [ const options = [
"1. 完全相同", "1. 完全相同",
"2. 完全相同加英文/图形符号,如:小米与小米A或A小米", "2. 完全相同加英文/图形符号,后缀",
"3. 倒序或倒序加英文/图形符号,如:小米与米小,全聚德与德聚全;小米与米小A或A米小;", "3. 完全相同加英文/图形符号,前缀",
"4.同音不同字或同音不同字加英文/图形符号,如:华为与铧为,华为与铧为A或A铧为;(同词加字母的组合展示)", "4. 倒序",
"5. 同音不同字倒序或同音不同字倒序加英文/图形符号,如:华为与为铧或与为铧A或A为铧", "5. 倒序加英文/图形符号,后缀",
"6. 完全相同后缀加字/词近似,如:小米与小米智慧或小米米等;", "6. 倒序加英文/图形符号,前缀",
"7. 完全相同前缀加字/词近似,如:小米与智慧小米或米小米等;", "7. 同音不同字",
"8. 倒序后缀加字/词近似,如:华为与为华智慧或为华大等;", "8. 同音不同字加英文/图形符号,后缀",
"9. 倒序前缀加字/词近似,如:华为与智慧为华或大为华等;", "9. 同音不同字加英文/图形符号,前缀",
"10. 相同词中加虚词或相同词中加虚词加英文/图形符号,如:小米与小之米或小之米A;", "10.同音不同字倒序",
"11. 商标文字含义相同/近似(也包含拼音/英文)", "11.同音不同字倒序加英文/图形符号,后缀",
"12. 同字形不同音或同字形不同音加英文/图形符号,如:华为与毕为或毕为A;", "12.同音不同字倒序加英文/图形符号,前缀",
"13. 相同减字/词或相同减字/词加英文/图形符号,如:全聚德与全德或全德A;" "13.完全相同后缀加字/词近似,如:小米与小米智慧或小米米等;",
"14.完全相同前缀加字/词近似,如:小米与智慧小米或米小米等;",
"15.倒序后缀加字/词近似,如:华为与为华智慧或为华大等;",
"16.倒序前缀加字/词近似,如:华为与智慧为华或大为华等;",
"17.相同词中加虚词",
"18.相同词中加虚词加英文/图形符号",
"19.商标文字含义相同/近似(也包含拼音/英文)",
"20.同字形不同音",
"21.同字形不同音加英文/图形符号",
"22.相同减字/词",
"23.相同减字/词加英文/图形符号,后缀",
"24.相同减字/词加英文/图形符号,前缀"
]; ];
new Vue({ new Vue({
el: '#app', el: '#app',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment