-
Notifications
You must be signed in to change notification settings - Fork 0
Creating an instance
super-dev edited this page Mar 20, 2022
·
4 revisions
const {
keyword,
result,
renderResult
} = new dddd.Search(data, options);
search source data
- required
- type: array
config extends options
- type: object
- default:
{}
search config options
queryStringKey
search keyword query string key
- type: string
- default:
'q'
fields
search target fields
- type: array
- default:
['title', 'content', 'category', 'sub_category', 'tags']
render options
hasCustomRenderFunction
custom render function availability
- type: boolean
- default:
false
resultSelector.template
search result template block selector
- type: string
- default:
'#template-post-list'
resultSelector.container
target container selector to render search results
- type: string
- default:
'#postSection'
name | type | description |
---|---|---|
keyword |
string | search keyword in query string |
result |
array | search result array |
renderResult |
function | search result render function using default template middleware |