Skip to content

Commit

Permalink
Merge pull request #29 from palantirnet/root-198-remove-default-field…
Browse files Browse the repository at this point in the history
…-from-query

ROOT-198: remove default field from queries, make autocomplete wildcard* configurable
  • Loading branch information
agentrickard authored Mar 6, 2019
2 parents 353d178 + f32f7f9 commit b139db4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/.env.local.js.example
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ module.exports = {
// 'ds_federated_date',
// 'sm_federated_terms',
// ],
// OPTIONAL: Provides config for adding autocomplete functionality to text search
// OPTIONAL: Provides config for adding autocomplete functionality to text search, defaults to false
// autocomplete : {
// url: <your-endpoint-for-autocomplete-results>, // required @todo document accepted types
// queryField: 'tem_suggestion_title', // REQUIRED
// suggestionRows: 5, // REQUIRED: no current default set
// appendWildcard: true, // OPTIONAL: defaults to false, whether or not to append wildcard to query term
// suggestionRows: 5, // OPTIONAL: defaults to 5
// numChars: 2, // OPTIONAL: defaults to 2, number of characters *after* which autocomplete results should appear
// mode: 'result', // REQUIRED: show search-as-you-type results ('result', default) or search term ('term') suggestions
// result: { // OPTIONAL: define result based autocomplete-specific config
Expand All @@ -59,7 +59,7 @@ module.exports = {
// },
// term: { // OPTIONAL: define term based autocomplete-specific config
// titleText: 'What would you like to search for?', // OPTIONAL: default set
// showDirectionsText: true, // OPTIONAL: defaults to false
// showDirectionsText: false, // OPTIONAL: defaults to true
// },
// },
};
4 changes: 2 additions & 2 deletions src/components/text-search/search-as-you-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ class FederatedTextSearchAsYouType extends React.Component {
? this.props.autocomplete.result.titleText
: 'What are you looking for?';
const resultShowDirectionsText = hasResultModeConfig
&& this.props.autocomplete.result.showDirectionsText
&& Object.hasOwnProperty.call(this.props.autocomplete.result, 'showDirectionsText')
? this.props.autocomplete.result.showDirectionsText
: true;
const termTitleText = hasTermModeConfig && this.props.autocomplete.term.titleText
? this.props.autocomplete.term.titleText
: 'Suggested search terms';
const termShowDirectionsText = hasTermModeConfig
&& this.props.autocomplete.term.showDirectionsText
&& Object.hasOwnProperty.call(this.props.autocomplete.term, 'showDirectionsText')
? this.props.autocomplete.term.showDirectionsText
: true;

Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7410,7 +7410,7 @@ [email protected]:

"solr-faceted-search-react@git+ssh://[email protected]:palantirnet/solr-faceted-search-react#root-138-autocomplete":
version "0.12.1"
resolved "git+ssh://[email protected]:palantirnet/solr-faceted-search-react#82eb9366e0650b43be57565139da296ffc62e565"
resolved "git+ssh://[email protected]:palantirnet/solr-faceted-search-react#f0df9079a3a0e56d866ff2640c780decc645617a"
dependencies:
classnames "^2.2.5"
prop-types "^15.6.1"
Expand Down

0 comments on commit b139db4

Please sign in to comment.