I have this "indexer" template:
<cfquery name="LOCAL.modelli" datasource="xxx">
SELECT id, name, brand FROM products
</cfquery>
<cfindex action="refresh"
collection="mycoll"
key="id"
type="custom"
title="nome"
query="LOCAL.modelli"
body="nome" />
And I am using this code for searching ( #t# is coming from search form field ) :
<cfsearch collection="mycoll" name="LOCAL.ricerca" criteria="#t#" status="LOCAL.searchStatus" suggestions="always" />
Imagine I have this "products" table in DB:
ID | Name |
1 | FRAG 13 |
2 | FOOBAR |
3 | FROGSKIN |
Searching "frog" DOES NOT FIND "Frogskin" !
Instead, it suggests "frag".
Is this behavior normal? Can you explain it to me?
How can I make my search engine find "frogskin", with "frog" as a criteria? (I'd like to avoid doing a SQL query to "products" to enhance results) .
Thank you.
Without using a wildcard, the engine will look for the exact word, "frog"
You need to use a wildcard ?
or *
. Note that SOLR does not support leading wildcards so
*frog
would not find bullfrog
but frog*
should find frogskin
see Solr search examples for more information on searching with SOLR and ColdFusion.