From 575eead80f8b5b798935a02eec212f83690c9cf7 Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Sat, 12 Aug 2017 11:05:19 +0530 Subject: [PATCH] Enable validation checks on JSON files --- build.xml | 2 +- .../test-files/modelExamples/fq-model.json | 41 ++++++----- .../modelExamples/linear-model.json | 71 +++++++++++-------- 3 files changed, 67 insertions(+), 47 deletions(-) diff --git a/build.xml b/build.xml index 79326e97d17..f2043e20e21 100755 --- a/build.xml +++ b/build.xml @@ -138,7 +138,7 @@ 'java', 'jflex', 'py', 'pl', 'g4', 'jj', 'html', 'js', 'css', 'xml', 'xsl', 'vm', 'sh', 'cmd', 'bat', 'policy', 'properties', 'mdtext', - 'template', 'adoc', + 'template', 'adoc', 'json', ]; def invalidPatterns = [ (~$/@author\b/$) : '@author javadoc tag', diff --git a/solr/contrib/ltr/src/test-files/modelExamples/fq-model.json b/solr/contrib/ltr/src/test-files/modelExamples/fq-model.json index b5d631fdefa..93e69d770a1 100644 --- a/solr/contrib/ltr/src/test-files/modelExamples/fq-model.json +++ b/solr/contrib/ltr/src/test-files/modelExamples/fq-model.json @@ -1,20 +1,25 @@ { - "class":"org.apache.solr.ltr.model.LinearModel", - "name":"fqmodel", - "features":[ - { - "name":"matchedTitle", - "norm": { - "class":"org.apache.solr.ltr.norm.MinMaxNormalizer", - "params":{ "min":"0.0f", "max":"10.0f" } - } - }, - { "name":"popularity"} - ], - "params":{ - "weights": { - "matchedTitle": 0.5, - "popularity": 0.5 - } - } + "class":"org.apache.solr.ltr.model.LinearModel", + "name":"fqmodel", + "features":[ + { + "name": "matchedTitle", + "norm": { + "class": "org.apache.solr.ltr.norm.MinMaxNormalizer", + "params": { + "min": "0.0f", + "max": "10.0f" + } + } + }, + { + "name": "popularity" + } + ], + "params": { + "weights": { + "matchedTitle": 0.5, + "popularity": 0.5 + } + } } diff --git a/solr/contrib/ltr/src/test-files/modelExamples/linear-model.json b/solr/contrib/ltr/src/test-files/modelExamples/linear-model.json index 6b46dca1ae6..36d796153c2 100644 --- a/solr/contrib/ltr/src/test-files/modelExamples/linear-model.json +++ b/solr/contrib/ltr/src/test-files/modelExamples/linear-model.json @@ -1,30 +1,45 @@ { - "class":"org.apache.solr.ltr.model.LinearModel", - "name":"6029760550880411648", - "features":[ - {"name":"title"}, - {"name":"description"}, - {"name":"keywords"}, - { - "name":"popularity", - "norm": { - "class":"org.apache.solr.ltr.norm.MinMaxNormalizer", - "params":{ "min":"0.0f", "max":"10.0f" } - } - }, - {"name":"text"}, - {"name":"queryIntentPerson"}, - {"name":"queryIntentCompany"} - ], - "params":{ - "weights": { - "title": 0.0000000000, - "description": 0.1000000000, - "keywords": 0.2000000000, - "popularity": 0.3000000000, - "text": 0.4000000000, - "queryIntentPerson":0.1231231, - "queryIntentCompany":0.12121211 - } - } + "class": "org.apache.solr.ltr.model.LinearModel", + "name": "6029760550880411648", + "features": [ + { + "name": "title" + }, + { + "name": "description" + }, + { + "name": "keywords" + }, + { + "name": "popularity", + "norm": { + "class": "org.apache.solr.ltr.norm.MinMaxNormalizer", + "params": { + "min": "0.0f", + "max": "10.0f" + } + } + }, + { + "name": "text" + }, + { + "name": "queryIntentPerson" + }, + { + "name": "queryIntentCompany" + } + ], + "params": { + "weights": { + "title": 0.0000000000, + "description": 0.1000000000, + "keywords": 0.2000000000, + "popularity": 0.3000000000, + "text": 0.4000000000, + "queryIntentPerson": 0.1231231, + "queryIntentCompany": 0.12121211 + } + } }