Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hello,

I am using the standard couch search and couch form. I want to be able to search using only mobile numbers (an editable region) in my masterpage for the search tag and then list out everything. But search form should only expect mobile numbers.

Can this be achieved?

If so, how?

Regards,
GenXCoders
Image
where innovation meets technology
Hi,

The 'search' feature, as I am sure you know, piggybacks on MySQL fulltext search. By default, data from all the text fields of any page being saved is culled into a single field and saved to be used for searching.

Which would mean that we cannot constrain the search to use only a single field.

However, if the mobile numbers are being saved as part of the full text you can input the mobile number into the search textbox and it will bring up the relevant pages. If that is happening then you can create your own custom search form (using cms:input) and then apply constraints on it to allow only inputs that are mobile numbers (i.e. a string of numbers with a particular length).

Hope this helps..
@KK Sir,
Sir as always your suggestion helped. I have actually implemented the constraints on the input field itself stating that the number is of length exactly equal to 10 and that they data fed in has to be numbers using regex:
Code: Select all
pattern="[1-9]{1}[0-9]{9}"

Thanks once again.
Regards,
GenXCoders (Aashish)
Image
where innovation meets technology
3 posts Page 1 of 1
cron