I have a search option in my ElasticSearch UI search kit project, and I need it to show results based exactly on what the user searches. Currently, if a user searches for “DRAD”, the results include “FRDA”, “RAD”, “DA”, “ADR”, and other partial matches. However, I want the search engine to return only the exact match for the keyword.
search setting configuration
search_settings: {
highlight_attributes: ["title"],
snippet_attributes: ["content", "date"],
search_attributes: [{ field: "title", weight: 3 }, "content", "tags"],
result_attributes: ["title", "url", "tags", "date"],
facet_attributes: [{
field: "tags",
type: "string",
attribute: "tags"
}],
const search = instantsearch({
indexName : '',
searchClient: SearchkitInstantsearchClient(sk),
})
`serach box setup`
search.addWidgets([
instantsearch.widgets.searchBox({
container: "#searchbox",
searchAsYouType: true,
//queryType: 'prefixNone',
searchablePlaceholder: 'Search Here',
}),
New contributor
ITCYT is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.