Skip to content

Commit

Permalink
Merge pull request #213 from City-of-Helsinki/dev
Browse files Browse the repository at this point in the history
Dev to main
  • Loading branch information
jeremysteerio authored Mar 16, 2023
2 parents 8c477dc + b10522b commit e5dcd3b
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 18 deletions.

Large diffs are not rendered by default.

This file was deleted.

6 changes: 3 additions & 3 deletions public/modules/custom/helfi_rekry_job_search/assets/main.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,29 @@ const useQueryString = (urlParams: URLParams): string => {
bool: {
should: [
{
match_phrase_prefix: {
term: {
[IndexFields.RECRUITMENT_ID]: urlParams.keyword.toString(),
},
},
{
term: {
[IndexFields.RECRUITMENT_ID]: urlParams.keyword.toString().toUpperCase(),
},
},
{
combined_fields: {
query: urlParams.keyword.toString(),
fields: [`${IndexFields.TITLE}^2`, IndexFields.EMPLOYMENT, IndexFields.ORGANIZATION_NAME],
fields: [`${IndexFields.TITLE}^2`],
},
},
{
term: {
[IndexFields.EMPLOYMENT]: urlParams.keyword.toString(),
},
},
{
term: {
[IndexFields.ORGANIZATION_NAME]: urlParams.keyword.toString(),
},
},
{
Expand Down Expand Up @@ -107,7 +122,7 @@ const useQueryString = (urlParams: URLParams): string => {
urlParams.language
? {
term: {
[`${IndexFields.LANGUAGE}.keyword`]: urlParams.language.toString(),
[IndexFields.LANGUAGE]: urlParams.language.toString(),
},
}
: languageFilter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import IndexFields from '../enum/IndexFields';

// Filter by current language
export const languageFilter = {
term: { [`${IndexFields.LANGUAGE}.keyword`]: window.drupalSettings.path.currentLanguage || 'fi' },
term: { [`${IndexFields.LANGUAGE}`]: window.drupalSettings.path.currentLanguage || 'fi' },
};

// Filter out taxonomy terms
Expand All @@ -13,7 +13,7 @@ export const nodeFilter = {

// Alphabetical sort for terms
const alphabeticallySortTerms = {
'name.keyword': {
name: {
order: 'asc',
},
};
Expand Down Expand Up @@ -41,7 +41,7 @@ export const AGGREGATIONS = {
},
employment_search_id: {
terms: {
field: 'employment_search_id.keyword',
field: 'employment_search_id',
size: 100,
},
},
Expand All @@ -58,12 +58,12 @@ export const EMPLOYMENT_FILTER_OPTIONS = {
query: {
bool: {
should: [
{ term: { 'field_search_id.keyword': CustomIds.FIXED_CONTRACTUAL } },
{ term: { 'field_search_id.keyword': CustomIds.FIXED_SERVICE } },
{ term: { 'field_search_id.keyword': CustomIds.PERMANENT_CONTRACTUAL } },
{ term: { 'field_search_id.keyword': CustomIds.PERMANENT_SERVICE } },
{ term: { 'field_search_id.keyword': CustomIds.TRAINING } },
{ term: { 'field_search_id.keyword': CustomIds.ALTERNATION } },
{ term: { field_search_id: CustomIds.FIXED_CONTRACTUAL } },
{ term: { field_search_id: CustomIds.FIXED_SERVICE } },
{ term: { field_search_id: CustomIds.PERMANENT_CONTRACTUAL } },
{ term: { field_search_id: CustomIds.PERMANENT_SERVICE } },
{ term: { field_search_id: CustomIds.TRAINING } },
{ term: { field_search_id: CustomIds.ALTERNATION } },
],
minimum_should_match: 1,
filter: [languageFilter, { term: { [IndexFields.ENTITY_TYPE]: 'taxonomy_term' } }],
Expand All @@ -78,7 +78,7 @@ export const LANGUAGE_OPTIONS = {
aggs: {
languages: {
terms: {
field: '_language.keyword',
field: '_language',
},
},
},
Expand All @@ -103,7 +103,7 @@ export const TASK_AREA_OPTIONS = {
filter: [
{
term: {
'vid.keyword': 'task_area',
vid: 'task_area',
},
},
{
Expand Down

0 comments on commit e5dcd3b

Please sign in to comment.