◆ SearchProp()
com.harsh.searchwidget.Builder.SearchProp.SearchProp |
( |
String |
componentId, |
|
|
ArrayList< String > |
dataField |
|
) |
| |
Initialises SearchProp builder
- Parameters
-
componentId | Unique identifier of the component |
dataField | Data field(s) on which the search query will be applied to |
◆ build()
Compiles all the parameter into one SearchPropModel
- Returns
- Object of SearchPropModel
◆ setAggregationFields()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setAggregationFields |
( |
ArrayList< String > |
aggregationFields | ) |
|
Sets the field on which aggregation needs to be run
- Parameters
-
aggregationFields | The fields on which aggregation query will be made |
- Returns
◆ setAggregationName()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setAggregationName |
( |
String |
aggregationName | ) |
|
Sets specific name for the given aggregation query. Default name is "unique-terms"
- Parameters
-
aggregationName | Name of the aggregation query |
- Returns
◆ setAggregrationState()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setAggregrationState |
( |
boolean |
isAggregration | ) |
|
Sets the state of aggregation functionality
- Parameters
-
isAggregration | Whether aggregation count should be done or not |
- Returns
◆ setAutoSuggest()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setAutoSuggest |
( |
Boolean |
autoSuggest | ) |
|
Sets state of auto suggest functionality
- Parameters
-
autoSuggest | Sets whether the autosuggest functionality should be enabled or disabled |
- Returns
◆ setCategoryField()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setCategoryField |
( |
String |
categoryField | ) |
|
Sets category field parameter
- Parameters
-
categoryField | Data field which has the category values mapped |
- Returns
◆ setDebounce()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setDebounce |
( |
int |
debounce | ) |
|
Sets debounce for given query
- Parameters
-
debounce | sets the milliseconds to wait before executing the query. Defaults to 0, i.e. no debounce |
- Returns
◆ setDefaultSuggestions()
Sets default suggestions for search bar
- Parameters
-
defaultSuggestions | Preset search suggestions to be shown on focus when the search box does not have any search query text set. Default suggestions should be an array list of suggestion model class |
- Returns
◆ setDefaultValue()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setDefaultValue |
( |
String |
defaultValue | ) |
|
Sets default value parameter
- Parameters
-
defaultValue | Sets the initial search query text on mount & the category |
- Returns
◆ setExtraFields()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setExtraFields |
( |
ArrayList< String > |
extraFields | ) |
|
Sets extra fields to be returned for every search result These fields are parsed from the JSON response returned for the given search query Mainly used for displaying complete information of a search result on click gesture
- Parameters
-
extraFields | List of extra fields to be retrieved |
- Returns
◆ setFuzziness()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setFuzziness |
( |
String |
fuzziness | ) |
|
Sets fuzziness for given query
- Parameters
-
fuzziness | Sets a maximum edit distance on the search parameters, can be "0", "1", "2" or “AUTO”. Useful for showing the correct results for an incorrect search parameter by taking the fuzziness into account |
- Returns
◆ setHighlight()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setHighlight |
( |
Boolean |
highlight | ) |
|
Sets state of highlight functionality
- Parameters
-
highlight | Whether highlighting should be enabled in the returned results |
- Returns
◆ setHighlightField()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setHighlightField |
( |
ArrayList< String > |
highlightField | ) |
|
Sets the fields to be returned when highlighting is on
- Parameters
-
highlightField | When highlighting is enabled, this prop allows specifying the fields which should be returned with the matching highlights. When not specified, it defaults to applying highlights on the field(s) specified in the dataField prop |
- Returns
◆ setHitsEnabled()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setHitsEnabled |
( |
boolean |
hitsEnabled | ) |
|
Sets state of hits functionality
- Parameters
-
hitsEnabled | Whether number of hits should be displayed for each search result |
- Returns
◆ setInPlaceCategory()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setInPlaceCategory |
( |
boolean |
inPlaceCategory | ) |
|
Sets position of category text
- true: Below the search result
- false: As a separate result at the top
- Parameters
-
inPlaceCategory | Boolean state for positioning category text |
- Returns
◆ setQueryFormat()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setQueryFormat |
( |
String |
queryFormat | ) |
|
Sets the query format of the request
- Parameters
-
queryFormat | Sets the query format, can be "or" or "and". Defaults to "and" |
- Returns
◆ setRedirectIcon()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setRedirectIcon |
( |
boolean |
redirectIconState | ) |
|
Sets redirect icon at the end of every search result entry (Applicable only if the search result redirects to the actual product)
- Parameters
-
redirectIconState | Whether to show redirect icon |
- Returns
◆ setSearchResultImage()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setSearchResultImage |
( |
boolean |
searchResultImageState | ) |
|
Sets image or icon before the search results/suggestions
- Parameters
-
searchResultImageState | Whether to show search icon/image before search results |
- Returns
◆ setTopEntries()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setTopEntries |
( |
int |
topEntries | ) |
|
Sets category below the search results for given top entries
- Parameters
-
topEntries | Entries from top for which category is to be displayed |
- Returns
◆ setWeights()
SearchProp com.harsh.searchwidget.Builder.SearchProp.setWeights |
( |
ArrayList< Integer > |
weights | ) |
|
Sets weight array for data fields
- Parameters
-
weights | Sets the search weight for the database fields, useful when dataField is an Array of more than one field. A higher number implies a higher relevance weight for the corresponding field in the search results |
- Returns
The documentation for this class was generated from the following file:
- /Users/harshpatel/Desktop/Appbase.io/android-searchbox/searchwidget/src/main/java/com/harsh/searchwidget/Builder/SearchProp.java