diff --git a/src/js/react/Recommender/models/searchExamples.js b/src/js/react/Recommender/models/searchExamples.js index 1168c7bc1..8e78bbf30 100644 --- a/src/js/react/Recommender/models/searchExamples.js +++ b/src/js/react/Recommender/models/searchExamples.js @@ -39,7 +39,7 @@ define([], function() { }, { label: 'first author', - syntax: 'author:"^%"', + syntax: 'first_author:"%"', examples: authors, }, { diff --git a/src/js/widgets/search_bar/autocomplete.js b/src/js/widgets/search_bar/autocomplete.js index a36926245..0a1f763dd 100644 --- a/src/js/widgets/search_bar/autocomplete.js +++ b/src/js/widgets/search_bar/autocomplete.js @@ -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:""', diff --git a/src/js/widgets/search_bar/quick-field-desc.js b/src/js/widgets/search_bar/quick-field-desc.js index 0b784eedc..2b0a06911 100644 --- a/src/js/widgets/search_bar/quick-field-desc.js +++ b/src/js/widgets/search_bar/quick-field-desc.js @@ -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', diff --git a/src/js/widgets/search_bar/search_bar_widget.js b/src/js/widgets/search_bar/search_bar_widget.js index 84f087bb4..84a4f2a30 100644 --- a/src/js/widgets/search_bar/search_bar_widget.js +++ b/src/js/widgets/search_bar/search_bar_widget.js @@ -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, ''); } @@ -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 == '(') {