Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set query_type for placeholder to enable confidencescores #918

Merged
merged 1 commit into from Jun 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion controller/placeholder.js
Expand Up @@ -235,7 +235,10 @@ function setup(placeholderService, should_execute) {
// convert results to ES docs
// boundary.country filter must happen after synthesis since multiple
// lineages may produce different country docs
res.meta = {};
res.meta = {
query_type: 'fallback'
};

res.data = results
// filter out results that don't have a name
.filter(hasName)
Expand Down
68 changes: 51 additions & 17 deletions test/unit/controller/placeholder.js
Expand Up @@ -213,7 +213,9 @@ module.exports.tests.success = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '123',
Expand Down Expand Up @@ -330,7 +332,9 @@ module.exports.tests.success = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '123',
Expand Down Expand Up @@ -392,7 +396,9 @@ module.exports.tests.success = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '123',
Expand Down Expand Up @@ -451,7 +457,9 @@ module.exports.tests.success = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '123',
Expand Down Expand Up @@ -515,7 +523,9 @@ module.exports.tests.success = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '456',
Expand Down Expand Up @@ -579,7 +589,9 @@ module.exports.tests.success = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '1',
Expand Down Expand Up @@ -751,7 +763,9 @@ module.exports.tests.result_filtering = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '1',
Expand Down Expand Up @@ -935,7 +949,9 @@ module.exports.tests.result_filtering = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '1',
Expand Down Expand Up @@ -1072,7 +1088,9 @@ module.exports.tests.result_filtering = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '1',
Expand Down Expand Up @@ -1222,7 +1240,9 @@ module.exports.tests.result_filtering = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '1',
Expand Down Expand Up @@ -1325,7 +1345,9 @@ module.exports.tests.lineage_errors = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '123',
Expand Down Expand Up @@ -1397,7 +1419,9 @@ module.exports.tests.lineage_errors = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '123',
Expand Down Expand Up @@ -1468,7 +1492,9 @@ module.exports.tests.lineage_errors = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '123',
Expand Down Expand Up @@ -1526,7 +1552,9 @@ module.exports.tests.geometry_errors = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '123',
Expand Down Expand Up @@ -1584,7 +1612,9 @@ module.exports.tests.centroid_errors = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '123',
Expand Down Expand Up @@ -1643,7 +1673,9 @@ module.exports.tests.centroid_errors = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '123',
Expand Down Expand Up @@ -1712,7 +1744,9 @@ module.exports.tests.boundingbox_errors = (test, common) => {

controller(req, res, () => {
const expected_res = {
meta: {},
meta: {
query_type: 'fallback'
},
data: [
{
_id: '123',
Expand Down