Skip to content

Commit

Permalink
made linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
theorm committed Jul 11, 2024
1 parent fb898ba commit 929d796
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/services/entities-mentions/entities-mentions.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function parseSolrResponse(response, entityTypeMapping) {

function parseSingleItemSolrResponse(response, entityTypeMapping) {
const docs = get(response, 'response.docs', []);
return docs.map(doc => documentToEntityOrMention(doc, entityTypeMapping))[0]
return docs.map(doc => documentToEntityOrMention(doc, entityTypeMapping))[0];
}

class EntitiesMentions {
Expand Down
32 changes: 16 additions & 16 deletions test/services/entities-mentions.test.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
const assert = require("assert");
const assert = require('assert');
const {
buildSolrQuery,
} = require("../../src/services/entities-mentions/entities-mentions.class");
} = require('../../src/services/entities-mentions/entities-mentions.class');

describe("'entities-mentions' service", () => {
it("builds Solr query", () => {
it('builds Solr query', () => {
const filters = [
{
type: "string",
q: ["Jacque Chira"],
type: 'string',
q: ['Jacque Chira'],
},
{
type: "mentionFunction",
q: "ministre",
type: 'mentionFunction',
q: 'ministre',
},
];
const query = buildSolrQuery(filters);
const expectedQuery = {
query:
"((mentionSuggest:Jacque AND mentionSuggest:Chira*) OR (entitySuggest:Jacque AND entitySuggest:Chira*)) AND filter(m_function_s:ministre)",
'((mentionSuggest:Jacque AND mentionSuggest:Chira*) OR (entitySuggest:Jacque AND entitySuggest:Chira*)) AND filter(m_function_s:ministre)',
params: {
group: true,
"group.field": "e_id_s",
"group.format": "simple",
'group.field': 'e_id_s',
'group.format': 'simple',
rows: 10,
start: 0,
},
Expand All @@ -31,20 +31,20 @@ describe("'entities-mentions' service", () => {
assert.deepStrictEqual(query, expectedQuery);
});

it("builds simple Solr query", () => {
it('builds simple Solr query', () => {
const filters = [
{
type: "string",
q: "Chira",
type: 'string',
q: 'Chira',
},
];
const query = buildSolrQuery(filters, 5, 10);
const expectedQuery = {
query: "(mentionSuggest:Chira* OR entitySuggest:Chira*)",
query: '(mentionSuggest:Chira* OR entitySuggest:Chira*)',
params: {
group: true,
"group.field": "e_id_s",
"group.format": "simple",
'group.field': 'e_id_s',
'group.format': 'simple',
rows: 5,
start: 10,
},
Expand Down

0 comments on commit 929d796

Please sign in to comment.