Search function
function (doc) {
for(var j =1;j<doc.sheets[1].data.length;j++){
index("Name", doc.sheets[1].data[j]);
}
}
My analyzer is standard. How would I modify this function so as to achieve search with partial matching.
you should be able to use *
and other from special characters as part of the query syntax to perform wildcard searches, fuzzy searches, etc.
from https://console.bluemix.net/docs/services/Cloudant/api/search.html#query-syntax:
If you want a fuzzy search, you can run a query with
~
to find terms like the search term. For instance,look~
finds the termsbook
andtook
.
and
Wildcard searches are supported, for both single (
?
) and multiple (*
) character searches. For example,dat?
would matchdate
anddata
, whereasdat*
would matchdate
,data
,database
, anddates
.