Skip to content

Commit

Permalink
change first author syntax to use 'first_author' field
Browse files Browse the repository at this point in the history
  • Loading branch information
thostetler committed Dec 20, 2024
1 parent dc1e147 commit bdf362e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/js/react/Recommender/models/searchExamples.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ define([], function() {
},
{
label: 'first author',
syntax: 'author:"^%"',
syntax: 'first_author:"%"',
examples: authors,
},
{
Expand Down
8 changes: 4 additions & 4 deletions src/js/widgets/search_bar/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ define(['jquery', 'analytics'], function($, analytics) {
const autocompleteSource = [
{ value: 'author:""', label: 'Author', match: 'author:"' },

{ value: 'author:"^"', label: 'First Author', match: 'author:"' },
{ value: 'author:"^"', label: 'First Author', match: 'first author' },
{ value: 'author:"^"', label: 'First Author', match: '^author' },
{ value: 'author:"^"', label: 'First Author', match: 'author:"^' },
{ value: 'first_author:""', label: 'First Author', match: 'author:"' },
{ value: 'first_author:""', label: 'First Author', match: 'first author' },
{ value: 'first_author:""', label: 'First Author', match: '^author' },
{ value: 'first_author:""', label: 'First Author', match: 'author:"^' },

{
value: 'bibstem:""',
Expand Down
4 changes: 2 additions & 2 deletions src/js/widgets/search_bar/quick-field-desc.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ define({
'first-author': {
title: 'first author',
description: 'Search by first author of the paper',
syntax: ['author:"^Last, F"'],
example: ['author:"^huchra, j"'],
syntax: ['first_author:"Last, F"'],
example: ['first_author:"huchra, j"'],
},
full: {
title: 'fulltext',
Expand Down
6 changes: 3 additions & 3 deletions src/js/widgets/search_bar/search_bar_widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ define([
case 'fields':
{
if (val === 'first-author') {
val = 'author';
selected = selected.replace(/"/, '"^');
val = 'first_author';
// selected = selected.replace(/"/, '"^');
} else if (val === 'year') {
selected = selected.replace(/"/g, '');
}
Expand Down Expand Up @@ -372,7 +372,7 @@ define([
return;
}
} else if (df == 'first-author') {
newVal = ' author:"^' + selected + '"';
newVal = ' first_author:"' + selected + '"';
} else if (punc == '"') {
newVal = df + ':"' + selected + '"';
} else if (punc == '(') {
Expand Down

0 comments on commit bdf362e

Please sign in to comment.